DGtal  0.9.2
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)
33 
34 #define HDF5Reader_RECURSES
35 
36 #if !defined HDF5Reader_h
37 
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 
67  typedef TImageContainer ImageContainer;
68  typedef TImageContainer OutputImage;
69  typedef typename TImageContainer::Domain Domain;
70  typedef typename TImageContainer::Domain::Vector Vector;
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) throw(DGtal::IOException);
99 
100 
113  static ImageContainer importHDF5_3D(const std::string & aFilename, const std::string & aDataset,
114  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
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)
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
TImageContainer::Domain Domain
Definition: HDF5Reader.h:69
Aim: Import a HDF5 file.
Definition: HDF5Reader.h:62
STL namespace.
TImageContainer ImageContainer
Definition: HDF5Reader.h:67
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
BOOST_CONCEPT_ASSERT((concepts::CImage< TImageContainer >))
static ImageContainer importHDF5(const std::string &aFilename, const std::string &aDataset, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
TFunctor Functor
Definition: HDF5Reader.h:72
DGtal is the top-level namespace which contains all DGtal functions and types.
TImageContainer::Domain::Vector Vector
Definition: HDF5Reader.h:70
TImageContainer OutputImage
Definition: HDF5Reader.h:68
static ImageContainer importHDF5_3D(const std::string &aFilename, const std::string &aDataset, const Functor &aFunctor=Functor())
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102
TImageContainer::Value Value
Definition: HDF5Reader.h:71