31 #if defined(LongvolReader_RECURSES)
32 #error Recursive header files inclusion detected in LongvolReader.h
35 #define LongvolReader_RECURSES
37 #if !defined LongvolReader_h
39 #define LongvolReader_h
47 #include "DGtal/base/Common.h"
48 #include <boost/static_assert.hpp>
49 #include "DGtal/helpers/StdDefs.h"
50 #include "DGtal/base/CUnaryFunctor.h"
89 template <
typename TImageContainer,
90 typename TFunctor= functors::Cast< typename TImageContainer::Value > >
129 template <
typename Word>
131 std::stringstream&
read_word( std::stringstream & fin, Word& aValue )
135 for (
unsigned int size = 0; size <
sizeof( Word ); ++size)
138 unsigned char cc=
static_cast<unsigned char>(c);
139 aValue |= (cc << (8 * size));
157 type( strdup(t) ), value( strdup(v) ) {}
164 type( strdup(h.type) ), value( strdup(h.value) ) {};
171 if (h.type != NULL) {
172 type = strdup( h.type );
173 value = strdup( h.value );
204 #include "DGtal/io/readers/LongvolReader.ih"
211 #undef LongvolReader_RECURSES
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: implements methods to read a "Longvol" file format (with DGtal::uint64_t value type).
static const char * requiredHeaders[]
Global list of required fields in a .longvol file.
TImageContainer::Value Value
static ImageContainer importLongvol(const std::string &filename, const Functor &aFunctor=Functor())
static std::stringstream & read_word(std::stringstream &fin, Word &aValue)
static int getHeaderValueAsInt(const char *type, int *dest, const HeaderField *header)
Returns non-zero if failure.
TImageContainer ImageContainer
BOOST_STATIC_ASSERT(ImageContainer::Domain::dimension==3)
static int getHeaderField(const char *type, const HeaderField *header)
Internal method which returns the index of a field or -1 if not found.
static const char * getHeaderValue(const char *type, const HeaderField *header)
Returns NULL if this field is not found.
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, DGtal::uint64_t, Value >))
Aim: Defines a unary functor, which associates arguments to results.