Medical Imaging Interaction Toolkit  2023.12.00
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 namespace tinyxml2
20 {
21  class XMLDocument;
22  class XMLElement;
23 }
24 
25 namespace mitk
26 {
27 
93 class MITKDICOM_EXPORT DICOMReaderConfigurator : public itk::LightObject
94 {
95  public:
96 
98  itkNewMacro( DICOMReaderConfigurator );
99 
100  DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
101  DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
102 
103  std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
104 
105  protected:
106 
108  ~DICOMReaderConfigurator() override;
109 
110  private:
111 
112  DICOMFileReader::Pointer CreateFromXMLDocument(tinyxml2::XMLDocument& doc) const;
113  DICOMTag tagFromXMLElement(const tinyxml2::XMLElement*) const;
114  std::string requiredStringAttribute(const tinyxml2::XMLElement* xmlElement, const std::string& key) const;
115  unsigned int hexStringToUInt(const std::string& s) const;
116 
117  ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement*) const;
118  DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement*) const;
119  void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement* element) const;
120  void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement* element) const;
121 
122  DICOMSortCriterion::Pointer CreateDICOMSortByTag(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
123  DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
124 
125  mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(const tinyxml2::XMLElement* element) const;
126 
127  tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const DICOMITKSeriesGDCMReader* reader) const;
128  tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ThreeDnTDICOMSeriesReader* reader) const;
129  tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ClassicDICOMSeriesReader* reader) const;
130 
131  tinyxml2::XMLElement* CreateConfigStringFromDICOMDatasetSorter(tinyxml2::XMLDocument& doc, const DICOMTagBasedSorter* sorter) const;
132 
133  tinyxml2::XMLElement* CreateConfigStringFromDICOMTag(tinyxml2::XMLDocument& doc, const DICOMTag& tag) const;
134 
135  tinyxml2::XMLElement* CreateDICOMFileReaderTag(tinyxml2::XMLDocument& doc, const DICOMFileReader* reader) const;
136 
137  std::string toHexString(unsigned int i) const;
138 
140  bool QueryBooleanAttribute(const tinyxml2::XMLElement* element, const char* attributeName, bool defaultValue) const;
141  };
142 
143 } // namespace
144 
145 #endif
mitk::DICOMTag
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
mitkDICOMTagBasedSorter.h
mitk::DICOMTagBasedSorter
Sort DICOM datasets based on configurable tags.
Definition: mitkDICOMTagBasedSorter.h:40
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::DICOMFileReader
Interface for DICOM readers that produce mitk::Images.
Definition: mitkDICOMFileReader.h:55
mitkClassicDICOMSeriesReader.h
mitk::ClassicDICOMSeriesReader
Sorting and grouping like mitk::DicomSeriesReader until 2013.
Definition: mitkClassicDICOMSeriesReader.h:57
mitk::DICOMITKSeriesGDCMReader
Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT,...
Definition: mitkDICOMITKSeriesGDCMReader.h:190
mitk::ThreeDnTDICOMSeriesReader
Extends DICOMITKSeriesGDCMReader by sorting/grouping into 3D+t image blocks.
Definition: mitkThreeDnTDICOMSeriesReader.h:41
tinyxml2
Definition: mitkXMLSerializable.h:20
MITKDICOM_EXPORT
#define MITKDICOM_EXPORT
Definition: MitkDICOMExports.h:15
mitk::DICOMReaderConfigurator
Too-simple factory to create DICOMFileReaders.
Definition: mitkDICOMReaderConfigurator.h:93