Medical Imaging Interaction Toolkit  2016.11.0
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) static Pointer New()
 
DICOMFileReader::Pointer CreateFromConfigFile (const std::string &filename) const
 
DICOMFileReader::Pointer CreateFromUTF8ConfigString (const std::string &xmlContents) const
 
std::string CreateConfigStringFromReader (DICOMFileReader::ConstPointer reader) const
 

Protected Member Functions

 DICOMReaderConfigurator ()
 
virtual ~DICOMReaderConfigurator ()
 

Detailed Description

Too-simple factory to create DICOMFileReaders.

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

Note
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>
<DICOMFileReader
  label="Example Reader"
  description="Sort images by example tags"
  class="DICOMITKSeriesGDCMReader"
  fixTiltByShearing="true">
<Distinguishing>
 <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
 <Tag name="SeriesNumber" group="0020" element="0011"/>
</Distinguishing>
<Sorting>
 <ImagePositionPatient/>
 <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
</Sorting>
</DICOMFileReader>

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:

fixTiltByShearing="true|false"

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

Flag for ThreeDnTDICOMSeriesReader:

group3DnT="true|false"

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 94 of file mitkDICOMReaderConfigurator.h.

Constructor & Destructor Documentation

mitk::DICOMReaderConfigurator::DICOMReaderConfigurator ( )
protected

Definition at line 23 of file mitkDICOMReaderConfigurator.cpp.

mitk::DICOMReaderConfigurator::~DICOMReaderConfigurator ( )
protectedvirtual

Definition at line 28 of file mitkDICOMReaderConfigurator.cpp.

Member Function Documentation

std::string mitk::DICOMReaderConfigurator::CreateConfigStringFromReader ( DICOMFileReader::ConstPointer  reader) const

Definition at line 485 of file mitkDICOMReaderConfigurator.cpp.

References MITK_WARN.

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

Definition at line 34 of file mitkDICOMReaderConfigurator.cpp.

References MITK_ERROR.

mitk::DICOMFileReader::Pointer mitk::DICOMReaderConfigurator::CreateFromUTF8ConfigString ( const std::string &  xmlContents) const

Definition at line 50 of file mitkDICOMReaderConfigurator.cpp.

mitk::DICOMReaderConfigurator::mitkClassMacroItkParent ( DICOMReaderConfigurator  ,
itk::LightObject   
)

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