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]>
> 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]]
> *Sent:* Montag, 1. Juli 2013 12:06
> *To:* [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