Medical Imaging Interaction Toolkit  2018.4.99-b585543d
Medical Imaging Interaction Toolkit
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 "MitkDICOMReaderExports.h"
20 
21 #include "mitkDICOMTagCache.h"
22 
24 
25 #include <unordered_map>
26 
27 namespace mitk
28 {
29 // TODO Philips3D!
30 // TODO http://bugs.mitk.org/show_bug.cgi?id=11572 ?
31 
55 class MITKDICOMREADER_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
#define MITKDICOMREADER_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
std::map< DICOMTagPath, std::string > AdditionalTagsMapType
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
std::function< mitk::BaseProperty::Pointer(const DICOMCachedValueLookupTable &) > TagLookupTableToPropertyFunctor
DICOMImageBlockDescriptor::AdditionalTagsMapType AdditionalTagsMapType
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Output descriptor for DICOMFileReader.
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
Interface for DICOM readers that produce mitk::Images.