Medical Imaging Interaction Toolkit
2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkDataNode_h
14 #define mitkDataNode_h
35 class vtkLinearTransform;
73 itkFactorylessNewMacro(
Self);
77 std::vector<std::string> GetPropertyKeys(
const std::string &contextName =
"",
bool includeDefaultContext =
false)
const override;
78 std::vector<std::string> GetPropertyContextNames()
const override;
81 BaseProperty * GetNonConstProperty(
const std::string &propertyKey,
const std::string &contextName =
"",
bool fallBackOnDefaultContext =
true)
override;
82 void SetProperty(
const std::string &propertyKey,
BaseProperty *property,
const std::string &contextName =
"",
bool fallBackOnDefaultContext =
false)
override;
83 void RemoveProperty(
const std::string &propertyKey,
const std::string &contextName =
"",
bool fallBackOnDefaultContext =
false)
override;
96 return dynamic_cast<T*
>(this->GetData());
104 vtkLinearTransform *GetVtkTransform(
int t = 0)
const;
130 void UpdateOutputInformation()
override;
132 void SetRequestedRegionToLargestPossibleRegion()
override;
134 bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
136 bool VerifyRequestedRegion()
override;
138 void SetRequestedRegion(
const itk::DataObject *data)
override;
140 void CopyInformation(
const itk::DataObject *data)
override;
148 PropertyListKeyNames GetPropertyListNames()
const;
191 void AddProperty(
const char *propertyKey,
194 bool overwrite =
false);
251 template <
typename T>
253 const char *propertyKey,
256 property =
dynamic_cast<T *
>(GetProperty(propertyKey, renderer));
257 return property.IsNotNull();
271 template <
typename T>
274 property =
dynamic_cast<T *
>(GetProperty(propertyKey, renderer));
275 return property !=
nullptr;
283 template <
typename T>
296 GroupTagList GetGroupTags()
const;
303 bool GetBoolProperty(
const char *propertyKey,
bool &boolValue,
const mitk::BaseRenderer *renderer =
nullptr)
const;
310 bool GetIntProperty(
const char *propertyKey,
int &intValue,
const mitk::BaseRenderer *renderer =
nullptr)
const;
317 bool GetFloatProperty(
const char *propertyKey,
330 bool GetDoubleProperty(
const char *propertyKey,
339 bool GetStringProperty(
const char *propertyKey,
357 const char *propertyKey =
"levelwindow")
const;
377 const char *propertyKey =
"name")
const
379 return GetStringProperty(propertyKey, nodeName, renderer);
416 auto* data = this->GetData();
420 auto property = data->GetProperty(
"name");
422 if (property.IsNotNull())
424 auto* stringProperty =
dynamic_cast<StringProperty*
>(
property.GetPointer());
426 if (
nullptr != stringProperty)
434 this->SetStringProperty(
"name", name);
450 return GetBoolProperty(propertyKey, visible, renderer);
458 bool GetOpacity(
float &opacity,
const mitk::BaseRenderer *renderer,
const char *propertyKey =
"opacity")
const;
471 if (propertyKey ==
nullptr)
473 GetBoolProperty(propertyKey, defaultIsOn, renderer);
489 const char *propertyKey =
"visible",
490 bool defaultIsOn =
true)
const
492 return IsOn(propertyKey, renderer, defaultIsOn);
501 const char *propertyKey =
"color");
507 void SetColor(
float red,
511 const char *propertyKey =
"color");
517 void SetColor(
const float rgb[3],
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"color");
526 void SetVisibility(
bool visible,
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"visible");
532 void SetOpacity(
float opacity,
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"opacity");
540 const char *propertyKey =
"levelwindow");
546 void SetIntProperty(
const char *propertyKey,
int intValue,
const mitk::BaseRenderer *renderer =
nullptr);
552 void SetBoolProperty(
const char *propertyKey,
bool boolValue,
const mitk::BaseRenderer *renderer =
nullptr);
558 void SetFloatProperty(
const char *propertyKey,
float floatValue,
const mitk::BaseRenderer *renderer =
nullptr);
564 void SetDoubleProperty(
const char *propertyKey,
double doubleValue,
const mitk::BaseRenderer *renderer =
nullptr);
570 void SetStringProperty(
const char *propertyKey,
const char *
string,
const mitk::BaseRenderer *renderer =
nullptr);
576 itk::ModifiedTimeType GetMTime()
const override;
590 virtual void PropertyListModified(
const itk::Object *caller,
const itk::EventObject &event);
unsigned long m_PropertyListModifiedObserverTag
DataInteractor::Pointer m_DataInteractor
Abstract base class for properties.
virtual T GetValue() const
std::vector< itk::SmartPointer< Mapper > > MapperVector
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
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 val...
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
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 proper...
virtual void SetValue(const char *_arg)
virtual void SetName(const std::string &name)
Extra convenience access method to set the name of an object.
std::map< std::string, mitk::PropertyList::Pointer > MapOfPropertyLists
#define mitkClassMacroItkParent(className, SuperClassName)
Find image slices visible on a given plane.
The LevelWindow class Class to store level/window values.
std::set< std::string > GroupTagList
MITKCORE_EXPORT std::istream & operator>>(std::istream &i, DataNode::Pointer &dtn)
virtual const char * GetValue() const
Base class of all mappers, Vtk as well as OpenGL mappers.
itk::TimeStamp m_DataReferenceChangedTime
Timestamp of the last change of m_Data.
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,...
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,...
virtual std::string GetName() const
Extra convenience access method for accessing the name of an object (instance of StringProperty with ...
Key-value list holding instances of BaseProperty.
Base of all data objects.
const MITKPYTHONSEGMENTATION_EXPORT Color & GetColor(PromptType promptType, ColorIntensity colorIntensity)
Returns the color associated with a specific prompt type and color intensity.
mitk::Geometry3D::Pointer Geometry3DPointer
static std::string NO_NAME_VALUE()
MapperVector m_Mappers
Mapper-slots.
BaseData::Pointer m_Data
The data object (instance of BaseData, e.g., an Image) managed by this DataNode.
const T * GetConstProperty(const std::string &propertyKey, const ROI::Element &roi, TimeStepType t)
Syntactic sugar for getting ROI properties.
std::vector< MapOfPropertyLists::key_type > PropertyListKeyNames
PropertyList::Pointer m_PropertyList
BaseRenderer-independent PropertyList.
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 ...
unsigned int MapperSlotId
bool GetPropertyValue(const char *propertyKey, T &value, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for GenericProperty<T> properties (T being the type of the second parameter...
MapOfPropertyLists m_MapOfPropertyLists
Map associating each BaseRenderer with its own PropertyList.
unsigned long GetDataReferenceChangedTime() const
Get the timestamp of the last change of the reference to the BaseData.
virtual void SetName(const char *name)
Extra convenience access method to set the name of an object.
Class for nodes of the DataTree.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)
static const char * replace[]
This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the conso...
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 "vis...