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

Property to associate a mitk::LookupTable with a DataNode. More...

#include <mitkLookupTableProperty.h>

Inheritance diagram for mitk::LookupTableProperty:
Collaboration diagram for mitk::LookupTableProperty:

Public Types

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

Public Member Functions

 mitkClassMacro (LookupTableProperty, BaseProperty)
 
Pointer Clone () const
 
 mitkNewMacro1Param (LookupTableProperty, const mitk::LookupTable::Pointer)
 
virtual LookupTable * GetLookupTable ()
 Get the lookup table (ITK macro-generated accessor). More...
 
ValueType GetValue () const
 Get the lookup table as a smart pointer. More...
 
void SetLookupTable (const mitk::LookupTable::Pointer aLookupTable)
 Set the lookup table. More...
 
void SetValue (const ValueType &)
 Set the lookup table (alias for SetLookupTable()). More...
 
std::string GetValueAsString () const override
 Return a summary string of the lookup table. More...
 
bool ToJSON (nlohmann::json &j) const override
 Serialize the lookup table to JSON. More...
 
bool FromJSON (const nlohmann::json &j) override
 Deserialize the lookup table 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

 LookupTableProperty ()
 
 LookupTableProperty (const LookupTableProperty &)
 
 LookupTableProperty (const mitk::LookupTable::Pointer lut)
 
 mitkCloneMacro (LookupTableProperty)
 
- Protected Member Functions inherited from mitk::BaseProperty
 BaseProperty ()
 
 BaseProperty (const BaseProperty &other)
 
 ~BaseProperty () override
 

Protected Attributes

LookupTable::Pointer m_LookupTable
 

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 to associate a mitk::LookupTable with a DataNode.

Stores a smart pointer to a LookupTable, which defines a color mapping for rendering images with discrete or continuous color scales.

Note
If you want to use this property to colorize an mitk::Image, make sure to set the mitk::RenderingModeProperty to a mode which supports lookup tables (e.g. LOOKUPTABLE_COLOR). See the documentation of mitk::RenderingModeProperty. For a code example see mitkImageVtkMapper2DLookupTableTest.cpp in Core/Code/Testing.
See also
BaseProperty
LookupTable
RenderingModeProperty

Definition at line 37 of file mitkLookupTableProperty.h.

Member Typedef Documentation

◆ ValueType

typedef LookupTable::Pointer mitk::LookupTableProperty::ValueType

The type of the value stored by this property.

Definition at line 52 of file mitkLookupTableProperty.h.

Constructor & Destructor Documentation

◆ LookupTableProperty() [1/3]

mitk::LookupTableProperty::LookupTableProperty ( )
protected

◆ LookupTableProperty() [2/3]

mitk::LookupTableProperty::LookupTableProperty ( const LookupTableProperty &  )
protected

◆ LookupTableProperty() [3/3]

mitk::LookupTableProperty::LookupTableProperty ( const mitk::LookupTable::Pointer  lut)
protected

Member Function Documentation

◆ Clone()

Pointer mitk::LookupTableProperty::Clone ( ) const

◆ FromJSON()

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

Deserialize the lookup table from JSON.

Parameters
[in]jThe JSON object containing lookup table data.
Returns
Always true.

Implements mitk::BaseProperty.

◆ GetLookupTable()

virtual LookupTable* mitk::LookupTableProperty::GetLookupTable ( )
virtual

Get the lookup table (ITK macro-generated accessor).

Returns
A pointer to the stored LookupTable.

◆ GetValue()

ValueType mitk::LookupTableProperty::GetValue ( ) const

Get the lookup table as a smart pointer.

Returns
The stored LookupTable smart pointer.

◆ GetValueAsString()

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

Return a summary string of the lookup table.

Includes the number of colors, the table range, and the first few RGBA entries.

Returns
A string representation of the lookup table.

Reimplemented from mitk::BaseProperty.

◆ mitkClassMacro()

mitk::LookupTableProperty::mitkClassMacro ( LookupTableProperty  ,
BaseProperty   
)

◆ mitkCloneMacro()

mitk::LookupTableProperty::mitkCloneMacro ( LookupTableProperty  )
protected

◆ mitkNewMacro1Param()

mitk::LookupTableProperty::mitkNewMacro1Param ( LookupTableProperty  ,
const mitk::LookupTable::Pointer   
)

◆ New()

static Pointer mitk::LookupTableProperty::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

◆ SetLookupTable()

void mitk::LookupTableProperty::SetLookupTable ( const mitk::LookupTable::Pointer  aLookupTable)

Set the lookup table.

Marks the property as modified if the new table differs from the current one.

Parameters
[in]aLookupTableThe new LookupTable to set.

◆ SetValue()

void mitk::LookupTableProperty::SetValue ( const ValueType &  )

Set the lookup table (alias for SetLookupTable()).

Takes the new LookupTable smart pointer to set.

◆ ToJSON()

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

Serialize the lookup table to JSON.

Serializes all VTK lookup table parameters including scale, ramp, ranges, and the full RGBA color table.

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

Implements mitk::BaseProperty.

Member Data Documentation

◆ m_LookupTable

LookupTable::Pointer mitk::LookupTableProperty::m_LookupTable
protected

Definition at line 40 of file mitkLookupTableProperty.h.


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