DGtal  0.9.2
ITKReader.h
1 
17 #pragma once
18 
31 #if defined(ITKReader_RECURSES)
32 #error Recursive header files inclusion detected in ITKReader.h
33 #else // defined(ITKReader_RECURSES)
34 
35 #define ITKReader_RECURSES
36 
37 #if !defined ITKReader_h
38 
39 #define ITKReader_h
40 
41 #include "DGtal/base/Common.h"
42 #include "DGtal/base/CUnaryFunctor.h"
43 #include "DGtal/images/CImage.h"
44 #include "DGtal/base/BasicFunctors.h"
45 #include "DGtal/io/ITKIOTrait.h"
46 
47 namespace DGtal
48 {
49 
59  template <typename TImage, typename TFunctor = typename ITKIOTrait<typename TImage::Value>::DefaultReadFunctor >
60  struct ITKReader
61  {
62  typedef TImage Image;
63  typedef typename TImage::Value Value;
65  typedef TFunctor Functor;
66 
69  BOOST_STATIC_ASSERT(( (TImage::Domain::dimension == 3) || (TImage::Domain::dimension == 2) ));
70 
78  static Image importITK(const std::string & filename,
79  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
80  };
81 }//namespace
82 
84 // Includes inline functions.
85 #include "DGtal/io/readers/ITKReader.ih"
86 
87 // //
89 
90 #endif // !defined ITKReader_h
91 
92 #undef ITKReader_RECURSES
93 #endif // else defined(ITKReader_RECURSES)
BOOST_STATIC_ASSERT(((TImage::Domain::dimension==3)||(TImage::Domain::dimension==2)))
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
ITKIOTrait< Value >::ValueOut ValueOut
Definition: ITKReader.h:64
TImage::Value Value
Definition: ITKReader.h:63
Aim: Import a 2D/3D Image using the ITK formats.
Definition: ITKReader.h:60
DGtal is the top-level namespace which contains all DGtal functions and types.
static Image importITK(const std::string &filename, const Functor &aFunctor=Functor())
BOOST_CONCEPT_ASSERT((concepts::CImage< TImage >))
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102
TFunctor Functor
Definition: ITKReader.h:65