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"
90 typename TFunctor= functors::Cast< typename TImageContainer::Value > >
129 template <
typename Word>
131 std::stringstream&
read_word( std::stringstream & fin, Word& aValue )
133 char* raw =
reinterpret_cast<char*
>(&aValue);
134 for (std::size_t i = 0; i <
sizeof(Word); ++i)
152 type( strdup(t) ), value( strdup(v) ) {}
159 type( strdup(h.type) ), value( strdup(h.value) ) {};
166 if (h.type != NULL) {
167 type = strdup( h.type );
168 value = strdup( h.value );
199#include "DGtal/io/readers/LongvolReader.ih"
206#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 std::stringstream & read_word(std::stringstream &fin, Word &aValue)
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 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 const char * getHeaderValue(const char *type, const HeaderField *header)
Returns NULL if this field is not found.
static int getHeaderField(const char *type, const HeaderField *header)
Internal method which returns the index of a field or -1 if not found.
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, DGtal::uint64_t, Value >))
Aim: Defines a unary functor, which associates arguments to results.
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer