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

Central node class of the MITK data tree, associating a data object with properties and mappers. More...

#include <mitkDataNode.h>

Inheritance diagram for mitk::DataNode:
Collaboration diagram for mitk::DataNode:

Public Types

typedef mitk::Geometry3D::Pointer Geometry3DPointer
 Smart pointer type for Geometry3D. More...
 
typedef std::vector< itk::SmartPointer< Mapper > > MapperVector
 Vector of Mapper smart pointers, indexed by MapperSlotId. More...
 
typedef std::map< std::string, mitk::PropertyList::Pointer > MapOfPropertyLists
 Map from renderer name strings to renderer-specific PropertyList instances. More...
 
typedef std::vector< MapOfPropertyLists::key_type > PropertyListKeyNames
 Vector of renderer name keys used in the MapOfPropertyLists. More...
 
typedef std::set< std::string > GroupTagList
 Set of group tag name strings (keys of GroupTagProperty entries). More...
 

Public Member Functions

 mitkClassMacroItkParent (DataNode, itk::DataObject)
 
BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
 Retrieve a property as a const pointer (IPropertyProvider interface). More...
 
std::vector< std::string > GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override
 Retrieve all property keys for a given context (IPropertyProvider interface). More...
 
std::vector< std::string > GetPropertyContextNames () const override
 Retrieve all available property context names (IPropertyProvider interface). More...
 
BaseProperty * GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
 Retrieve a mutable property pointer (IPropertyOwner interface). More...
 
void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Set a property in the given context (IPropertyOwner interface). More...
 
void RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Remove a property from the given context (IPropertyOwner interface). More...
 
mitk::Mapper * GetMapper (MapperSlotId id) const
 Get the Mapper for the given mapper slot, creating it on demand if necessary. More...
 
BaseData * GetData () const
 Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode. More...
 
template<typename T >
T * GetDataAs () const
 Convenience method to get the data object cast to a specific type. More...
 
vtkLinearTransform * GetVtkTransform (int t=0) const
 Get the transformation applied prior to displaying the data as a vtkTransform. More...
 
virtual void SetData (mitk::BaseData *baseData)
 Set the data object (instance of BaseData, e.g., an Image) managed by this DataNode. More...
 
virtual void SetDataInteractor (const DataInteractor::Pointer interactor)
 Set the DataInteractor associated with this node. More...
 
virtual DataInteractor::Pointer GetDataInteractor () const
 Get the DataInteractor associated with this node. More...
 
mitk::DataNode & operator= (const DataNode &right)
 Assignment operator. Creates a new DataNode with the data from right. More...
 
mitk::DataNode & operator= (BaseData *right)
 Assignment operator. Creates a new DataNode with the given BaseData. More...
 
virtual void SetMapper (MapperSlotId id, mitk::Mapper *mapper)
 Set a specific Mapper for the given mapper slot. More...
 
void UpdateOutputInformation () override
 Update the output information by calling the source's UpdateOutputInformation(). More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Set the requested region to the largest possible region (no-op for DataNode). More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Check if the requested region is outside of the buffered region. More...
 
bool VerifyRequestedRegion () override
 Verify that the requested region is valid. More...
 
void SetRequestedRegion (const itk::DataObject *data) override
 Set the requested region from another data object (no-op for DataNode). More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information from another data object (no-op for DataNode). More...
 
PropertyListKeyNames GetPropertyListNames () const
 The "names" used for (renderer-specific) PropertyLists in GetPropertyList(string). More...
 
void SetProperty (const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
 Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value. More...
 
void ReplaceProperty (const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
 Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference. More...
 
void AddProperty (const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
 Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value. More...
 
mitk::PropertyList * GetPropertyList (const mitk::BaseRenderer *renderer=nullptr) const
 Get the PropertyList of the renderer. If renderer is nullptr, the BaseRenderer-independent PropertyList of this DataNode is returned. More...
 
mitk::PropertyList * GetPropertyList (const std::string &rendererName) const
 Get the PropertyList for a renderer identified by name. More...
 
void ConcatenatePropertyList (PropertyList *pList, bool replace=false)
 Add values from another PropertyList. More...
 
mitk::BaseProperty * GetProperty (const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr, bool fallBackOnDataProperties=true) const
 Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetProperty (itk::SmartPointer< T > &property, const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
 Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetProperty (T *&property, const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
 Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetPropertyValue (const char *propertyKey, T &value, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for GenericProperty<T> properties. More...
 
GroupTagList GetGroupTags () const
 Get a set of all group tags from this node's property list. More...
 
bool GetBoolProperty (const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for bool properties (instances of BoolProperty). More...
 
bool GetIntProperty (const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for int properties (instances of IntProperty). More...
 
bool GetFloatProperty (const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for float properties (instances of FloatProperty). More...
 
bool GetDoubleProperty (const char *propertyKey, double &doubleValue, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for double properties (instances of DoubleProperty). More...
 
bool GetStringProperty (const char *propertyKey, std::string &string, const mitk::BaseRenderer *renderer=nullptr) const
 Convenience access method for string properties (instances of StringProperty). More...
 
bool GetColor (float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
 Convenience access method for color properties (instances of ColorProperty). More...
 
bool GetLevelWindow (mitk::LevelWindow &levelWindow, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="levelwindow") const
 Convenience access method for level-window properties (instances of LevelWindowProperty). More...
 
void SetSelected (bool selected, const mitk::BaseRenderer *renderer=nullptr)
 Set the selection state of this node. More...
 
bool IsSelected (const mitk::BaseRenderer *renderer=nullptr)
 Query whether this node is currently selected. More...
 
bool GetName (std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
 Convenience access method for accessing the name of an object (instance of StringProperty with property-key "name") More...
 
virtual std::string GetName () const
 Extra convenience access method for accessing the name of an object (instance of StringProperty with property-key "name"). More...
 
virtual void SetName (const char *name)
 Extra convenience access method to set the name of an object. More...
 
virtual void SetName (const std::string &name)
 Extra convenience access method to set the name of an object. More...
 
bool GetVisibility (bool &visible, const mitk::BaseRenderer *renderer, const char *propertyKey="visible") const
 Convenience access method for visibility properties (instances of BoolProperty with property-key "visible") More...
 
bool GetOpacity (float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey="opacity") const
 Convenience access method for opacity properties (instances of FloatProperty). More...
 
bool IsOn (const char *propertyKey, const mitk::BaseRenderer *renderer, bool defaultIsOn=true) const
 Convenience access method for boolean properties (instances of BoolProperty). Return value is the value of the property. If the property is not found, the value of defaultIsOn is returned. More...
 
bool IsVisible (const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
 Convenience access method for visibility properties (instances of BoolProperty). Return value is the visibility. Default is visible==true, i.e., true is returned even if the property (propertyKey) is not found. More...
 
void SetColor (const mitk::Color &color, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color")
 Convenience method for setting color properties (instances of ColorProperty). More...
 
void SetColor (float red, float green, float blue, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color")
 Convenience method for setting color properties from individual RGB components. More...
 
void SetColor (const float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color")
 Convenience method for setting color properties from a float array. More...
 
void SetVisibility (bool visible, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="visible")
 Convenience method for setting visibility properties (instances of BoolProperty) More...
 
void SetOpacity (float opacity, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="opacity")
 Convenience method for setting opacity properties (instances of FloatProperty). More...
 
void SetLevelWindow (mitk::LevelWindow levelWindow, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="levelwindow")
 Convenience method for setting level-window properties (instances of LevelWindowProperty). More...
 
void SetIntProperty (const char *propertyKey, int intValue, const mitk::BaseRenderer *renderer=nullptr)
 Convenience method for setting int properties (instances of IntProperty). More...
 
void SetBoolProperty (const char *propertyKey, bool boolValue, const mitk::BaseRenderer *renderer=nullptr)
 Convenience method for setting boolean properties (instances of BoolProperty). More...
 
void SetFloatProperty (const char *propertyKey, float floatValue, const mitk::BaseRenderer *renderer=nullptr)
 Convenience method for setting float properties (instances of FloatProperty). More...
 
void SetDoubleProperty (const char *propertyKey, double doubleValue, const mitk::BaseRenderer *renderer=nullptr)
 Convenience method for setting double properties (instances of DoubleProperty). More...
 
void SetStringProperty (const char *propertyKey, const char *string, const mitk::BaseRenderer *renderer=nullptr)
 Convenience method for setting string properties (instances of StringProperty). More...
 
itk::ModifiedTimeType GetMTime () const override
 Get the timestamp of the last change of the contents of this node or the referenced BaseData. More...
 
unsigned long GetDataReferenceChangedTime () const
 Get the timestamp of the last change of the reference to the BaseData. More...
 
- Public Member Functions inherited from mitk::IPropertyOwner
 ~IPropertyOwner () override
 
virtual bool PropertyIsOwned (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const
 Checks if a certain property exists. More...
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 Virtual destructor. More...
 

Static Public Member Functions

static Pointer New ()
 
static std::string NO_NAME_VALUE ()
 Sentinel value indicating that a node name has not been set yet. More...
 

Protected Member Functions

 DataNode ()
 
 ~DataNode () override
 
virtual void PropertyListModified (const itk::Object *caller, const itk::EventObject &event)
 Invoked when the property list was modified. Calls Modified() of the DataNode. More...
 

Protected Attributes

MapperVector m_Mappers
 Mapper-slots. More...
 
BaseData::Pointer m_Data
 The data object (instance of BaseData, e.g., an Image) managed by this DataNode. More...
 
PropertyList::Pointer m_PropertyList
 BaseRenderer-independent PropertyList. More...
 
MapOfPropertyLists m_MapOfPropertyLists
 Map associating each BaseRenderer with its own PropertyList. More...
 
DataInteractor::Pointer m_DataInteractor
 
itk::TimeStamp m_DataReferenceChangedTime
 Timestamp of the last change of m_Data. More...
 
unsigned long m_PropertyListModifiedObserverTag
 

Detailed Description

Central node class of the MITK data tree, associating a data object with properties and mappers.

A DataNode holds a reference to a BaseData object (e.g., an Image, Surface, or PointSet) along with a set of properties that control visualization and application behavior. Each DataNode can carry renderer-specific property lists in addition to its default (renderer-independent) PropertyList, enabling per-renderer customization of rendering parameters such as visibility, color, and opacity.

Mappers are created on demand for each mapper slot (e.g., 2D mapper, 3D mapper) via the CoreObjectFactory and are responsible for translating the node's data and properties into visual representations.

DataNodes are managed by a DataStorage, which organizes them in a directed acyclic graph with parent-child ("was created by") relationships.

See also
DataStorage, BaseData, Mapper, PropertyList, BaseRenderer
Warning
Change in semantics of SetProperty() since Aug 25th 2006. Check your usage of this method if you do more with properties than just call SetProperty( "key", new SomeProperty("value") ).

Definition at line 71 of file mitkDataNode.h.

Member Typedef Documentation

◆ Geometry3DPointer

typedef mitk::Geometry3D::Pointer mitk::DataNode::Geometry3DPointer

Smart pointer type for Geometry3D.

Definition at line 75 of file mitkDataNode.h.

◆ GroupTagList

typedef std::set<std::string> mitk::DataNode::GroupTagList

Set of group tag name strings (keys of GroupTagProperty entries).

Definition at line 83 of file mitkDataNode.h.

◆ MapOfPropertyLists

typedef std::map<std::string, mitk::PropertyList::Pointer> mitk::DataNode::MapOfPropertyLists

Map from renderer name strings to renderer-specific PropertyList instances.

Definition at line 79 of file mitkDataNode.h.

◆ MapperVector

Vector of Mapper smart pointers, indexed by MapperSlotId.

Definition at line 77 of file mitkDataNode.h.

◆ PropertyListKeyNames

typedef std::vector<MapOfPropertyLists::key_type> mitk::DataNode::PropertyListKeyNames

Vector of renderer name keys used in the MapOfPropertyLists.

Definition at line 81 of file mitkDataNode.h.

Constructor & Destructor Documentation

◆ DataNode()

mitk::DataNode::DataNode ( )
protected

◆ ~DataNode()

mitk::DataNode::~DataNode ( )
overrideprotected

Member Function Documentation

◆ AddProperty()

void mitk::DataNode::AddProperty ( const char *  propertyKey,
BaseProperty *  property,
const mitk::BaseRenderer *  renderer = nullptr,
bool  overwrite = false 
)

Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value.

Foroverwrite ==false the property isnot changed if it already exists. Foroverwrite ==true the method is identical to SetProperty.

See also
SetProperty
GetProperty
m_PropertyList
m_MapOfPropertyLists

◆ ConcatenatePropertyList()

void mitk::DataNode::ConcatenatePropertyList ( PropertyList *  pList,
bool  replace = false 
)

Add values from another PropertyList.

Overwrites values in m_PropertyList only when possible (i.e. when types are compatible). If you want to allow for object type changes (replacing a "visible":BoolProperty with "visible":IntProperty, set replace .

Parameters
replacetrue: if
pListcontains a property "visible" of type ColorProperty and our m_PropertyList also has a "visible" property of a different type (e.g. BoolProperty), change the type, i.e. replace the objects behind the pointer.
See also
SetProperty
ReplaceProperty
m_PropertyList

◆ CopyInformation()

void mitk::DataNode::CopyInformation ( const itk::DataObject *  data)
override

Copy information from another data object (no-op for DataNode).

Parameters
[in]dataThe data object to copy information from.

◆ GetBoolProperty()

bool mitk::DataNode::GetBoolProperty ( const char *  propertyKey,
bool &  boolValue,
const mitk::BaseRenderer *  renderer = nullptr 
) const

Convenience access method for bool properties (instances of BoolProperty).

Parameters
[in]propertyKeyThe key of the BoolProperty.
[out]boolValueReceives the boolean value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found.
See also
SetBoolProperty, IsOn

◆ GetColor()

bool mitk::DataNode::GetColor ( float  rgb[3],
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "color" 
) const

Convenience access method for color properties (instances of ColorProperty).

Parameters
[out]rgbArray of 3 floats receiving the RGB color values.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
[in]propertyKeyThe key of the ColorProperty (default: "color").
Returns
true if the property was found.
See also
SetColor

◆ GetConstProperty()

BaseProperty::ConstPointer mitk::DataNode::GetConstProperty ( const std::string &  propertyKey,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = true 
) const
overridevirtual

Retrieve a property as a const pointer (IPropertyProvider interface).

Looks up the property first in the context-specific PropertyList identified by contextName (i.e., a renderer name). If not found and fallBackOnDefaultContext is true (or contextName is empty), the default PropertyList and then the data object's properties are searched.

Parameters
[in]propertyKeyThe key of the property to retrieve.
[in]contextNameRenderer name context. Empty string means the default context.
[in]fallBackOnDefaultContextIf true, falls back to the default PropertyList when the property is not found in the specified context.
Returns
The property, or nullptr if not found.
See also
GetNonConstProperty, GetProperty

Implements mitk::IPropertyProvider.

◆ GetData()

BaseData* mitk::DataNode::GetData ( ) const

◆ GetDataAs()

template<typename T >
T* mitk::DataNode::GetDataAs ( ) const
inline

Convenience method to get the data object cast to a specific type.

Performs a dynamic_cast of the data returned by GetData() to the requested type.

Template Parameters
TThe target data type (must inherit from BaseData).
Returns
Pointer to the data object cast to T, or nullptr if the cast fails or no data is set.
See also
GetData

Definition at line 196 of file mitkDataNode.h.

◆ GetDataInteractor()

virtual DataInteractor::Pointer mitk::DataNode::GetDataInteractor ( ) const
virtual

Get the DataInteractor associated with this node.

Returns
The current DataInteractor, or nullptr if none is set.
See also
SetDataInteractor

◆ GetDataReferenceChangedTime()

unsigned long mitk::DataNode::GetDataReferenceChangedTime ( ) const
inline

Get the timestamp of the last change of the reference to the BaseData.

Definition at line 845 of file mitkDataNode.h.

◆ GetDoubleProperty()

bool mitk::DataNode::GetDoubleProperty ( const char *  propertyKey,
double &  doubleValue,
const mitk::BaseRenderer *  renderer = nullptr 
) const

Convenience access method for double properties (instances of DoubleProperty).

If there is no DoubleProperty for the given propertyKey, the method falls back to looking for a corresponding FloatProperty instance and promoting its value to double.

Parameters
[in]propertyKeyThe key of the DoubleProperty (or FloatProperty).
[out]doubleValueReceives the double value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found (either as DoubleProperty or FloatProperty).
See also
SetDoubleProperty, GetFloatProperty

◆ GetFloatProperty()

bool mitk::DataNode::GetFloatProperty ( const char *  propertyKey,
float &  floatValue,
const mitk::BaseRenderer *  renderer = nullptr 
) const

Convenience access method for float properties (instances of FloatProperty).

Parameters
[in]propertyKeyThe key of the FloatProperty.
[out]floatValueReceives the float value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found.
See also
SetFloatProperty

◆ GetGroupTags()

GroupTagList mitk::DataNode::GetGroupTags ( ) const

Get a set of all group tags from this node's property list.

◆ GetIntProperty()

bool mitk::DataNode::GetIntProperty ( const char *  propertyKey,
int &  intValue,
const mitk::BaseRenderer *  renderer = nullptr 
) const

Convenience access method for int properties (instances of IntProperty).

Parameters
[in]propertyKeyThe key of the IntProperty.
[out]intValueReceives the integer value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found.
See also
SetIntProperty

◆ GetLevelWindow()

bool mitk::DataNode::GetLevelWindow ( mitk::LevelWindow &  levelWindow,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "levelwindow" 
) const

Convenience access method for level-window properties (instances of LevelWindowProperty).

Parameters
[out]levelWindowReceives the LevelWindow value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
[in]propertyKeyThe key of the LevelWindowProperty (default: "levelwindow").
Returns
true if the property was found.
See also
SetLevelWindow

◆ GetMapper()

mitk::Mapper* mitk::DataNode::GetMapper ( MapperSlotId  id) const

Get the Mapper for the given mapper slot, creating it on demand if necessary.

Each mapper slot corresponds to a specific rendering context (e.g., 2D or 3D). If no mapper exists yet for the given slot, one is created via CoreObjectFactory.

Parameters
[in]idThe mapper slot identifier.
Returns
Pointer to the mapper, or nullptr if no mapper could be created.
See also
SetMapper

◆ GetMTime()

itk::ModifiedTimeType mitk::DataNode::GetMTime ( ) const
override

Get the timestamp of the last change of the contents of this node or the referenced BaseData.

◆ GetName() [1/2]

virtual std::string mitk::DataNode::GetName ( ) const
inlinevirtual

Extra convenience access method for accessing the name of an object (instance of StringProperty with property-key "name").

This method does not take the renderer specific propertylists into account, because the name of an object should never be renderer specific.

Returns
a std::string with the name of the object (content of "name" Property). If there is no "name" Property, an empty string will be returned.

Definition at line 601 of file mitkDataNode.h.

References mitk::StringProperty::GetValue().

◆ GetName() [2/2]

bool mitk::DataNode::GetName ( std::string &  nodeName,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "name" 
) const
inline

Convenience access method for accessing the name of an object (instance of StringProperty with property-key "name")

Returns
true property was found

Definition at line 585 of file mitkDataNode.h.

◆ GetNonConstProperty()

BaseProperty* mitk::DataNode::GetNonConstProperty ( const std::string &  propertyKey,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = true 
)
overridevirtual

Retrieve a mutable property pointer (IPropertyOwner interface).

Behaves like GetConstProperty() but returns a non-const pointer.

Parameters
[in]propertyKeyThe key of the property to retrieve.
[in]contextNameRenderer name context. Empty string means the default context.
[in]fallBackOnDefaultContextIf true, falls back to the default PropertyList when the property is not found in the specified context.
Returns
A mutable pointer to the property, or nullptr if not found.
See also
GetConstProperty

Implements mitk::IPropertyOwner.

◆ GetOpacity()

bool mitk::DataNode::GetOpacity ( float &  opacity,
const mitk::BaseRenderer *  renderer,
const char *  propertyKey = "opacity" 
) const

Convenience access method for opacity properties (instances of FloatProperty).

Parameters
[out]opacityReceives the opacity value (0.0 to 1.0) if the property is found.
[in]rendererThe renderer whose PropertyList is checked first.
[in]propertyKeyThe key of the FloatProperty (default: "opacity").
Returns
true if the property was found.
See also
SetOpacity

◆ GetProperty() [1/3]

mitk::BaseProperty* mitk::DataNode::GetProperty ( const char *  propertyKey,
const mitk::BaseRenderer *  renderer = nullptr,
bool  fallBackOnDataProperties = true 
) const

Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.

If renderer is nullptr or the propertyKey cannot be found in the PropertyList specific to renderer or is disabled there, the BaseRenderer-independent PropertyList of this DataNode is queried.

If fallBackOnDataProperties is true, the data property list is queried as a last resort.

See also
GetPropertyList
m_PropertyList
m_MapOfPropertyLists

◆ GetProperty() [2/3]

template<typename T >
bool mitk::DataNode::GetProperty ( itk::SmartPointer< T > &  property,
const char *  propertyKey,
const mitk::BaseRenderer *  renderer = nullptr 
) const
inline

Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.

If renderer is nullptr or the propertyKey cannot be found in the PropertyList specific to renderer or is disabled there, the BaseRenderer-independent PropertyList of this DataNode is queried.

See also
GetPropertyList
m_PropertyList
m_MapOfPropertyLists

Definition at line 418 of file mitkDataNode.h.

◆ GetProperty() [3/3]

template<typename T >
bool mitk::DataNode::GetProperty ( T *&  property,
const char *  propertyKey,
const mitk::BaseRenderer *  renderer = nullptr 
) const
inline

Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.

If renderer is nullptr or the propertyKey cannot be found in the PropertyList specific to renderer or is disabled there, the BaseRenderer-independent PropertyList of this DataNode is queried.

See also
GetPropertyList
m_PropertyList
m_MapOfPropertyLists

Definition at line 438 of file mitkDataNode.h.

◆ GetPropertyContextNames()

std::vector<std::string> mitk::DataNode::GetPropertyContextNames ( ) const
overridevirtual

Retrieve all available property context names (IPropertyProvider interface).

Returns the names of all renderer-specific PropertyLists that have been created for this node. These names correspond to BaseRenderer names.

Returns
A vector of context name strings.

Implements mitk::IPropertyProvider.

◆ GetPropertyKeys()

std::vector<std::string> mitk::DataNode::GetPropertyKeys ( const std::string &  contextName = "",
bool  includeDefaultContext = false 
) const
overridevirtual

Retrieve all property keys for a given context (IPropertyProvider interface).

Parameters
[in]contextNameRenderer name context. Empty string returns keys from the default PropertyList.
[in]includeDefaultContextIf true, keys from the default PropertyList are included in addition to the context-specific keys.
Returns
A vector of property key strings.

Implements mitk::IPropertyProvider.

◆ GetPropertyList() [1/2]

mitk::PropertyList* mitk::DataNode::GetPropertyList ( const mitk::BaseRenderer *  renderer = nullptr) const

Get the PropertyList of the renderer. If renderer is nullptr, the BaseRenderer-independent PropertyList of this DataNode is returned.

See also
GetProperty
m_PropertyList
m_MapOfPropertyLists

◆ GetPropertyList() [2/2]

mitk::PropertyList* mitk::DataNode::GetPropertyList ( const std::string &  rendererName) const

Get the PropertyList for a renderer identified by name.

If rendererName is empty, the BaseRenderer-independent PropertyList is returned. If no PropertyList exists yet for the given renderer name, a new empty one is created.

Parameters
[in]rendererNameThe name of the renderer. Empty string returns the default list.
Returns
The PropertyList for the specified renderer.
See also
GetPropertyList(const mitk::BaseRenderer*), GetPropertyListNames

◆ GetPropertyListNames()

PropertyListKeyNames mitk::DataNode::GetPropertyListNames ( ) const

The "names" used for (renderer-specific) PropertyLists in GetPropertyList(string).

All possible values for the "renderer" parameters of the diverse GetProperty/List() methods.

◆ GetPropertyValue()

template<typename T >
bool mitk::DataNode::GetPropertyValue ( const char *  propertyKey,
T &  value,
const mitk::BaseRenderer *  renderer = nullptr 
) const
inline

Convenience access method for GenericProperty<T> properties.

Retrieves the value of a GenericProperty<T> identified by propertyKey.

Template Parameters
TThe value type of the GenericProperty.
Parameters
[in]propertyKeyThe key of the property to look up.
[out]valueReceives the property value if found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found and successfully cast to GenericProperty<T>.

Definition at line 456 of file mitkDataNode.h.

References mitk::GenericProperty< T >::GetValue().

◆ GetStringProperty()

bool mitk::DataNode::GetStringProperty ( const char *  propertyKey,
std::string &  string,
const mitk::BaseRenderer *  renderer = nullptr 
) const

Convenience access method for string properties (instances of StringProperty).

Parameters
[in]propertyKeyThe key of the StringProperty.
[out]stringReceives the string value if the property is found.
[in]rendererIf non-null, the renderer-specific PropertyList is checked first.
Returns
true if the property was found.
See also
SetStringProperty

◆ GetVisibility()

bool mitk::DataNode::GetVisibility ( bool &  visible,
const mitk::BaseRenderer *  renderer,
const char *  propertyKey = "visible" 
) const
inline

Convenience access method for visibility properties (instances of BoolProperty with property-key "visible")

Returns
true property was found
See also
IsVisible

Definition at line 661 of file mitkDataNode.h.

◆ GetVtkTransform()

vtkLinearTransform* mitk::DataNode::GetVtkTransform ( int  t = 0) const

Get the transformation applied prior to displaying the data as a vtkTransform.

Convenience shortcut for GetData()->GetGeometry(t)->GetVtkTransform().

◆ IsOn()

bool mitk::DataNode::IsOn ( const char *  propertyKey,
const mitk::BaseRenderer *  renderer,
bool  defaultIsOn = true 
) const
inline

Convenience access method for boolean properties (instances of BoolProperty). Return value is the value of the property. If the property is not found, the value of defaultIsOn is returned.

Thus, the return value has a different meaning than in the GetBoolProperty method!

See also
GetBoolProperty

Definition at line 686 of file mitkDataNode.h.

◆ IsSelected()

bool mitk::DataNode::IsSelected ( const mitk::BaseRenderer *  renderer = nullptr)

Query whether this node is currently selected.

Parameters
[in]rendererIf non-null, the renderer-specific "selected" property is checked.
Returns
true if the node is selected, false if unselected or the property is missing.
See also
SetSelected

◆ IsVisible()

bool mitk::DataNode::IsVisible ( const mitk::BaseRenderer *  renderer,
const char *  propertyKey = "visible",
bool  defaultIsOn = true 
) const
inline

Convenience access method for visibility properties (instances of BoolProperty). Return value is the visibility. Default is visible==true, i.e., true is returned even if the property (propertyKey) is not found.

Thus, the return value has a different meaning than in the GetVisibility method!

See also
GetVisibility
IsOn

Definition at line 705 of file mitkDataNode.h.

◆ mitkClassMacroItkParent()

mitk::DataNode::mitkClassMacroItkParent ( DataNode  ,
itk::DataObject   
)

◆ New()

static Pointer mitk::DataNode::New ( )
static

◆ NO_NAME_VALUE()

static std::string mitk::DataNode::NO_NAME_VALUE ( )
inlinestatic

Sentinel value indicating that a node name has not been set yet.

Returns
The string "No Name!".

Definition at line 613 of file mitkDataNode.h.

◆ operator=() [1/2]

mitk::DataNode& mitk::DataNode::operator= ( BaseData *  right)

Assignment operator. Creates a new DataNode with the given BaseData.

Parameters
[in]rightThe BaseData to assign.
Returns
Reference to a newly created DataNode.

◆ operator=() [2/2]

mitk::DataNode& mitk::DataNode::operator= ( const DataNode &  right)

Assignment operator. Creates a new DataNode with the data from right.

Parameters
[in]rightThe source DataNode to copy data from.
Returns
Reference to a newly created DataNode.

◆ PropertyListModified()

virtual void mitk::DataNode::PropertyListModified ( const itk::Object *  caller,
const itk::EventObject &  event 
)
protectedvirtual

Invoked when the property list was modified. Calls Modified() of the DataNode.

◆ RemoveProperty()

void mitk::DataNode::RemoveProperty ( const std::string &  propertyKey,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = false 
)
overridevirtual

Remove a property from the given context (IPropertyOwner interface).

Parameters
[in]propertyKeyThe key of the property to remove. Must not be empty.
[in]contextNameRenderer name context. Empty string targets the default PropertyList.
[in]fallBackOnDefaultContextIf true, falls back to the default PropertyList when the specified context is not found.
Exceptions
mitk::Exceptionif propertyKey is empty or the context is unknown and fallBackOnDefaultContext is false.

Implements mitk::IPropertyOwner.

◆ ReplaceProperty()

void mitk::DataNode::ReplaceProperty ( const char *  propertyKey,
BaseProperty *  property,
const mitk::BaseRenderer *  renderer = nullptr 
)

Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference.

If renderer is nullptr the property is set in the BaseRenderer-independent PropertyList of this DataNode.

See also
GetProperty
m_PropertyList
m_MapOfPropertyLists

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::DataNode::RequestedRegionIsOutsideOfTheBufferedRegion ( )
override

Check if the requested region is outside of the buffered region.

Returns
Always returns false for DataNode.

◆ SetBoolProperty()

void mitk::DataNode::SetBoolProperty ( const char *  propertyKey,
bool  boolValue,
const mitk::BaseRenderer *  renderer = nullptr 
)

Convenience method for setting boolean properties (instances of BoolProperty).

Parameters
[in]propertyKeyThe key of the BoolProperty.
[in]boolValueThe boolean value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
See also
GetBoolProperty

◆ SetColor() [1/3]

void mitk::DataNode::SetColor ( const float  rgb[3],
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "color" 
)

Convenience method for setting color properties from a float array.

Parameters
[in]rgbArray of 3 floats (red, green, blue), each in range 0.0 to 1.0.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
[in]propertyKeyThe key of the ColorProperty (default: "color").
See also
GetColor

◆ SetColor() [2/3]

void mitk::DataNode::SetColor ( const mitk::Color &  color,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "color" 
)

Convenience method for setting color properties (instances of ColorProperty).

Parameters
[in]colorThe color value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
[in]propertyKeyThe key of the ColorProperty (default: "color").
See also
GetColor

◆ SetColor() [3/3]

void mitk::DataNode::SetColor ( float  red,
float  green,
float  blue,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "color" 
)

Convenience method for setting color properties from individual RGB components.

Parameters
[in]redRed component (0.0 to 1.0).
[in]greenGreen component (0.0 to 1.0).
[in]blueBlue component (0.0 to 1.0).
[in]rendererIf non-null, set in the renderer-specific PropertyList.
[in]propertyKeyThe key of the ColorProperty (default: "color").
See also
GetColor

◆ SetData()

virtual void mitk::DataNode::SetData ( mitk::BaseData *  baseData)
virtual

Set the data object (instance of BaseData, e.g., an Image) managed by this DataNode.

Prior set properties are kept if previous data of the node already exists and has the same type as the new data to be set. Otherwise, the default properties are used. In case that previous data already exists, the property list of the data node is cleared before setting new default properties.

Warning
the actor-mode of the vtkInteractor does not work any more, if the transform of the data-tree-node is connected to the transform of the basedata via vtkTransform->SetInput.

◆ SetDataInteractor()

virtual void mitk::DataNode::SetDataInteractor ( const DataInteractor::Pointer  interactor)
virtual

Set the DataInteractor associated with this node.

Replaces any previously set interactor and fires an InteractorChangedEvent.

Parameters
[in]interactorThe new DataInteractor, or nullptr to clear the interactor.
See also
GetDataInteractor, InteractorChangedEvent

◆ SetDoubleProperty()

void mitk::DataNode::SetDoubleProperty ( const char *  propertyKey,
double  doubleValue,
const mitk::BaseRenderer *  renderer = nullptr 
)

Convenience method for setting double properties (instances of DoubleProperty).

Note
If a FloatProperty with the same key already exists, a warning is issued.
Parameters
[in]propertyKeyThe key of the DoubleProperty.
[in]doubleValueThe double value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
See also
GetDoubleProperty

◆ SetFloatProperty()

void mitk::DataNode::SetFloatProperty ( const char *  propertyKey,
float  floatValue,
const mitk::BaseRenderer *  renderer = nullptr 
)

Convenience method for setting float properties (instances of FloatProperty).

Note
If a DoubleProperty with the same key already exists, a warning is issued.
Parameters
[in]propertyKeyThe key of the FloatProperty.
[in]floatValueThe float value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
See also
GetFloatProperty

◆ SetIntProperty()

void mitk::DataNode::SetIntProperty ( const char *  propertyKey,
int  intValue,
const mitk::BaseRenderer *  renderer = nullptr 
)

Convenience method for setting int properties (instances of IntProperty).

Parameters
[in]propertyKeyThe key of the IntProperty.
[in]intValueThe integer value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
See also
GetIntProperty

◆ SetLevelWindow()

void mitk::DataNode::SetLevelWindow ( mitk::LevelWindow  levelWindow,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "levelwindow" 
)

Convenience method for setting level-window properties (instances of LevelWindowProperty).

Parameters
[in]levelWindowThe LevelWindow value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
[in]propertyKeyThe key of the LevelWindowProperty (default: "levelwindow").
See also
GetLevelWindow

◆ SetMapper()

virtual void mitk::DataNode::SetMapper ( MapperSlotId  id,
mitk::Mapper *  mapper 
)
virtual

Set a specific Mapper for the given mapper slot.

Parameters
[in]idThe mapper slot identifier (e.g., 2D or 3D rendering).
[in]mapperThe Mapper instance to set. If non-null, its DataNode reference is updated.
See also
GetMapper

◆ SetName() [1/2]

virtual void mitk::DataNode::SetName ( const char *  name)
inlinevirtual

Extra convenience access method to set the name of an object.

If the data has already a "name" property, the name will be stored in it. Otherwise, the name will be stored in the non-renderer-specific PropertyList in a StringProperty named "name".

Definition at line 624 of file mitkDataNode.h.

References mitk::StringProperty::SetValue().

◆ SetName() [2/2]

virtual void mitk::DataNode::SetName ( const std::string &  name)
inlinevirtual

Extra convenience access method to set the name of an object.

See also
SetName(const char*)

Definition at line 654 of file mitkDataNode.h.

References SetName().

Referenced by SetName().

◆ SetOpacity()

void mitk::DataNode::SetOpacity ( float  opacity,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "opacity" 
)

Convenience method for setting opacity properties (instances of FloatProperty).

Parameters
[in]opacityThe opacity value (0.0 fully transparent to 1.0 fully opaque).
[in]rendererIf non-null, set in the renderer-specific PropertyList.
[in]propertyKeyThe key of the FloatProperty (default: "opacity").
See also
GetOpacity

◆ SetProperty() [1/2]

void mitk::DataNode::SetProperty ( const char *  propertyKey,
BaseProperty *  property,
const mitk::BaseRenderer *  renderer = nullptr 
)

Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value.

Warning
Change in semantics since Aug 25th 2006. Check your usage of this method if you do more with properties than just call SetProperty( "key", new SomeProperty("value") ).
See also
GetProperty
m_PropertyList
m_MapOfPropertyLists

◆ SetProperty() [2/2]

void mitk::DataNode::SetProperty ( const std::string &  propertyKey,
BaseProperty *  property,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = false 
)
overridevirtual

Set a property in the given context (IPropertyOwner interface).

Parameters
[in]propertyKeyThe key under which to store the property. Must not be empty.
[in]propertyThe property instance to store.
[in]contextNameRenderer name context. Empty string targets the default PropertyList.
[in]fallBackOnDefaultContextIf true, falls back to the default PropertyList when the specified context is not found.
Exceptions
mitk::Exceptionif propertyKey is empty or the context is unknown and fallBackOnDefaultContext is false.

Implements mitk::IPropertyOwner.

◆ SetRequestedRegion()

void mitk::DataNode::SetRequestedRegion ( const itk::DataObject *  data)
override

Set the requested region from another data object (no-op for DataNode).

Parameters
[in]dataThe data object to copy the requested region from.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::DataNode::SetRequestedRegionToLargestPossibleRegion ( )
override

Set the requested region to the largest possible region (no-op for DataNode).

◆ SetSelected()

void mitk::DataNode::SetSelected ( bool  selected,
const mitk::BaseRenderer *  renderer = nullptr 
)

Set the selection state of this node.

Sets the "selected" BoolProperty. If it does not exist, it is created. A ModifiedEvent is invoked if the selection state changes.

Parameters
[in]selectedThe new selection state.
[in]rendererIf non-null, the property is set in the renderer-specific PropertyList.
See also
IsSelected

◆ SetStringProperty()

void mitk::DataNode::SetStringProperty ( const char *  propertyKey,
const char *  string,
const mitk::BaseRenderer *  renderer = nullptr 
)

Convenience method for setting string properties (instances of StringProperty).

Parameters
[in]propertyKeyThe key of the StringProperty.
[in]stringThe string value to set.
[in]rendererIf non-null, set in the renderer-specific PropertyList.
See also
GetStringProperty

◆ SetVisibility()

void mitk::DataNode::SetVisibility ( bool  visible,
const mitk::BaseRenderer *  renderer = nullptr,
const char *  propertyKey = "visible" 
)

Convenience method for setting visibility properties (instances of BoolProperty)

Parameters
visibleIf set to true, the data will be rendered. If false, the render will skip this data.
rendererSpecify a renderer if the visibility shall be specific to a renderer
propertyKeyCan be used to specify a user defined name of the visibility property.

◆ UpdateOutputInformation()

void mitk::DataNode::UpdateOutputInformation ( )
override

Update the output information by calling the source's UpdateOutputInformation().

◆ VerifyRequestedRegion()

bool mitk::DataNode::VerifyRequestedRegion ( )
override

Verify that the requested region is valid.

Returns
Always returns true for DataNode.

Member Data Documentation

◆ m_Data

BaseData::Pointer mitk::DataNode::m_Data
protected

The data object (instance of BaseData, e.g., an Image) managed by this DataNode.

Definition at line 862 of file mitkDataNode.h.

◆ m_DataInteractor

DataInteractor::Pointer mitk::DataNode::m_DataInteractor
protected

Definition at line 875 of file mitkDataNode.h.

◆ m_DataReferenceChangedTime

itk::TimeStamp mitk::DataNode::m_DataReferenceChangedTime
protected

Timestamp of the last change of m_Data.

Definition at line 878 of file mitkDataNode.h.

◆ m_MapOfPropertyLists

MapOfPropertyLists mitk::DataNode::m_MapOfPropertyLists
mutableprotected

Map associating each BaseRenderer with its own PropertyList.

Definition at line 873 of file mitkDataNode.h.

◆ m_Mappers

MapperVector mitk::DataNode::m_Mappers
mutableprotected

Mapper-slots.

Definition at line 856 of file mitkDataNode.h.

◆ m_PropertyList

PropertyList::Pointer mitk::DataNode::m_PropertyList
protected

BaseRenderer-independent PropertyList.

Properties herein can be overwritten specifically for each BaseRenderer by the BaseRenderer-specific properties defined in m_MapOfPropertyLists.

Definition at line 870 of file mitkDataNode.h.

◆ m_PropertyListModifiedObserverTag

unsigned long mitk::DataNode::m_PropertyListModifiedObserverTag
protected

Definition at line 880 of file mitkDataNode.h.


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