DGtal  1.5.beta
HDF5Reader.h
1 
17 #pragma once
18 
30 #if defined(HDF5Reader_RECURSES)
31 #error Recursive header files inclusion detected in HDF5Reader.h
32 #else // defined(HDF5Reader_RECURSES)
34 #define HDF5Reader_RECURSES
35 
36 #if !defined HDF5Reader_h
38 #define HDF5Reader_h
39 
41 // Inclusions
42 #include <iostream>
43 #include "DGtal/base/Common.h"
44 #include "DGtal/base/CUnaryFunctor.h"
45 #include "DGtal/images/CImage.h"
47 
48 namespace DGtal
49 {
50 
52 // class HDF5Reader
61  template <typename TImageContainer, typename TFunctor= functors::Cast< typename TImageContainer::Value > >
62  struct HDF5Reader
63  {
64  // ----------------------- Standard services ------------------------------
65  public:
66 
69  typedef typename TImageContainer::Domain Domain;
71  typedef typename TImageContainer::Value Value;
72  typedef TFunctor Functor;
73 
76 
77  BOOST_STATIC_ASSERT( (ImageContainer::Domain::dimension == 2) ||
78  (ImageContainer::Domain::dimension == 3));
79 
97  static ImageContainer importHDF5(const std::string & aFilename, const std::string & aDataset,
98  const Functor & aFunctor = Functor(), bool topbotomOrder = true);
99 
100 
113  static ImageContainer importHDF5_3D(const std::string & aFilename, const std::string & aDataset,
114  const Functor & aFunctor = Functor());
115 
116  }; // end of class HDF5Reader
117 
118 } // namespace DGtal
119 
120 
122 // Includes inline functions.
123 #include "DGtal/io/readers/HDF5Reader.ih"
124 
125 
126 // //
128 
129 #endif // !defined HDF5Reader_h
130 
131 #undef HDF5Reader_RECURSES
132 #endif // else defined(HDF5Reader_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Import a HDF5 file.
Definition: HDF5Reader.h:63
static ImageContainer importHDF5_3D(const std::string &aFilename, const std::string &aDataset, const Functor &aFunctor=Functor())
TImageContainer OutputImage
Definition: HDF5Reader.h:68
TFunctor Functor
Definition: HDF5Reader.h:72
TImageContainer::Domain Domain
Definition: HDF5Reader.h:69
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, unsigned char, Value >))
BOOST_CONCEPT_ASSERT((concepts::CImage< TImageContainer >))
TImageContainer::Value Value
Definition: HDF5Reader.h:71
TImageContainer ImageContainer
Definition: HDF5Reader.h:67
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
TImageContainer::Domain::Vector Vector
Definition: HDF5Reader.h:70
static ImageContainer importHDF5(const std::string &aFilename, const std::string &aDataset, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:103
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:90