DGtal  1.3.beta
DicomReader.h
1 
17 #pragma once
18 
31 #if defined(DicomReader_RECURSES)
32 #error Recursive header files inclusion detected in DicomReader.h
33 #else
34 
35 #define DicomReader_RECURSES
36 
37 #if !defined DicomReader_h
38 
39 #define DicomReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CUnaryFunctor.h"
46 #include "DGtal/images/CImage.h"
47 #include "DGtal/images/ImageContainerByITKImage.h"
48 
50 
51 #ifdef _MSC_VER
52 #pragma warning(disable : 4290)
53 #endif
54 
55 namespace DGtal
56 {
57 
59 // class DicomReader
89  template <typename TImageContainer,
90  typename TFunctor = functors::Cast< typename TImageContainer::Value > >
91  struct DicomReader
92  {
93  // ----------------------- Standard services ------------------------------
94  public:
95 
97  typedef typename TImageContainer::Value Value;
98  typedef TFunctor Functor;
99  typedef int32_t PixelType;
100 
103  BOOST_STATIC_ASSERT(( TImageContainer::Domain::dimension == 3 ));
104 
116  static ImageContainer importDicom( const std::string & aFilename,
117  const Functor & aFunctor = Functor());
118 
130  static ImageContainer importDicomSeries( const std::vector<std::string> & filenames,
131  const Functor & aFunctor = Functor());
132 
133  private:
134 
135  template <typename Domain, typename PixelType>
137  importDicomFiles_( const std::vector<std::string> & filenames );
138 
139 
140  template <typename Image, typename Domain, typename OutPixelType,
141  typename PixelType>
142  struct Aux
143  {
144  static inline Image
145  importDicomFiles( const std::vector<std::string> & filenames,
146  const TFunctor & aFunctor );
147  };
148 
149  //specialization
150  template <typename Domain, typename OutPixelType, typename PixelType>
151  struct Aux<ImageContainerByITKImage<Domain, OutPixelType>, Domain,
152  OutPixelType, PixelType>
153  {
155  importDicomFiles( const std::vector<std::string> & filenames,
156  const TFunctor & aFunctor );
157  };
158 
159 
160  template <typename PixelType>
161  static inline TImageContainer
162  importDicomFiles(const std::vector<std::string> & filenames,
163  const TFunctor & aFunctor);
164 
165 
166  }; // end of class DicomReader
167 
168 
169 
170 } // namespace DGtal
171 
172 
174 // Includes inline functions.
175 #include "DGtal/io/readers/DicomReader.ih"
176 
177 
178 // //
180 
181 #endif // !defined DicomReader_h
182 
183 #undef DicomReader_RECURSES
184 #endif // else defined(DicomReader_RECURSES)
DGtal::DicomReader
Aim: Import a 3D DICOM image from file series.
Definition: DicomReader.h:91
DGtal::DicomReader::Functor
TFunctor Functor
Definition: DicomReader.h:98
DGtal::HyperRectDomain< Space >
DGtal::DicomReader::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TImageContainer::Domain::dimension==3))
DGtal::ImageContainerBySTLVector::Value
TValue Value
Definition: ImageContainerBySTLVector.h:153
DGtal::DicomReader::Value
TImageContainer::Value Value
Definition: DicomReader.h:97
DGtal::ImageContainerByITKImage
Aim: implements a model of CImageContainer using a ITK Image.
Definition: ImageContainerByITKImage.h:93
DGtal::ImageContainerBySTLVector
Definition: ImageContainerBySTLVector.h:126
DGtal::DicomReader::PixelType
int32_t PixelType
Definition: DicomReader.h:99
DGtal::int32_t
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
DGtal::DicomReader::Aux
Definition: DicomReader.h:142
DGtal::DicomReader::ImageContainer
TImageContainer ImageContainer
Definition: DicomReader.h:96
DGtal::DicomReader::importDicomSeries
static ImageContainer importDicomSeries(const std::vector< std::string > &filenames, const Functor &aFunctor=Functor())
DGtal::DicomReader::importDicomFiles
static TImageContainer importDicomFiles(const std::vector< std::string > &filenames, const TFunctor &aFunctor)
Image
ImageContainerBySTLVector< Domain, Value > Image
Definition: testSimpleRandomAccessRangeFromPoint.cpp:45
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Domain
HyperRectDomain< Space > Domain
Definition: testSimpleRandomAccessRangeFromPoint.cpp:44
DGtal::DicomReader::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CImage< ImageContainer >))
DGtal::DicomReader::importDicom
static ImageContainer importDicom(const std::string &aFilename, const Functor &aFunctor=Functor())
DGtal::DicomReader::Aux::importDicomFiles
static Image importDicomFiles(const std::vector< std::string > &filenames, const TFunctor &aFunctor)
DGtal::Image
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
TImageContainer
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer
Definition: testVoronoiMapComplete.cpp:49
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
DGtal::DicomReader::importDicomFiles_
static ImageContainerByITKImage< Domain, PixelType > importDicomFiles_(const std::vector< std::string > &filenames)
DGtal::concepts::CImage
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102