DGtal  0.9.2
ITKWriter.h
1 
17 #pragma once
18 
31 #if defined(ITKWriter_RECURSES)
32 #error Recursive header files inclusion detected in ITKWriter.h
33 #else // defined(ITKWriter_RECURSES)
34 
35 #define ITKWriter_RECURSES
36 
37 #if !defined ITKWriter_h
38 
39 #define ITKWriter_h
40 
41 #include "DGtal/images/CConstImage.h"
42 #include "DGtal/base/Common.h"
43 #include "DGtal/base/CUnaryFunctor.h"
44 #include "DGtal/base/BasicFunctors.h"
45 #include "DGtal/io/ITKIOTrait.h"
46 
47 namespace DGtal
48 {
49 
62  template <typename TImage, typename TFunctor = typename ITKIOTrait<typename TImage::Value>::DefaultWriteFunctor >
63  struct ITKWriter
64  {
65  typedef TImage Image;
66  typedef typename TImage::Value Value;
68  typedef TFunctor Functor;
69 
72  BOOST_STATIC_ASSERT(( (TImage::Domain::dimension == 3) || (TImage::Domain::dimension == 2) ));
73 
82  static bool exportITK(const std::string & filename, const Image &aImage,
83  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
84  };
85 }//namespace
86 
88 // Includes inline functions.
89 #include "DGtal/io/writers/ITKWriter.ih"
90 
91 // //
93 
94 #endif // !defined ITKWriter_h
95 
96 #undef ITKWriter_RECURSES
97 #endif // else defined(ITKWriter_RECURSES)
BOOST_STATIC_ASSERT(((TImage::Domain::dimension==3)||(TImage::Domain::dimension==2)))
TImage::Value Value
Definition: ITKWriter.h:66
static bool exportITK(const std::string &filename, const Image &aImage, const Functor &aFunctor=Functor())
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
TFunctor Functor
Definition: ITKWriter.h:68
DGtal is the top-level namespace which contains all DGtal functions and types.
BOOST_CONCEPT_ASSERT((concepts::CConstImage< TImage >))
ITKIOTrait< Value >::ValueOut ValueOut
Definition: ITKWriter.h:67
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition: CConstImage.h:94
Export a 2D/3D Image using the ITK formats.
Definition: ITKWriter.h:63