DGtal  1.1.0
ITKDicomReader.h
1 
17 #pragma once
18 
31 #if defined(ITKDicomReader_RECURSES)
32 #error Recursive header files inclusion detected in ITKDicomReader.h
33 #else // defined(ITKDicomReader_RECURSES)
34 
35 #define ITKDicomReader_RECURSES
36 
37 #if !defined ITKDicomReader_h
38 
39 #define ITKDicomReader_h
40 
41 #include "DGtal/base/Common.h"
42 #include "DGtal/base/CUnaryFunctor.h"
43 #include "DGtal/images/CImage.h"
44 #include "DGtal/io/ITKIOTrait.h"
45 #include "DGtal/images/ImageContainerByITKImage.h"
46 #if defined(__GNUG__)
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wpedantic"
49 #endif
50 #if defined(__clang__)
51 #pragma clang diagnostic push
52 #pragma clang diagnostic ignored "-Wdocumentation"
53 #endif
54 #include <itkImageFileReader.h>
55 #if defined(__clang__)
56 #pragma clang diagnostic pop
57 #endif
58 #if defined(__GNUG__)
59 #pragma GCC diagnostic pop
60 #endif
61 
62 namespace DGtal
63 {
64 
80  template <typename TImage>
82  {
83  typedef TImage Image;
84  typedef typename TImage::Value Value;
86 
88  BOOST_STATIC_ASSERT(( (TImage::Domain::dimension == 3)
89  || (TImage::Domain::dimension == 2) ));
90 
106  template <typename TFunctor =
108  static Image importDICOM( const std::vector<std::string> & filenames,
109  const TFunctor & aFunctor = TFunctor() );
110 
111 
112  private:
113 
114  template <typename Domain, typename PixelType>
115  static inline
117  importDicomFiles( const std::vector<std::string> & filenames );
118 
119 
120 
121  template <typename Image, typename Domain, typename OrigValue,
122  typename TFunctor, typename Value>
123  struct Aux
124  {
125  static inline Image
126  readDGtalImageFromITKtypes( const std::vector<std::string> & filenames,
127  const TFunctor & aFunctor );
128  };
129 
130  //specialization
131  template <typename Domain, typename OrigValue, typename TFunctor,
132  typename Value>
134  TFunctor, Value>
135  {
137  readDGtalImageFromITKtypes( const std::vector<std::string> & filenames,
138  const TFunctor & aFunctor );
139  };
140 
141 
153  template <typename TypeDGtalImage, typename TFunctor>
154  static Image
155  readDGtalImageFromITKtypes( const std::vector<std::string> & filenames,
156  const TFunctor & aFunctor );
157  };
158 }//namespace
159 
161 // Includes inline functions.
162 #include "DGtal/io/readers/ITKDicomReader.ih"
163 
164 // //
166 
167 #endif // !defined ITKDicomReader_h
168 
169 #undef ITKDicomReader_RECURSES
170 #endif // else defined(ITKDicomReader_RECURSES)
DGtal::ITKDicomReader::Aux::readDGtalImageFromITKtypes
static Image readDGtalImageFromITKtypes(const std::vector< std::string > &filenames, const TFunctor &aFunctor)
DGtal::HyperRectDomain< Space >
DGtal::ImageContainerByITKImage
Aim: implements a model of CImageContainer using a ITK Image.
Definition: ImageContainerByITKImage.h:94
DGtal::ITKDicomReader::readDGtalImageFromITKtypes
static Image readDGtalImageFromITKtypes(const std::vector< std::string > &filenames, const TFunctor &aFunctor)
DGtal::ITKDicomReader::ValueOut
ITKIOTrait< Value >::ValueOut ValueOut
Definition: ITKDicomReader.h:85
DGtal::ITKDicomReader::Value
TImage::Value Value
Definition: ITKDicomReader.h:84
DGtal::functors::Cast
Aim: Define a simple functor using the static cast operator.
Definition: BasicFunctors.h:394
DGtal::ITKDicomReader::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CImage< TImage >))
DGtal::ITKIOTrait::ValueOut
Value ValueOut
Definition: ITKIOTrait.h:56
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
Domain
HyperRectDomain< Space > Domain
Definition: testSimpleRandomAccessRangeFromPoint.cpp:44
DGtal::ITKDicomReader::Aux< ImageContainerByITKImage< Domain, Value >, Domain, OrigValue, TFunctor, Value >::readDGtalImageFromITKtypes
static ImageContainerByITKImage< Domain, Value > readDGtalImageFromITKtypes(const std::vector< std::string > &filenames, const TFunctor &aFunctor)
DGtal::ITKDicomReader::Image
TImage Image
Definition: ITKDicomReader.h:83
DGtal::ITKDicomReader::Aux
Definition: ITKDicomReader.h:124
DGtal::ITKDicomReader
Aim: Import a 2D/3D DICOM Image from file series.
Definition: ITKDicomReader.h:82
DGtal::ITKDicomReader::importDICOM
static Image importDICOM(const std::vector< std::string > &filenames, const TFunctor &aFunctor=TFunctor())
DGtal::ITKDicomReader::importDicomFiles
static ImageContainerByITKImage< Domain, PixelType > importDicomFiles(const std::vector< std::string > &filenames)
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38
DGtal::concepts::CImage
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:103