Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::StandaloneDataStorage Class Reference

Data management class that handles 'was created by' relations. More...

#include <mitkStandaloneDataStorage.h>

Inheritance diagram for mitk::StandaloneDataStorage:
Collaboration diagram for mitk::StandaloneDataStorage:

Public Types

typedef StandaloneDataStorage Self
 
typedef mitk::DataStorage Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::DataStorage
typedef DataStorage Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::VectorContainer< unsigned int, mitk::DataNode::PointerSetOfObjects
 A Container of objects that is used as a result set of GetSubset() query operations (Set of. More...
 
typedef Message1< const mitk::DataNode * > DataStorageEvent
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
void Add (mitk::DataNode *node, const mitk::DataStorage::SetOfObjects *parents=nullptr) override
 Adds a DataNode containing a data object to its internal storage. More...
 
void Remove (const mitk::DataNode *node) override
 Removes node from the StandaloneDataStorage. More...
 
virtual bool Exists (const mitk::DataNode *node) const override
 Checks if a node exists in the StandaloneDataStorage. More...
 
SetOfObjects::ConstPointer GetSources (const mitk::DataNode *node, const NodePredicateBase *condition=nullptr, bool onlyDirectSources=true) const override
 returns a set of source objects for a given node that meet the given condition(s). More...
 
SetOfObjects::ConstPointer GetDerivations (const mitk::DataNode *node, const NodePredicateBase *condition=nullptr, bool onlyDirectDerivations=true) const override
 returns a set of derived objects for a given node. More...
 
SetOfObjects::ConstPointer GetAll () const override
 returns a set of all data objects that are stored in the data storage More...
 
- Public Member Functions inherited from mitk::DataStorage
void Add (mitk::DataNode *node, mitk::DataNode *parent)
 Convenience method to add a node that has one parent. More...
 
void Remove (const mitk::DataStorage::SetOfObjects *nodes)
 Removes a set of nodes from the DataStorage. More...
 
SetOfObjects::ConstPointer GetSubset (const NodePredicateBase *condition) const
 returns a set of data objects that meet the given condition(s) More...
 
mitk::DataNodeGetNode (const NodePredicateBase *condition=nullptr) const
 Convenience method to get the first node that matches the predicate condition. More...
 
mitk::DataNodeGetNamedNode (const char *name) const
 Convenience method to get the first node with a given name. More...
 
mitk::DataNodeGetNamedNode (const std::string name) const
 Convenience method to get the first node with a given name. More...
 
mitk::DataNodeGetNamedDerivedNode (const char *name, const mitk::DataNode *sourceNode, bool onlyDirectDerivations=true) const
 Convenience method to get the first node with a given name that is derived from sourceNode. More...
 
template<class DataType >
DataType * GetNamedObject (const char *name) const
 Convenience method to get the first data object of a given data type with a given name. More...
 
template<class DataType >
DataType * GetNamedObject (const std::string name) const
 Convenience method to get the first data object of a given data type with a given name. More...
 
template<class DataType >
DataType * GetNamedDerivedObject (const char *name, const mitk::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 derived. More...
 
const DataNode::GroupTagList GetGroupTags () const
 Returns a list of used grouptags. More...
 
mitk::TimeGeometry::Pointer ComputeBoundingGeometry3D (const SetOfObjects *input, const char *boolPropertyKey=nullptr, const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr) const
 Compute the axis-parallel bounding geometry of the input objects. More...
 
mitk::TimeGeometry::Pointer ComputeBoundingGeometry3D (const char *boolPropertyKey=nullptr, const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr) const
 Compute the axis-parallel bounding geometry of the data tree (bounding box, minimal spacing of the considered nodes, live-span) More...
 
mitk::TimeGeometry::Pointer ComputeVisibleBoundingGeometry3D (const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
 Compute the axis-parallel bounding geometry of all visible parts of the data tree bounding box, minimal spacing of the considered nodes, live-span) More...
 
mitk::BoundingBox::Pointer ComputeBoundingBox (const char *boolPropertyKey=nullptr, const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr)
 Compute the bounding box of data tree structure it -> an iterator to a data tree structure. More...
 
mitk::BoundingBox::Pointer ComputeVisibleBoundingBox (const mitk::BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
 Compute the bounding box of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking. More...
 
mitk::TimeBounds ComputeTimeBounds (const char *boolPropertyKey, const mitk::BaseRenderer *renderer, const char *boolPropertyKey2)
 Compute the time-bounds of the contents of a data tree structure. More...
 
mitk::TimeBounds ComputeTimeBounds (const mitk::BaseRenderer *renderer, const char *boolPropertyKey)
 Compute the time-bounds of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking. More...
 
void BlockNodeModifiedEvents (bool block)
 Defines whether or not NodeChangedEvent is invoked . More...
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::DataStorage
static const char * GetStaticNameOfClass ()
 

Public Attributes

itk::SimpleFastMutexLock m_Mutex
 
- Public Attributes inherited from mitk::DataStorage
itk::SimpleFastMutexLock m_MutexOne
 
DataStorageEvent AddNodeEvent
 AddEvent is emitted whenever a new node has been added to the DataStorage. More...
 
DataStorageEvent RemoveNodeEvent
 RemoveEvent is emitted directly before a node is removed from the DataStorage. More...
 
DataStorageEvent ChangedNodeEvent
 ChangedEvent is emitted directly after a node was changed. More...
 
DataStorageEvent DeleteNodeEvent
 DeleteNodeEvent is emitted directly before a node is deleted. More...
 
DataStorageEvent InteractorChangedNodeEvent
 

Protected Types

typedef std::map< mitk::DataNode::ConstPointer, SetOfObjects::ConstPointer > AdjacencyList
 noncyclical directed graph data structure to store the nodes with their relation More...
 

Protected Member Functions

 StandaloneDataStorage ()
 Standard Constructor for New() instantiation. More...
 
virtual ~StandaloneDataStorage ()
 Standard Destructor. More...
 
bool IsInitialized () const
 convenience method to check if the object has been initialized (i.e. a data tree has been set) More...
 
SetOfObjects::ConstPointer GetRelations (const mitk::DataNode *node, const AdjacencyList &relation, const NodePredicateBase *condition=nullptr, bool onlyDirectlyRelated=true) const
 Traverses the Relation graph and extracts a list of related elements (e.g. Sources or Derivations) More...
 
void RemoveFromRelation (const mitk::DataNode *node, AdjacencyList &relation)
 deletes all references to a node in a given relation (used in Remove() and TreeListener) More...
 
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const override
 Prints the contents of the StandaloneDataStorage to os. Do not call directly, call ->Print() instead. More...
 
- Protected Member Functions inherited from mitk::DataStorage
void EmitAddNodeEvent (const mitk::DataNode *node)
 EmitAddNodeEvent emits the AddNodeEvent. More...
 
void EmitRemoveNodeEvent (const mitk::DataNode *node)
 EmitRemoveNodeEvent emits the RemoveNodeEvent. More...
 
void OnNodeInteractorChanged (itk::Object *caller, const itk::EventObject &event)
 
void OnNodeModifiedOrDeleted (const itk::Object *caller, const itk::EventObject &event)
 OnNodeModified listens to modified events of DataNodes. More...
 
void AddListeners (const mitk::DataNode *_Node)
 Adds a Modified-Listener to the given Node. More...
 
void RemoveListeners (const mitk::DataNode *_Node)
 Removes a Modified-Listener from the given Node. More...
 
 DataStorage ()
 Standard Constructor for New() instantiation. More...
 
virtual ~DataStorage ()
 Standard Destructor. More...
 
SetOfObjects::ConstPointer FilterSetOfObjects (const SetOfObjects *set, const NodePredicateBase *condition) const
 Filters a SetOfObjects by the condition. If no condition is provided, the original set is returned. More...
 

Protected Attributes

AdjacencyList m_SourceNodes
 Nodes and their relation are stored in m_SourceNodes. More...
 
AdjacencyList m_DerivedNodes
 Nodes are stored in reverse relation for easier traversal in the opposite direction of the relation. More...
 
- Protected Attributes inherited from mitk::DataStorage
std::map< const mitk::DataNode *, unsigned long > m_NodeModifiedObserverTags
 Saves Modified-Observer Tags for each node in order to remove the event listeners again. More...
 
std::map< const mitk::DataNode *, unsigned long > m_NodeInteractorChangedObserverTags
 
std::map< const mitk::DataNode *, unsigned long > m_NodeDeleteObserverTags
 Saves Delete-Observer Tags for each node in order to remove the event listeners again. More...
 
bool m_BlockNodeModifiedEvents
 If this class changes nodes itself, set this to TRUE in order to suppress NodeChangedEvent to be emitted. More...
 

Detailed Description

Data management class that handles 'was created by' relations.

The StandaloneDataStorage provides data storage and management functionality. It handles a 'was created by' relation by associating each data object with a set of source objects that were used to create the new object was created from. Thus, nodes are stored in a noncyclical directed graph data structure. It is derived from mitk::DataStorage and implements its interface, including AddNodeEvent and RemoveNodeEvent.

Definition at line 40 of file mitkStandaloneDataStorage.h.

Member Typedef Documentation

typedef std::map<mitk::DataNode::ConstPointer, SetOfObjects::ConstPointer> mitk::StandaloneDataStorage::AdjacencyList
protected

noncyclical directed graph data structure to store the nodes with their relation

Definition at line 100 of file mitkStandaloneDataStorage.h.

Constructor & Destructor Documentation

mitk::StandaloneDataStorage::StandaloneDataStorage ( )
protected

Standard Constructor for New() instantiation.

Definition at line 27 of file mitkStandaloneDataStorage.cpp.

mitk::StandaloneDataStorage::~StandaloneDataStorage ( )
protectedvirtual

Standard Destructor.

Definition at line 31 of file mitkStandaloneDataStorage.cpp.

Member Function Documentation

void mitk::StandaloneDataStorage::Add ( mitk::DataNode node,
const mitk::DataStorage::SetOfObjects parents = nullptr 
)
overridevirtual

Adds a DataNode containing a data object to its internal storage.

This Method adds a new data object to the StandaloneDataStorage. The new object is passed in the first parameter. The second parameter is a set of source objects, that were used to create this object. The new object will have a 'was created from' relation to its source objects. the addition of a new object will fire the notification mechanism. If the node parameter is NULL or if the DataNode has already been added, an exception will be thrown.

Implements mitk::DataStorage.

Definition at line 44 of file mitkStandaloneDataStorage.cpp.

References mitk::New().

Pointer mitk::StandaloneDataStorage::Clone ( ) const
bool mitk::StandaloneDataStorage::Exists ( const mitk::DataNode node) const
overridevirtual

Checks if a node exists in the StandaloneDataStorage.

Implements mitk::DataStorage.

Definition at line 122 of file mitkStandaloneDataStorage.cpp.

mitk::DataStorage::SetOfObjects::ConstPointer mitk::StandaloneDataStorage::GetAll ( ) const
overridevirtual

returns a set of all data objects that are stored in the data storage

Implements mitk::DataStorage.

Definition at line 150 of file mitkStandaloneDataStorage.cpp.

References mitk::New().

virtual std::vector<std::string> mitk::StandaloneDataStorage::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::DataStorage.

Definition at line 43 of file mitkStandaloneDataStorage.h.

virtual const char* mitk::StandaloneDataStorage::GetClassName ( ) const
virtual

Reimplemented from mitk::DataStorage.

mitk::DataStorage::SetOfObjects::ConstPointer mitk::StandaloneDataStorage::GetDerivations ( const mitk::DataNode node,
const NodePredicateBase condition = nullptr,
bool  onlyDirectDerivations = true 
) const
overridevirtual

returns a set of derived objects for a given node.

GetDerivations() returns a set of objects that are derived from the DataNode node. This means, that node was used to create the returned objects. If the parameter onlyDirectDerivations is set to true (default value), only objects that directly have node as one of their source objects will be returned. Otherwise, objects that are derived from derivations of node are returned too. The derived objects can be filtered with a predicate object as described in the GetSubset() method by providing a predicate as the condition parameter.

Implements mitk::DataStorage.

Definition at line 251 of file mitkStandaloneDataStorage.cpp.

mitk::DataStorage::SetOfObjects::ConstPointer mitk::StandaloneDataStorage::GetRelations ( const mitk::DataNode node,
const AdjacencyList relation,
const NodePredicateBase condition = nullptr,
bool  onlyDirectlyRelated = true 
) const
protected

Traverses the Relation graph and extracts a list of related elements (e.g. Sources or Derivations)

Definition at line 168 of file mitkStandaloneDataStorage.cpp.

References mitk::NodePredicateBase::CheckNode(), and mitk::New().

mitk::DataStorage::SetOfObjects::ConstPointer mitk::StandaloneDataStorage::GetSources ( const mitk::DataNode node,
const NodePredicateBase condition = nullptr,
bool  onlyDirectSources = true 
) const
overridevirtual

returns a set of source objects for a given node that meet the given condition(s).

Implements mitk::DataStorage.

Definition at line 244 of file mitkStandaloneDataStorage.cpp.

static const char* mitk::StandaloneDataStorage::GetStaticNameOfClass ( )
inlinestatic

Definition at line 43 of file mitkStandaloneDataStorage.h.

bool mitk::StandaloneDataStorage::IsInitialized ( ) const
protected

convenience method to check if the object has been initialized (i.e. a data tree has been set)

Definition at line 39 of file mitkStandaloneDataStorage.cpp.

void mitk::StandaloneDataStorage::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

Prints the contents of the StandaloneDataStorage to os. Do not call directly, call ->Print() instead.

Reimplemented from mitk::DataStorage.

Definition at line 258 of file mitkStandaloneDataStorage.cpp.

void mitk::StandaloneDataStorage::Remove ( const mitk::DataNode node)
overridevirtual

Removes node from the StandaloneDataStorage.

Implements mitk::DataStorage.

Definition at line 94 of file mitkStandaloneDataStorage.cpp.

void mitk::StandaloneDataStorage::RemoveFromRelation ( const mitk::DataNode node,
AdjacencyList relation 
)
protected

deletes all references to a node in a given relation (used in Remove() and TreeListener)

Definition at line 128 of file mitkStandaloneDataStorage.cpp.

Member Data Documentation

AdjacencyList mitk::StandaloneDataStorage::m_DerivedNodes
protected

Nodes are stored in reverse relation for easier traversal in the opposite direction of the relation.

Definition at line 133 of file mitkStandaloneDataStorage.h.

itk::SimpleFastMutexLock mitk::StandaloneDataStorage::m_Mutex
mutable

Definition at line 95 of file mitkStandaloneDataStorage.h.

AdjacencyList mitk::StandaloneDataStorage::m_SourceNodes
protected

Nodes and their relation are stored in m_SourceNodes.

Definition at line 130 of file mitkStandaloneDataStorage.h.


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