Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
Too-simple factory to create DICOMFileReaders. More...
#include <mitkDICOMReaderConfigurator.h>
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 () |
static std::string | GetConfigStringFromModuleResource (const std::string &resourcePath) |
Protected Member Functions | |
DICOMReaderConfigurator () | |
~DICOMReaderConfigurator () override | |
Too-simple factory to create DICOMFileReaders.
This class is able to instantiate and configure (where possible) DICOMFileReaders from XML descriptions.
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).
This first version is hard coded for the current state of the implementation.
If things should evolve in a way that needs us to split 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 93 of file mitkDICOMReaderConfigurator.h.
|
protected |
|
overrideprotected |
std::string mitk::DICOMReaderConfigurator::CreateConfigStringFromReader | ( | DICOMFileReader::ConstPointer | reader | ) | const |
DICOMFileReader::Pointer mitk::DICOMReaderConfigurator::CreateFromConfigFile | ( | const std::string & | filename | ) | const |
DICOMFileReader::Pointer mitk::DICOMReaderConfigurator::CreateFromUTF8ConfigString | ( | const std::string & | xmlContents | ) | const |
|
static |
Helper function that returns a config string for a DICOMReader that is compiled into a module resource of the MitkDICOM module.
resourcePath | Path of the resource in the module MitkDICOM. |
mitk::DICOMReaderConfigurator::mitkClassMacroItkParent | ( | DICOMReaderConfigurator | , |
itk::LightObject | |||
) |
|
static |