Data Tree Classes
[Data Management Classes]

This subcategory includes the data tree classes, which organizes the data during run-time in a tree structure. More...

Collaboration diagram for Data Tree Classes:

This subcategory includes the data tree classes, which organizes the data during run-time in a tree structure.

Overview

All data objects, like images or surfaces, are contained in DataNodes. These DataNodes describe the data itself (mitk::BaseData), how they can be rendered in 2D or 3D (a list of mitk::Mapper), what mitk::Interactor is associated with it, and a list of arbirary properties (name, visibility, opacity, etc.). Information about the position of a data object in space/time is stored in a Geometry, which is attached to the data object itself, not to the node.

Tree nodes are organized in a data tree for communication between different parts of an application, e.g. functionalities and the rendering process. mitk::DataTree is just a typedef to the ITK tree container class. To access and modify data trees, we use iterators (mitk::DataTreeIteratorBase).

To clarify the relation between the tree, its nodes and iterators, have a look at the following diagram. The main point of this diagram is, that you need an iterator to change the tree. A tree node does not know about the tree! Once again: a tree node does not know about the tree!

DataTreeAndIterators.png

The data tree, its nodes and iterators

To modify a tree, you can use an iterator's Add(), Set() or Remove() methods (among others):

  mitk::DataTreeIteratorBase* iterator = GetAnIterator(); //whatever
  mitk::DataNode* node = GetMyNode();
  mitk::DataNode* node2 = GetMyNode();

  if ( iterator.IsNotNull() )
  {
    iterator->Add( node ); // add as child to the current position
    
    iterator->Set( node2 ); // set the node of the current position
    
    iterator->Remove(); // remove the current position (and all its children)
  }

To access the data behind an iterator, use Get():

  if ( iterator.IsNotNull() )
  {
    mitk::DataNode* datanode = iterator->Get();
    mitk::BaseData* = datanode->GetData();
  }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines