Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::TransferFunctionProperty Class Reference

Property for storing a mitk::TransferFunction. More...

#include <mitkTransferFunctionProperty.h>

Inheritance diagram for mitk::TransferFunctionProperty:
Collaboration diagram for mitk::TransferFunctionProperty:

Public Types

typedef mitk::TransferFunction::Pointer ValueType
 The type of the value stored by this property. More...
 

Public Member Functions

 mitkClassMacro (TransferFunctionProperty, BaseProperty)
 
Pointer Clone () const
 
 mitkNewMacro1Param (TransferFunctionProperty, mitk::TransferFunction::Pointer)
 
virtual void SetValue (mitk::TransferFunction::Pointer _arg)
 Set the transfer function. More...
 
virtual mitk::TransferFunction::Pointer GetValue () const
 Get the transfer function. More...
 
std::string GetValueAsString () const override
 Return the transfer function as a string (address representation). More...
 
bool ToJSON (nlohmann::json &j) const override
 Serialize the transfer function to JSON. More...
 
bool FromJSON (const nlohmann::json &j) override
 Deserialize the transfer function from JSON. More...
 
BaseProperty & operator= (const BaseProperty &property)
 Assign a property value to this instance. More...
 
- Public Member Functions inherited from mitk::BaseProperty
 mitkClassMacroItkParent (BaseProperty, itk::Object)
 
Pointer Clone () const
 
bool operator== (const BaseProperty &property) const
 Compare two properties for equality. More...
 
BaseProperty & operator= (const BaseProperty &property)
 Assign a property value to this instance. More...
 
bool AssignProperty (const BaseProperty &property)
 Assign a property value to this instance and report success. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 TransferFunctionProperty ()
 
 TransferFunctionProperty (const TransferFunctionProperty &other)
 
 TransferFunctionProperty (mitk::TransferFunction::Pointer value)
 
 mitkCloneMacro (TransferFunctionProperty)
 
- Protected Member Functions inherited from mitk::BaseProperty
 BaseProperty ()
 
 BaseProperty (const BaseProperty &other)
 
 ~BaseProperty () override
 

Protected Attributes

mitk::TransferFunction::Pointer m_Value
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::BaseProperty
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING
 Default return value for properties that cannot be converted to a string. More...
 

Detailed Description

Property for storing a mitk::TransferFunction.

Holds a transfer function that maps scalar values to colors and opacities for volume rendering or other rendering modes. The transfer function consists of scalar opacity, gradient opacity, and color transfer function components.

Note
If you want to use this property for an mitk::Image, make sure to set the mitk::RenderingModeProperty to a mode which supports transfer functions (e.g. COLORTRANSFERFUNCTION_COLOR). See the documentation of mitk::RenderingModeProperty. For a code example see mitkImageVtkMapper2DTransferFunctionTest.cpp in Core/Code/Testing.
See also
BaseProperty
TransferFunction
RenderingModeProperty

Definition at line 38 of file mitkTransferFunctionProperty.h.

Member Typedef Documentation

◆ ValueType

typedef mitk::TransferFunction::Pointer mitk::TransferFunctionProperty::ValueType

The type of the value stored by this property.

Definition at line 42 of file mitkTransferFunctionProperty.h.

Constructor & Destructor Documentation

◆ TransferFunctionProperty() [1/3]

mitk::TransferFunctionProperty::TransferFunctionProperty ( )
protected

◆ TransferFunctionProperty() [2/3]

mitk::TransferFunctionProperty::TransferFunctionProperty ( const TransferFunctionProperty &  other)
protected

◆ TransferFunctionProperty() [3/3]

mitk::TransferFunctionProperty::TransferFunctionProperty ( mitk::TransferFunction::Pointer  value)
protected

Member Function Documentation

◆ Clone()

Pointer mitk::TransferFunctionProperty::Clone ( ) const

◆ FromJSON()

bool mitk::TransferFunctionProperty::FromJSON ( const nlohmann::json &  j)
overridevirtual

Deserialize the transfer function from JSON.

Reads scalar opacity points, gradient opacity points, and color transfer function nodes from a structured JSON object and creates a new TransferFunction instance.

Parameters
[in]jThe JSON object containing the transfer function data.
Returns
Always true.

Implements mitk::BaseProperty.

◆ GetValue()

virtual mitk::TransferFunction::Pointer mitk::TransferFunctionProperty::GetValue ( ) const
virtual

Get the transfer function.

Returns
The stored transfer function smart pointer.

◆ GetValueAsString()

std::string mitk::TransferFunctionProperty::GetValueAsString ( ) const
overridevirtual

Return the transfer function as a string (address representation).

Returns
A string representation of the transfer function pointer.

Reimplemented from mitk::BaseProperty.

◆ mitkClassMacro()

mitk::TransferFunctionProperty::mitkClassMacro ( TransferFunctionProperty  ,
BaseProperty   
)

◆ mitkCloneMacro()

mitk::TransferFunctionProperty::mitkCloneMacro ( TransferFunctionProperty  )
protected

◆ mitkNewMacro1Param()

mitk::TransferFunctionProperty::mitkNewMacro1Param ( TransferFunctionProperty  ,
mitk::TransferFunction::Pointer   
)

◆ New()

static Pointer mitk::TransferFunctionProperty::New ( )
static

◆ operator=()

BaseProperty& mitk::BaseProperty::operator=

Assign a property value to this instance.

Performs a polymorphic assignment from the given property. The assignment succeeds only if the source and target properties are of the same type. The subclass-specific Assign() method is called to perform the actual value copy.

Subclasses must implement Assign(const BaseProperty&) and call the superclass Assign method for proper handling. The copy assignment operator of the subclass should be disabled and the base class operator should be made visible using "using" statements.

Parameters
[in]propertyThe property whose value should be assigned to this instance.
Returns
A reference to this property.
See also
AssignProperty
Assign

◆ SetValue()

virtual void mitk::TransferFunctionProperty::SetValue ( mitk::TransferFunction::Pointer  _arg)
virtual

Set the transfer function.

Parameters
[in]_argThe new transfer function smart pointer.

◆ ToJSON()

bool mitk::TransferFunctionProperty::ToJSON ( nlohmann::json &  j) const
overridevirtual

Serialize the transfer function to JSON.

Serializes scalar opacity points, gradient opacity points, and color transfer function nodes into a structured JSON object.

Parameters
[out]jThe JSON object to write the value into.
Returns
Always true.

Implements mitk::BaseProperty.

Member Data Documentation

◆ m_Value

mitk::TransferFunction::Pointer mitk::TransferFunctionProperty::m_Value
protected

Definition at line 95 of file mitkTransferFunctionProperty.h.


The documentation for this class was generated from the following file: