Medical Imaging Interaction Toolkit  2024.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkDICOMFileReader.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 mitkDICOMFileReader_h
14 #define mitkDICOMFileReader_h
15 
16 #include "itkObjectFactory.h"
17 #include "mitkCommon.h"
18 
19 #include "MitkDICOMExports.h"
20 
21 #include "mitkDICOMTagCache.h"
22 
24 
25 #include <unordered_map>
26 
27 namespace mitk
28 {
29 // TODO Philips3D!
30 // TODO https://phabricator.mitk.org/T11572 ?
31 
55 class MITKDICOM_EXPORT DICOMFileReader : public itk::Object
56 {
57 public:
59 
61  static bool IsDICOM( const std::string& filename );
63  virtual bool CanHandleFile( const std::string& filename ) = 0;
64 
66  void SetInputFiles( const StringList& filenames );
68  const StringList& GetInputFiles() const;
69 
71  virtual void AnalyzeInputFiles() = 0;
72 
74  unsigned int GetNumberOfOutputs() const;
76  const DICOMImageBlockDescriptor& GetOutput( unsigned int index ) const;
77 
78  // void AllocateOutputImages(); TODO for later implementation of slice-by-slice loading
79 
82  virtual bool LoadImages() = 0;
83 
84  virtual DICOMTagPathList GetTagsOfInterest() const = 0;
85 
87  virtual void SetTagCache( const DICOMTagCache::Pointer& ) = 0;
88 
90  void SetConfigurationLabel( const std::string& );
92  std::string GetConfigurationLabel() const;
94  void SetConfigurationDescription( const std::string& );
96  std::string GetConfigurationDescription() const;
97 
99  void PrintConfiguration( std::ostream& os ) const;
101  void PrintOutputs( std::ostream& os, bool filenameDetails = false ) const;
102 
103  virtual bool operator==( const DICOMFileReader& other ) const = 0;
104 
120  virtual void SetAdditionalTagsOfInterest(const AdditionalTagsMapType& tagList);
121 
132  virtual void SetTagLookupTableToPropertyFunctor(
134 
135 protected:
136  DICOMFileReader();
137  ~DICOMFileReader() override;
138 
139  DICOMFileReader( const DICOMFileReader& other );
140  DICOMFileReader& operator=( const DICOMFileReader& other );
141 
142  void ClearOutputs();
143  void SetNumberOfOutputs( unsigned int numberOfOutputs );
144  void SetOutput( unsigned int index, const DICOMImageBlockDescriptor& output );
145 
147  DICOMImageBlockDescriptor& InternalGetOutput( unsigned int index );
148 
150  virtual void InternalPrintConfiguration( std::ostream& os ) const = 0;
151 
152  virtual AdditionalTagsMapType GetAdditionalTagsOfInterest() const;
153 
154  mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor GetTagLookupTableToPropertyFunctor() const;
155 
156 
157 private:
158  StringList m_InputFilenames;
159  std::vector<DICOMImageBlockDescriptor> m_Outputs;
160 
161  std::string m_ConfigLabel;
162  std::string m_ConfigDescription;
163 
164  AdditionalTagsMapType m_AdditionalTagsOfInterest;
166 };
167 }
168 
169 #endif
mitk::DICOMTagPathList
std::vector< DICOMTagPath > DICOMTagPathList
Definition: mitkDICOMTagPath.h:155
mitk::DICOMImageBlockDescriptor
Output descriptor for DICOMFileReader.
Definition: mitkDICOMImageBlockDescriptor.h:78
mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor
std::function< mitk::BaseProperty::Pointer(const DICOMCachedValueLookupTable &) > TagLookupTableToPropertyFunctor
Definition: mitkDICOMImageBlockDescriptor.h:192
MitkDICOMExports.h
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
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
mitkDICOMImageBlockDescriptor.h
mitkCommon.h
mitkDICOMTagCache.h
mitk::DICOMFileReader::AdditionalTagsMapType
DICOMImageBlockDescriptor::AdditionalTagsMapType AdditionalTagsMapType
Definition: mitkDICOMFileReader.h:108
MITKDICOM_EXPORT
#define MITKDICOM_EXPORT
Definition: MitkDICOMExports.h:15
mitk::DICOMImageBlockDescriptor::AdditionalTagsMapType
std::map< DICOMTagPath, std::string > AdditionalTagsMapType
Definition: mitkDICOMImageBlockDescriptor.h:178
mitk::StringList
std::vector< std::string > StringList
Definition: mitkDICOMEnums.h:22