Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDICOMReaderConfigurator.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkDICOMReaderConfigurator_h
18 #define mitkDICOMReaderConfigurator_h
19 
22 
23 // to put into private implementation
24 #include "tinyxml.h"
25 
26 namespace mitk
27 {
28 
94 class MITKDICOMREADER_EXPORT DICOMReaderConfigurator : public itk::LightObject
95 {
96  public:
97 
99  itkNewMacro( DICOMReaderConfigurator )
100 
101  DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
102  DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
103 
104  std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
105 
106  protected:
107 
109  virtual ~DICOMReaderConfigurator();
110 
111  private:
112 
113  DICOMFileReader::Pointer CreateFromTiXmlDocument(TiXmlDocument& doc) const;
114  DICOMTag tagFromXMLElement(TiXmlElement*) const;
115  std::string requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const;
116  unsigned int hexStringToUInt(const std::string& s) const;
117 
118  ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement*) const;
119  DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement*) const;
120  void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const;
121  void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const;
122 
123  DICOMSortCriterion::Pointer CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
124  DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
125 
126  mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(TiXmlElement* element) const;
127 
128  TiXmlElement* CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const;
129  TiXmlElement* CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const;
130  TiXmlElement* CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const;
131 
132  TiXmlElement* CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const;
133 
134  TiXmlElement* CreateConfigStringFromDICOMTag(const DICOMTag& tag) const;
135 
136  TiXmlElement* CreateDICOMFileReaderTag(const DICOMFileReader* reader) const;
137  const char* toString(bool) const;
138  std::string toHexString(unsigned int i) const;
139  };
140 
141 } // namespace
142 
143 #endif // mitkDICOMReaderConfigurator_h
Sorting and grouping like mitk::DicomSeriesReader until 2013.
itk::SmartPointer< Self > Pointer
Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT...
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:37
#define MITKDICOMREADER_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< const Self > ConstPointer
Too-simple factory to create DICOMFileReaders.
static const std::string filename
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Extends DICOMITKSeriesGDCMReader by sorting/grouping into 3D+t image blocks.
Sort DICOM datasets based on configurable tags.
Interface for DICOM readers that produce mitk::Images.