MeVisLab Toolbox Reference
|
The DCMTree library provides classes for accessing the DICOM tags associated with an image. Most definitions in this library are contained in the DCMTree and DCMTree_Utils namespaces.
The most important classes in the DCMTree library are:
In an environment such as MeVisLab, where many image objects may share the same set of DICOM data, it would be inefficient to associate each image with its own Tree object. Instead, a single Tree object is typically associated to multiple image objects, and there's no dedicated owner of the Tree. For dynamically created objects, this requires a reference counting and auto deletion mechanism. In the DCMTree library, this is realized using the boost shared pointer classes (shared_ptr<class>). See the boost documentation at http://www.boost.org/libs/smart_ptr/shared_ptr.htm to find out more about shared pointers.
One consequence of the shared ownership of Tree objects is that often only const access to a Tree is possible, and that modification of the object is not allowed. In order to avoid the need to make a full new copy of the Tree object, the Tree class provides the option to store only the tags that have been added, deleted or modified, as well as a reference to a parent tree from which all remaining tags are inherited. Thus, instead of modifying a Tree object, a new Tree is created with the original Tree as its parent, and modified tags are added to this Tree. This process can be continued, resulting in a chain of Tree objects with a root tree and several incremental trees. The Tree member methods performing a lookup of tags offer a TagSelector argument, that allows to specify the search scope within such a chain.
The DCMTree library provides an extension to the DICOM standard allowing to store DICOM tags of a whole collection of logically (spatially or temporally) related 2D frames in a single Tree object. Such structured multi-frame objects are accessed using the StructuredMF class.
DCMTree::IOParameterPtr ioParamPtr = DCMTree::IOParameter::create(std::string(filename), false); DCMTree::ReaderPtr reader = DCMTree::Reader::create(DCMTree::Dict::singleton()); DCMTree::MessagePtr messagePtr = reader->read(ioParamPtr); DCMTree::TreePtr treePtr = messagePtr->tags();