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

Property for storing a mitk::LevelWindow value. More...

#include <mitkLevelWindowProperty.h>

Inheritance diagram for mitk::LevelWindowProperty:
Collaboration diagram for mitk::LevelWindowProperty:

Public Types

typedef LevelWindow ValueType
 The type of the value stored by this property. More...
 

Public Member Functions

 mitkClassMacro (LevelWindowProperty, BaseProperty)
 
Pointer Clone () const
 
 mitkNewMacro1Param (LevelWindowProperty, const mitk::LevelWindow &)
 
 ~LevelWindowProperty () override
 
const mitk::LevelWindow & GetLevelWindow () const
 Get the level window value. More...
 
const mitk::LevelWindow & GetValue () const
 Get the level window value (alias for GetLevelWindow()). More...
 
void SetLevelWindow (const LevelWindow &levWin)
 Set the level window value. More...
 
void SetValue (const ValueType &levWin)
 Set the level window value (alias for SetLevelWindow()). More...
 
std::string GetValueAsString () const override
 Return the level window as a human-readable string. More...
 
bool ToJSON (nlohmann::json &j) const override
 Serialize the level window value to JSON. More...
 
bool FromJSON (const nlohmann::json &j) override
 Deserialize the level window value 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

 LevelWindowProperty ()
 
 LevelWindowProperty (const LevelWindowProperty &other)
 
 LevelWindowProperty (const mitk::LevelWindow &levWin)
 
 mitkCloneMacro (LevelWindowProperty)
 
- Protected Member Functions inherited from mitk::BaseProperty
 BaseProperty ()
 
 BaseProperty (const BaseProperty &other)
 
 ~BaseProperty () override
 

Protected Attributes

LevelWindow m_LevWin
 

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::LevelWindow value.

Holds the level/window settings used for intensity windowing during image rendering. The level defines the center of the window, and the window defines its width.

Note
If you want to apply the mitk::LevelWindowProperty to an mitk::Image, make sure to set the mitk::RenderingModeProperty to a mode which supports level window (e.g. LOOKUPTABLE_LEVELWINDOW_COLOR). Check the documentation of mitk::RenderingModeProperty. For a code example see mitkImageVtkMapper2DLevelWindowTest.cpp in Core/Code/Testing.
See also
BaseProperty
LevelWindow
RenderingModeProperty

Definition at line 37 of file mitkLevelWindowProperty.h.

Member Typedef Documentation

◆ ValueType

The type of the value stored by this property.

Definition at line 58 of file mitkLevelWindowProperty.h.

Constructor & Destructor Documentation

◆ LevelWindowProperty() [1/3]

mitk::LevelWindowProperty::LevelWindowProperty ( )
protected

◆ LevelWindowProperty() [2/3]

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

◆ LevelWindowProperty() [3/3]

mitk::LevelWindowProperty::LevelWindowProperty ( const mitk::LevelWindow &  levWin)
protected

◆ ~LevelWindowProperty()

mitk::LevelWindowProperty::~LevelWindowProperty ( )
override

Member Function Documentation

◆ Clone()

Pointer mitk::LevelWindowProperty::Clone ( ) const

◆ FromJSON()

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

Deserialize the level window value from JSON.

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

Implements mitk::BaseProperty.

◆ GetLevelWindow()

const mitk::LevelWindow& mitk::LevelWindowProperty::GetLevelWindow ( ) const

Get the level window value.

Returns
A const reference to the stored LevelWindow.

◆ GetValue()

const mitk::LevelWindow& mitk::LevelWindowProperty::GetValue ( ) const

Get the level window value (alias for GetLevelWindow()).

Returns
A const reference to the stored LevelWindow.

◆ GetValueAsString()

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

Return the level window as a human-readable string.

Format: "L:<level> W:<window>".

Returns
A string representation of the level and window values.

Reimplemented from mitk::BaseProperty.

◆ mitkClassMacro()

mitk::LevelWindowProperty::mitkClassMacro ( LevelWindowProperty  ,
BaseProperty   
)

◆ mitkCloneMacro()

mitk::LevelWindowProperty::mitkCloneMacro ( LevelWindowProperty  )
protected

◆ mitkNewMacro1Param()

mitk::LevelWindowProperty::mitkNewMacro1Param ( LevelWindowProperty  ,
const mitk::LevelWindow &   
)

◆ New()

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

◆ SetLevelWindow()

void mitk::LevelWindowProperty::SetLevelWindow ( const LevelWindow &  levWin)

Set the level window value.

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

Parameters
[in]levWinThe new LevelWindow to set.

◆ SetValue()

void mitk::LevelWindowProperty::SetValue ( const ValueType &  levWin)

Set the level window value (alias for SetLevelWindow()).

Parameters
[in]levWinThe new LevelWindow to set.

◆ ToJSON()

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

Serialize the level window value to JSON.

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

Implements mitk::BaseProperty.

Member Data Documentation

◆ m_LevWin

LevelWindow mitk::LevelWindowProperty::m_LevWin
protected

Definition at line 40 of file mitkLevelWindowProperty.h.


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