Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkDataStorage_h
14 #define mitkDataStorage_h
16 #include "itkObject.h"
17 #include "itkVectorContainer.h"
27 class NodePredicateBase;
52 typedef itk::VectorContainer<unsigned int, DataNode::Pointer>
SetOfObjects;
74 virtual void Remove(
const DataNode *node) = 0;
79 virtual bool Exists(
const DataNode *node)
const = 0;
106 virtual SetOfObjects::ConstPointer GetSources(
const DataNode *node,
108 bool onlyDirectSources =
true)
const = 0;
120 virtual SetOfObjects::ConstPointer GetDerivations(
const DataNode *node,
122 bool onlyDirectDerivations =
true)
const = 0;
127 virtual SetOfObjects::ConstPointer GetAll()
const = 0;
137 DataNode *GetNamedNode(
const char *name)
const;
146 DataNode *GetNamedDerivedNode(
const char *name,
148 bool onlyDirectDerivations =
true)
const;
153 template <
class DataType>
158 DataNode *n = this->GetNamedNode(name);
162 return dynamic_cast<DataType *
>(n->
GetData());
167 template <
class DataType>
170 return this->GetNamedObject<DataType>(name.c_str());
177 template <
class DataType>
180 bool onlyDirectDerivations =
true)
const
184 DataNode *n = this->GetNamedDerivedNode(name, sourceNode, onlyDirectDerivations);
188 return dynamic_cast<DataType *
>(n->
GetData());
278 const char *boolPropertyKey =
nullptr,
280 const char *boolPropertyKey2 =
nullptr)
const;
293 const char *boolPropertyKey2 =
nullptr)
const;
305 const char *boolPropertyKey =
nullptr);
314 BoundingBox::Pointer ComputeBoundingBox(
const char *boolPropertyKey =
nullptr,
316 const char *boolPropertyKey2 =
nullptr);
328 const char *boolPropertyKey =
nullptr)
330 return ComputeBoundingBox(
"visible", renderer, boolPropertyKey);
343 TimeBounds ComputeTimeBounds(
const char *boolPropertyKey,
345 const char *boolPropertyKey2);
359 return ComputeTimeBounds(
"visible", renderer, boolPropertyKey);
371 void BlockNodeModifiedEvents(
bool block);
378 void EmitAddNodeEvent(
const DataNode *node);
384 void EmitRemoveNodeEvent(
const DataNode *node);
386 void OnNodeInteractorChanged(itk::Object *caller,
const itk::EventObject &event);
393 void OnNodeModifiedOrDeleted(
const itk::Object *caller,
const itk::EventObject &event);
397 void AddListeners(
const DataNode *_Node);
401 void RemoveListeners(
const DataNode *_Node);
427 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
DataStorageEvent AddNodeEvent
AddEvent is emitted whenever a new node has been added to the DataStorage.
std::map< const DataNode *, unsigned long > m_NodeInteractorChangedObserverTags
itk::VectorContainer< unsigned int, DataNode::Pointer > SetOfObjects
A Container of objects that is used as a result set of GetSubset() query operations (Set of.
bool m_BlockNodeModifiedEvents
If this class changes nodes itself, set this to TRUE in order to suppress NodeChangedEvent to be emit...
DataNode * GetNamedNode(const std::string name) const
Convenience method to get the first node with a given name.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
MITKCORE_EXPORT DataNode::Pointer FindTopmostVisibleNode(const DataStorage::SetOfObjects::ConstPointer nodes, const Point3D worldPosition, const TimePointType timePoint, const BaseRenderer *baseRender)
returns the topmost visible node of a given list of nodes. The function returns a node that is visibl...
DataType * GetNamedObject(const char *name) const
Convenience method to get the first data object of a given data type with a given name.
#define mitkClassMacroItkParent(className, SuperClassName)
Find image slices visible on a given plane.
DataStorageEvent InteractorChangedNodeEvent
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
std::set< std::string > GroupTagList
Message1< const DataNode * > DataStorageEvent
BoundingBox::Pointer ComputeVisibleBoundingBox(const BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
Compute the bounding box of all visible parts of the data tree structure, for general rendering or re...
TimeBounds ComputeTimeBounds(const BaseRenderer *renderer, const char *boolPropertyKey)
Compute the time-bounds of all visible parts of the data tree structure, for general rendering or ren...
DataType * GetNamedObject(const std::string name) const
Convenience method to get the first data object of a given data type with a given name.
DataType * GetNamedDerivedObject(const char *name, const DataNode *sourceNode, bool onlyDirectDerivations=true) const
Convenience method to get the first data object of a given data type with a given name that is derive...
Data management class that handles 'was created by' relations.
std::map< const DataNode *, unsigned long > m_NodeDeleteObserverTags
Saves Delete-Observer Tags for each node in order to remove the event listeners again.
mitk::ScalarType TimePointType
DataStorageEvent ChangedNodeEvent
ChangedEvent is emitted directly after a node was changed.
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
std::map< const DataNode *, unsigned long > m_NodeModifiedObserverTags
Saves Modified-Observer Tags for each node in order to remove the event listeners again.
DataStorageEvent DeleteNodeEvent
DeleteNodeEvent is emitted directly before a node is deleted.
Class for nodes of the DataTree.
DataStorageEvent RemoveNodeEvent
RemoveEvent is emitted directly before a node is removed from the DataStorage.