DGtal  1.5.beta
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)
35 #define VolWriter_RECURSES
36 
37 #if !defined VolWriter_h
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 
87  static bool exportVol(const std::string & filename, const Image &aImage,
88  const bool compressed=true,
89  const Functor & aFunctor = Functor());
90  };
91 }//namespace
92 
94 // Includes inline functions.
95 #include "DGtal/io/writers/VolWriter.ih"
96 
97 // //
99 
100 #endif // !defined VolWriter_h
101 
102 #undef VolWriter_RECURSES
103 #endif // else defined(VolWriter_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Export a 3D Image using the Vol formats.
Definition: VolWriter.h:69
TFunctor Functor
Definition: VolWriter.h:73
static bool exportVol(const std::string &filename, const Image &aImage, const bool compressed=true, const Functor &aFunctor=Functor())
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, Value, unsigned char >))
TImage::Value Value
Definition: VolWriter.h:72
BOOST_STATIC_ASSERT(TImage::Domain::dimension==3)
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:90