DGtal 0.3.0
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Static Private Attributes

DGtal::VolReader< TImageContainer > Struct Template Reference

Aim: implements methods to read a "Vol" file format. More...

#include <VolReader.h>

Data Structures

struct  HeaderField

Public Types

typedef TImageContainer ImageContainer

Public Member Functions

 BOOST_STATIC_ASSERT (ImageContainer::Domain::dimension==3)

Static Public Member Functions

static ImageContainer importVol (const std::string &filename) throw (DGtal::IOException)

Private Types

typedef unsigned char voxel

Static Private Member Functions

static const char * getHeaderValue (const char *type, const HeaderField *header)
static int getHeaderValueAsInt (const char *type, int *dest, const HeaderField *header)
static int getHeaderField (const char *type, const HeaderField *header)

Static Private Attributes

static const int MAX_HEADERNUMLINES = 64
static const char * requiredHeaders []

Detailed Description

template<typename TImageContainer>
struct DGtal::VolReader< TImageContainer >

Aim: implements methods to read a "Vol" file format.

Description of template class 'VolReader'

The main import method "importVol" returns an instance of the template parameter TImageContainer.

The private methods have been backported from the SimpleVol project (see http://liris.cnrs.fr/david.coeurjolly).

Example usage:

 ...
 typedef SpaceND<int,3> Space3;
 typedef HyperRectDomain<Space3> TDomain;
 typedef TDomain::Point Point;

 //Default image container = STLVector
 typedef ImageSelector<TDomain, int>::Type Image;

 Image image = VolReader<Image>::importVol("data.vol");

 trace.info() << image <<endl;
 ...
Template Parameters:
TImageContainerthe image container to use.
See also:
testVolReader.cpp
Examples:

3dBorderExtractionImg.cpp, digitalSetFromVol.cpp, and distancetransform3D.cpp.

Definition at line 88 of file VolReader.h.


Member Typedef Documentation

template<typename TImageContainer >
typedef TImageContainer DGtal::VolReader< TImageContainer >::ImageContainer

Definition at line 92 of file VolReader.h.

template<typename TImageContainer >
typedef unsigned char DGtal::VolReader< TImageContainer >::voxel [private]

Definition at line 110 of file VolReader.h.


Member Function Documentation

template<typename TImageContainer >
DGtal::VolReader< TImageContainer >::BOOST_STATIC_ASSERT ( ImageContainer::Domain::dimension  = =3)
template<typename TImageContainer >
static int DGtal::VolReader< TImageContainer >::getHeaderField ( const char *  type,
const HeaderField header 
) [static, private]

Internal method which returns the index of a field or -1 if not found.

template<typename TImageContainer >
static const char* DGtal::VolReader< TImageContainer >::getHeaderValue ( const char *  type,
const HeaderField header 
) [static, private]

Returns NULL if this field is not found.

template<typename TImageContainer >
static int DGtal::VolReader< TImageContainer >::getHeaderValueAsInt ( const char *  type,
int *  dest,
const HeaderField header 
) [static, private]

Returns non-zero if failure.

template<typename TImageContainer >
static ImageContainer DGtal::VolReader< TImageContainer >::importVol ( const std::string &  filename) throw (DGtal::IOException) [static]

Main method to import a Vol into an instance of the template parameter ImageContainer.

Parameters:
filenamethe file name to import.
Returns:
an instance of the ImageContainer.

Field Documentation

template<typename TImageContainer >
const int DGtal::VolReader< TImageContainer >::MAX_HEADERNUMLINES = 64 [static, private]

Maximum number of fields in a .vol file header.

Definition at line 155 of file VolReader.h.

template<typename TImageContainer >
const char* DGtal::VolReader< TImageContainer >::requiredHeaders[] [static, private]

Global list of required fields in a .vol file.

Definition at line 162 of file VolReader.h.


The documentation for this struct was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines