Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
Data Management Concept

As MITK is used to process large and diverse data the management thereof becomes an important issue. In order to abstract the management of data from the actual format of the data it is encapsulated.

Data Encapsulation

All data objects, like images or surfaces, are contained in DataNodes. These DataNodes describe the data itself (mitk::BaseData and derived classes), 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 arbitrary 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.

BaseData

mitk::BaseData is the base class for all data objects. It itself inherits from itk::DataObject.

DataNode

This class encapsulates a BaseData object and provides uniform handling.

DataStorage

The MITK DataStorage manages and stores DataNodes. Besides adding and removing nodes it provides advanced functionality such as getting a list of all DataNodes currently in the DataStorage which match a specific type (e.g. image, surface ) or have a specific name or other property.

There can be different DataStorages.

A usage example for a class deriving from QmitkAbstractView:

mitk::DataNode::Pointer resultNode = mitk::DataNode::New(); // create data node
std::string nameOfResultImage = node->GetName(); // get property "name" of the original node,this is a convenience method
nameOfResultImage.append("Otsu"); // extend the "name" to "nameOtsu"
resultNode->SetProperty("name", mitk::StringProperty::New(nameOfResultImage) ); // write name property to new node
resultNode->SetProperty("binary", mitk::BoolProperty::New(true) ); // set binary property of new node true
resultNode->SetData( mitk::ImportItkImage ( filter->GetOutput() ) ); // set data of new node
this->GetDataStorage()->Add(resultNode, node); // add new node to datastorage

Adding an own data type

To extent MITKs capabilities by adding a custom data type there are several things which should be done. Depending on whether the data type is completely unlike any of the existing ones, or derived from one of them some steps can possibly be omitted.

  1. Add your data type
  2. Add reader and writer and register them
  3. Add mapper
mitk::ImportItkImage
Image::Pointer ImportItkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, const BaseGeometry *geometry=nullptr, bool update=true)
Imports an itk::Image (with a specific type) as an mitk::Image.
itk::SmartPointer< Self >
mitk::StringProperty::New
static Pointer New()
mitk::BoolProperty::New
static Pointer New()
mitk::DataNode::New
static Pointer New()