Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
mitk::DICOMReaderConfigurator Class Reference

Too-simple factory to create DICOMFileReaders. More...

#include <mitkDICOMReaderConfigurator.h>

Inheritance diagram for mitk::DICOMReaderConfigurator:
Collaboration diagram for mitk::DICOMReaderConfigurator:

Public Member Functions

 mitkClassMacroItkParent (DICOMReaderConfigurator, itk::LightObject)
DICOMFileReader::Pointer CreateFromConfigFile (const std::string &filename) const
DICOMFileReader::Pointer CreateFromUTF8ConfigString (const std::string &xmlContents) const
std::string CreateConfigStringFromReader (DICOMFileReader::ConstPointer reader) const

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 DICOMReaderConfigurator ()
 ~DICOMReaderConfigurator () override

Detailed Description

Too-simple factory to create DICOMFileReaders.

This class is able to instantiate and configure (where possible) DICOMFileReaders from XML descriptions.

This is a bad factory example, because the factory is not extensible and needs to know all the specific readers. A flexible implementation should be provided in a future version.

In its current version, the XML input is meant to be structured like

<?xml version="1.0" standalone=no>
  label="Example Reader"
  description="Sort images by example tags"
 <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
 <Tag name="SeriesNumber" group="0020" element="0011"/>
 <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>

The root-tag <DICOMFileReader> names the class to be instantiated, currently this can be one of

Both classes bring simple configuration flags with them and a description of how images are sorted prior to loading.

Flag for DICOMITKSeriesGDCMReader:


Determines whether a potential gantry tilt should be "fixed" by shearing the output image.

Flag for ThreeDnTDICOMSeriesReader:


Determines whether images at the same spatial position should be interpreted as 3D+t images.

The tags <Distinguishing> and <Sorting> describe the basic loading strategy of both reader mentioned above: first images are divided into incompatible groups (<Distinguishing>), and afterwards the images within each group are sorted by means of DICOMSortCriterion, which most commonly mentions a tag.

Tag element and group are interpreted as the exadecimal numbers found all around the DICOM standard. The numbers can be prepended by a "0x" if this is preferred by the programmer (but they are taken as hexadecimal in all cases).

About the future evolution of this class

This first version is hard coded for the current state of the implementation.

If things should evolve in a way that needs us to splitt off readers for "old" versions, time should be taken to refactor this class.

Basically, a serializer class should accompany each of the configurable classes. Such serializer classes should be registered and discovered via micro-services (to support extensions). A serializer should offer both methods to serialize a class and to desirialize it again.

A "version" attribute at the top-level tag should be used to distinguish versions.

Usually it should be enough to keep DE-serializers for all versions. Writers for the most recent version should be enough.

Definition at line 90 of file mitkDICOMReaderConfigurator.h.

Constructor & Destructor Documentation

◆ DICOMReaderConfigurator()

mitk::DICOMReaderConfigurator::DICOMReaderConfigurator ( )

Definition at line 20 of file mitkDICOMReaderConfigurator.cpp.

References ~DICOMReaderConfigurator().

◆ ~DICOMReaderConfigurator()

mitk::DICOMReaderConfigurator::~DICOMReaderConfigurator ( )

Definition at line 25 of file mitkDICOMReaderConfigurator.cpp.

References CreateFromConfigFile().

Referenced by DICOMReaderConfigurator().

Member Function Documentation

◆ CreateConfigStringFromReader()

◆ CreateFromConfigFile()

mitk::DICOMFileReader::Pointer mitk::DICOMReaderConfigurator::CreateFromConfigFile ( const std::string &  filename) const

Definition at line 31 of file mitkDICOMReaderConfigurator.cpp.

References CreateFromUTF8ConfigString(), and MITK_ERROR.

Referenced by ~DICOMReaderConfigurator().

◆ CreateFromUTF8ConfigString()

◆ mitkClassMacroItkParent()

mitk::DICOMReaderConfigurator::mitkClassMacroItkParent ( DICOMReaderConfigurator  ,

◆ New()

static Pointer mitk::DICOMReaderConfigurator::New ( )

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