Medical Imaging Interaction Toolkit  2018.4.99-c7ee88da
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDICOMReaderConfigurator_h
14 #define mitkDICOMReaderConfigurator_h
15 
18 
19 // to put into private implementation
20 #include "tinyxml.h"
21 
22 namespace mitk
23 {
24 
90 class MITKDICOMREADER_EXPORT DICOMReaderConfigurator : public itk::LightObject
91 {
92  public:
93 
95  itkNewMacro( DICOMReaderConfigurator );
96 
97  DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
98  DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
99 
100  std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
101 
102  protected:
103 
105  ~DICOMReaderConfigurator() override;
106 
107  private:
108 
109  DICOMFileReader::Pointer CreateFromTiXmlDocument(TiXmlDocument& doc) const;
110  DICOMTag tagFromXMLElement(TiXmlElement*) const;
111  std::string requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const;
112  unsigned int hexStringToUInt(const std::string& s) const;
113 
114  ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement*) const;
115  DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement*) const;
116  void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const;
117  void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const;
118 
119  DICOMSortCriterion::Pointer CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
120  DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
121 
122  mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(TiXmlElement* element) const;
123 
124  TiXmlElement* CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const;
125  TiXmlElement* CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const;
126  TiXmlElement* CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const;
127 
128  TiXmlElement* CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const;
129 
130  TiXmlElement* CreateConfigStringFromDICOMTag(const DICOMTag& tag) const;
131 
132  TiXmlElement* CreateDICOMFileReaderTag(const DICOMFileReader* reader) const;
133  const char* toString(bool) const;
134  std::string toHexString(unsigned int i) const;
135 
137  bool QueryBooleanAttribute(const TiXmlElement* element, const char* attributeName, bool defaultValue) const;
138  };
139 
140 } // namespace
141 
142 #endif // mitkDICOMReaderConfigurator_h
Sorting and grouping like mitk::DicomSeriesReader until 2013.
Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT...
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
#define MITKDICOMREADER_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Too-simple factory to create DICOMFileReaders.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
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.