Ah sorry, I forgot to mention that. Anyway you found it yourself. Good work! :)
Regards
Thomas
Thomas Kilgus
German Cancer Research Center (DKFZ)
Div. Medical and Biological Informatics
Junior group: Computer-assisted Interventions (E131)
Im Neuenheimer Feld 280
69120 Heidelberg, Germany
Phone: +49(0) 6221-42-3545
From: Michael Helmberger [mailto:[email protected]]
Sent: Montag, 1. Juli 2013 13:56
To: Kilgus, Thomas
Subject: Re: [mitk-users] Transferfunctions
Hello,
if found the error in the code: I had to use the property names "Image
Rendering.Transfer Function" and "Image Rendering.Mode".
now it works like a charm!
thanks :)
2013/7/1 Michael Helmberger
<[email protected]<mailto:[email protected]>>
Hello Thomas,
thanks for the fast reply! I tried setting the property but I think I still
miss something. I use the following code to set the Transferfunction:
// set the rendering mode
mitk::RenderingModeProperty::Pointer renderingModeProp =
mitk::RenderingModeProperty::New()
renderingModeProp->SetValue(mitk::RenderingModeProperty::COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR);
node->SetProperty("RenderingMode", renderingModeProp);
// set the transfer function
mitk::TransferFunctionProperty::Pointer transferFuncProp =
mitk::TransferFunctionProperty::New();
mitk::TransferFunction::Pointer transferFunction =
mitk::TransferFunction::New();
transferFunction->AddRGBPoint(1, 1,0,0); // label 1 should be red
transferFunction->AddRGBPoint(2, 0,1,0); // label 2 green
transferFuncProp->SetValue(transferFunction);
node->SetProperty("TransferFunction", transferFuncProp);
multiWidget->RequestUpdate();
thanks,
michael
ps: sorry for spamming you thomas ;)
2013/7/1 Kilgus, Thomas
<[email protected]<mailto:[email protected]>>
Hi Michael,
if you want to use a TransferFuntionProperty to render an image, you have to
set the property "Image Rendering.Mode" (mitkRenderingModeProperty) to a mode
which enables the TransferFuntion. COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR will
apply your TransferFunction and also allow you to modify the range via the
level window property (level window slider in mitkWorkbench).
COLORTRANSFERFUNCTION_COLOR will only apply your TransferFunction.
Regards,
Thomas
From: Michael Helmberger
[mailto:[email protected]<mailto:[email protected]>]
Sent: Montag, 1. Juli 2013 12:06
To: [email protected]<mailto:[email protected]>
Subject: [mitk-users] Transferfunctions
Hello,
I am using the QmitkStdMultiWidget to display a CT volume and a segmentation. I
would like to assign different colors to different labels in the segmentation,
however setting the TransferFunctionProperty of the corresponding
mitk::DataNode did not change anything.
I also tried changing the Color property, however this does effect the whole
image and I cannot change the color for separate labels.
Thanks,
Michael
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users