DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions
DGtal::LongvolWriter< TImage, TFunctor > Struct Template Reference

Aim: Export a 3D Image using the Longvol formats (volumetric image with DGtal::uint64_t value type). More...

#include <DGtal/io/writers/LongvolWriter.h>

Public Types

typedef TImage Image
 
typedef TImage::Value Value
 
typedef TFunctor Functor
 
typedef DGtal::uint64_t ValueLongvol
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TFunctor, Value, ValueLongvol >))
 

Static Public Member Functions

static bool exportLongvol (const std::string &filename, const Image &aImage, const bool compressed=true, const Functor &aFunctor=Functor())
 

Static Private Member Functions

template<typename Word >
static std::ostream & write_word (std::ostream &outs, Word value)
 

Detailed Description

template<typename TImage, typename TFunctor = functors::Identity>
struct DGtal::LongvolWriter< TImage, TFunctor >

Aim: Export a 3D Image using the Longvol formats (volumetric image with DGtal::uint64_t value type).

Description of template struct 'LongvolWriter'

A functor can be specified to convert image values to LongVol values (DGtal::uint64_t).

Template Parameters
TImagethe Image type.
TFunctorthe type of functor used in the export.
See also
testLongvol.cpp

Definition at line 69 of file LongvolWriter.h.

Member Typedef Documentation

◆ Functor

template<typename TImage , typename TFunctor = functors::Identity>
typedef TFunctor DGtal::LongvolWriter< TImage, TFunctor >::Functor

Definition at line 75 of file LongvolWriter.h.

◆ Image

template<typename TImage , typename TFunctor = functors::Identity>
typedef TImage DGtal::LongvolWriter< TImage, TFunctor >::Image

Definition at line 73 of file LongvolWriter.h.

◆ Value

template<typename TImage , typename TFunctor = functors::Identity>
typedef TImage::Value DGtal::LongvolWriter< TImage, TFunctor >::Value

Definition at line 74 of file LongvolWriter.h.

◆ ValueLongvol

template<typename TImage , typename TFunctor = functors::Identity>
typedef DGtal::uint64_t DGtal::LongvolWriter< TImage, TFunctor >::ValueLongvol

Definition at line 76 of file LongvolWriter.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TImage , typename TFunctor = functors::Identity>
DGtal::LongvolWriter< TImage, TFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< TFunctor, Value, ValueLongvol >)  )

◆ exportLongvol()

template<typename TImage , typename TFunctor = functors::Identity>
static bool DGtal::LongvolWriter< TImage, TFunctor >::exportLongvol ( const std::string &  filename,
const Image aImage,
const bool  compressed = true,
const Functor aFunctor = Functor() 
)
static

Export an Image with the Longvol format. A DGtal::IOException is thrown in case of io problems.

Parameters
filenamename of the output file
aImagethe image to export
compressedboolean to decide wether the vol must be compressed or not
aFunctorfunctor used to cast image values
Returns
true if no errors occur.

Referenced by testLongvol().

◆ write_word()

template<typename TImage , typename TFunctor = functors::Identity>
template<typename Word >
static std::ostream & DGtal::LongvolWriter< TImage, TFunctor >::write_word ( std::ostream &  outs,
Word  value 
)
inlinestaticprivate

Generic write word (binary mode) in little-endian.

Parameters
outsoutput stream.
valuevalue to write.
Returns
modified stream.

Definition at line 108 of file LongvolWriter.h.

109 {
110 for (unsigned size = sizeof( Word ); size; --size, value >>= 8)
111 outs.put( static_cast <char> (value & 0xFF) );
112 return outs;
113 }

The documentation for this struct was generated from the following file: