DGtal  0.9.2
VolWriter.h
1 
17 #pragma once
18 
31 #if defined(VolWriter_RECURSES)
32 #error Recursive header files inclusion detected in VolWriter.h
33 #else // defined(VolWriter_RECURSES)
34 
35 #define VolWriter_RECURSES
36 
37 #if !defined VolWriter_h
38 
39 #define VolWriter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #include <boost/static_assert.hpp>
46 #include <boost/type_traits.hpp>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/base/CUnaryFunctor.h"
49 #include "DGtal/base/BasicFunctors.h"
51 
52 namespace DGtal
53 {
54 
56  // template class VolWriter
67  template <typename TImage, typename TFunctor = functors::Identity>
68  struct VolWriter
69  {
70  // ----------------------- Standard services ------------------------------
71  typedef TImage Image;
72  typedef typename TImage::Value Value;
73  typedef TFunctor Functor;
74 
76  BOOST_STATIC_ASSERT(TImage::Domain::dimension == 3);
77 
86  static bool exportVol(const std::string & filename, const Image &aImage,
87  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
88  };
89 }//namespace
90 
92 // Includes inline functions.
93 #include "DGtal/io/writers/VolWriter.ih"
94 
95 // //
97 
98 #endif // !defined VolWriter_h
99 
100 #undef VolWriter_RECURSES
101 #endif // else defined(VolWriter_RECURSES)
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, Value, unsigned char >))
Aim: Export a 3D Image using the Vol formats.
Definition: VolWriter.h:68
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
TFunctor Functor
Definition: VolWriter.h:73
DGtal is the top-level namespace which contains all DGtal functions and types.
BOOST_STATIC_ASSERT(TImage::Domain::dimension==3)
static bool exportVol(const std::string &filename, const Image &aImage, const Functor &aFunctor=Functor())
TImage::Value Value
Definition: VolWriter.h:72