Medical Imaging Interaction Toolkit  2016.11.0
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,
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 mitkDICOMFileReader_h
18 #define mitkDICOMFileReader_h
19 
20 #include "itkObjectFactory.h"
21 #include "mitkCommon.h"
22 
23 #include "MitkDICOMReaderExports.h"
24 
25 #include "mitkDICOMTagCache.h"
26 
28 
29 #include <unordered_map>
30 
31 namespace mitk
32 {
33 // TODO Philips3D!
34 // TODO http://bugs.mitk.org/show_bug.cgi?id=11572 ?
35 
59 class MITKDICOMREADER_EXPORT DICOMFileReader : public itk::Object
60 {
61 public:
63 
65  static bool IsDICOM( const std::string& filename );
67  virtual bool CanHandleFile( const std::string& filename ) = 0;
68 
70  void SetInputFiles( const StringList& filenames );
72  const StringList& GetInputFiles() const;
73 
75  virtual void AnalyzeInputFiles() = 0;
76 
78  unsigned int GetNumberOfOutputs() const;
80  const DICOMImageBlockDescriptor& GetOutput( unsigned int index ) const;
81 
82  // void AllocateOutputImages(); TODO for later implementation of slice-by-slice loading
83 
86  virtual bool LoadImages() = 0;
87 
88  virtual DICOMTagPathList GetTagsOfInterest() const = 0;
89 
91  virtual void SetTagCache( const DICOMTagCache::Pointer& ) = 0;
92 
94  void SetConfigurationLabel( const std::string& );
96  std::string GetConfigurationLabel() const;
98  void SetConfigurationDescription( const std::string& );
100  std::string GetConfigurationDescription() const;
101 
103  void PrintConfiguration( std::ostream& os ) const;
105  void PrintOutputs( std::ostream& os, bool filenameDetails = false ) const;
106 
107  virtual bool operator==( const DICOMFileReader& other ) const = 0;
108 
124  virtual void SetAdditionalTagsOfInterest(const AdditionalTagsMapType& tagList);
125 
136  virtual void SetTagLookupTableToPropertyFunctor(
138 
139 protected:
140  DICOMFileReader();
141  virtual ~DICOMFileReader();
142 
143  DICOMFileReader( const DICOMFileReader& other );
144  DICOMFileReader& operator=( const DICOMFileReader& other );
145 
146  void ClearOutputs();
147  void SetNumberOfOutputs( unsigned int numberOfOutputs );
148  void SetOutput( unsigned int index, const DICOMImageBlockDescriptor& output );
149 
151  DICOMImageBlockDescriptor& InternalGetOutput( unsigned int index );
152 
154  virtual void InternalPrintConfiguration( std::ostream& os ) const = 0;
155 
156  virtual AdditionalTagsMapType GetAdditionalTagsOfInterest() const;
157 
158  mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor GetTagLookupTableToPropertyFunctor() const;
159 
160 
161 private:
162  StringList m_InputFilenames;
163  std::vector<DICOMImageBlockDescriptor> m_Outputs;
164 
165  std::string m_ConfigLabel;
166  std::string m_ConfigDescription;
167 
168  AdditionalTagsMapType m_AdditionalTagsOfInterest;
170 };
171 }
172 
173 #endif
itk::SmartPointer< Self > Pointer
#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
static const std::string filename
DICOMImageBlockDescriptor::AdditionalTagsMapType AdditionalTagsMapType
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Output descriptor for DICOMFileReader.
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
Interface for DICOM readers that produce mitk::Images.