MCPcopy Create free account
hub / github.com/MITK/MITK / ApplyColorTransferFunction

Method ApplyColorTransferFunction

Modules/Core/src/Rendering/mitkImageVtkMapper2D.cpp:646–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646void mitk::ImageVtkMapper2D::ApplyColorTransferFunction(mitk::BaseRenderer *renderer)
647{
648 mitk::TransferFunctionProperty::Pointer transferFunctionProp = dynamic_cast<mitk::TransferFunctionProperty *>(
649 this->GetDataNode()->GetProperty("Image Rendering.Transfer Function", renderer));
650
651 if (transferFunctionProp.IsNull())
652 {
653 MITK_ERROR << "'Image Rendering.Mode'' was set to use a color transfer function but there is no property 'Image "
654 "Rendering.Transfer Function'. Nothing will be done.";
655 return;
656 }
657 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
658 // pass the transfer function to our level window filter
659 localStorage->m_LevelWindowFilter->SetLookupTable(transferFunctionProp->GetValue()->GetColorTransferFunction());
660 localStorage->m_LevelWindowFilter->SetOpacityPiecewiseFunction(
661 transferFunctionProp->GetValue()->GetScalarOpacityFunction());
662}
663
664void mitk::ImageVtkMapper2D::SetToInvalidState(mitk::ImageVtkMapper2D::LocalStorage* localStorage)
665{

Callers 1

ApplyRenderingModeMethod · 0.95

Calls 7

GetPropertyMethod · 0.45
GetDataNodeMethod · 0.45
IsNullMethod · 0.45
GetLocalStorageMethod · 0.45
SetLookupTableMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected