Medical Imaging Interaction Toolkit
2024.06.00
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;
98 vtkLinearTransform *GetVtkTransform(
int t = 0)
const;
124 void UpdateOutputInformation()
override;
126 void SetRequestedRegionToLargestPossibleRegion()
override;
128 bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
130 bool VerifyRequestedRegion()
override;
132 void SetRequestedRegion(
const itk::DataObject *data)
override;
134 void CopyInformation(
const itk::DataObject *data)
override;
185 void AddProperty(
const char *propertyKey,
188 bool overwrite =
false);
245 template <
typename T>
247 const char *propertyKey,
250 property =
dynamic_cast<T *
>(GetProperty(propertyKey, renderer));
251 return property.IsNotNull();
265 template <
typename T>
268 property =
dynamic_cast<T *
>(GetProperty(propertyKey, renderer));
269 return property !=
nullptr;
277 template <
typename T>
290 GroupTagList GetGroupTags()
const;
297 bool GetBoolProperty(
const char *propertyKey,
bool &boolValue,
const mitk::BaseRenderer *renderer =
nullptr)
const;
304 bool GetIntProperty(
const char *propertyKey,
int &intValue,
const mitk::BaseRenderer *renderer =
nullptr)
const;
311 bool GetFloatProperty(
const char *propertyKey,
324 bool GetDoubleProperty(
const char *propertyKey,
333 bool GetStringProperty(
const char *propertyKey,
342 bool GetColor(
float rgb[3],
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"color")
const;
351 const char *propertyKey =
"levelwindow")
const;
371 const char *propertyKey =
"name")
const
373 return GetStringProperty(propertyKey, nodeName, renderer);
410 auto* data = this->GetData();
414 auto property = data->GetProperty(
"name");
416 if (property.IsNotNull())
418 auto* stringProperty =
dynamic_cast<StringProperty*
>(
property.GetPointer());
420 if (
nullptr != stringProperty)
428 this->SetStringProperty(
"name", name);
444 return GetBoolProperty(propertyKey, visible, renderer);
452 bool GetOpacity(
float &opacity,
const mitk::BaseRenderer *renderer,
const char *propertyKey =
"opacity")
const;
465 if (propertyKey ==
nullptr)
467 GetBoolProperty(propertyKey, defaultIsOn, renderer);
483 const char *propertyKey =
"visible",
484 bool defaultIsOn =
true)
const
486 return IsOn(propertyKey, renderer, defaultIsOn);
495 const char *propertyKey =
"color");
501 void SetColor(
float red,
505 const char *propertyKey =
"color");
511 void SetColor(
const float rgb[3],
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"color");
520 void SetVisibility(
bool visible,
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"visible");
526 void SetOpacity(
float opacity,
const mitk::BaseRenderer *renderer =
nullptr,
const char *propertyKey =
"opacity");
534 const char *propertyKey =
"levelwindow");
540 void SetIntProperty(
const char *propertyKey,
int intValue,
const mitk::BaseRenderer *renderer =
nullptr);
546 void SetBoolProperty(
const char *propertyKey,
bool boolValue,
const mitk::BaseRenderer *renderer =
nullptr);
552 void SetFloatProperty(
const char *propertyKey,
float floatValue,
const mitk::BaseRenderer *renderer =
nullptr);
558 void SetDoubleProperty(
const char *propertyKey,
double doubleValue,
const mitk::BaseRenderer *renderer =
nullptr);
564 void SetStringProperty(
const char *propertyKey,
const char *
string,
const mitk::BaseRenderer *renderer =
nullptr);
570 itk::ModifiedTimeType GetMTime()
const override;
584 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.
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...