DGtal 1.3.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Static Private Attributes
DGtal::VolReader< TImageContainer, TFunctor > Struct Template Reference

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

#include <DGtal/io/readers/VolReader.h>

Data Structures

struct  HeaderField
 

Public Types

typedef TImageContainer ImageContainer
 
typedef TImageContainer::Value Value
 
typedef TFunctor Functor
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TFunctor, unsigned char, Value >))
 
 BOOST_STATIC_ASSERT (ImageContainer::Domain::dimension==3)
 

Static Public Member Functions

static ImageContainer importVol (const std::string &filename, const Functor &aFunctor=Functor())
 

Private Types

typedef unsigned char voxel
 

Static Private Member Functions

static const char * getHeaderValue (const char *type, const HeaderField *header)
 Returns NULL if this field is not found. More...
 
static int getHeaderValueAsInt (const char *type, int *dest, const HeaderField *header)
 Returns non-zero if failure. More...
 
static int getHeaderField (const char *type, const HeaderField *header)
 Internal method which returns the index of a field or -1 if not found. More...
 

Static Private Attributes

static const char * requiredHeaders []
 Global list of required fields in a .vol file. More...
 

Detailed Description

template<typename TImageContainer, typename TFunctor = functors::Cast< typename TImageContainer::Value >>
struct DGtal::VolReader< TImageContainer, TFunctor >

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
Image image = VolReader<Image>::importVol("data.vol");
trace.info() << image <<endl;
...
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:70
std::ostream & info()
Trace trace
Definition: Common.h:154
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
MyPointD Point
Definition: testClone2.cpp:383
Template Parameters
TImageContainerthe image container to use.
TFunctorthe type of functor used in the import (by default set to functors::Cast< TImageContainer::Value>) .
See also
testVolReader.cpp
Examples
examples/tutorial-examples/polyhedralizer.cpp, geometry/curves/exampleGridCurve3d-2.cpp, geometry/surfaces/greedy-plane-segmentation-ex2.cpp, geometry/surfaces/greedy-plane-segmentation.cpp, geometry/volumes/distance/distancetransform3D.cpp, geometry/volumes/distance/exampleFMM3D.cpp, graph/volDistanceTraversal.cpp, images/exampleRigidtransformation3d.cpp, images/extract2DImagesFrom3D.cpp, images/extract2DImagesFrom3DandVisu.cpp, images/extract2DSlicesImagesFrom3D.cpp, io/digitalSetFromVol.cpp, io/display3DToOFF.cpp, io/viewers/viewer3D-8-2DSliceImages.cpp, io/viewers/viewer3D-8bis-2Dimages.cpp, shapes/viewMarchingCubes.cpp, shapes/viewPolygonalMarchingCubes.cpp, topology/3dBorderExtractionImg.cpp, topology/ctopo-2-3d.cpp, topology/digitalSurfaceSlice.cpp, topology/volBreadthFirstTraversal.cpp, topology/volMarchingCubes.cpp, topology/volScanBoundary.cpp, topology/volToOFF.cpp, topology/volTrackBoundary.cpp, tutorial-examples/FMMErosion.cpp, tutorial-examples/polyhedralizer.cpp, and tutorial-examples/volDTGranulo.cpp.

Definition at line 89 of file VolReader.h.

Member Typedef Documentation

◆ Functor

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
typedef TFunctor DGtal::VolReader< TImageContainer, TFunctor >::Functor

Definition at line 95 of file VolReader.h.

◆ ImageContainer

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
typedef TImageContainer DGtal::VolReader< TImageContainer, TFunctor >::ImageContainer

Definition at line 93 of file VolReader.h.

◆ Value

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
typedef TImageContainer::Value DGtal::VolReader< TImageContainer, TFunctor >::Value

Definition at line 94 of file VolReader.h.

◆ voxel

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
typedef unsigned char DGtal::VolReader< TImageContainer, TFunctor >::voxel
private

Definition at line 119 of file VolReader.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
DGtal::VolReader< TImageContainer, TFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< TFunctor, unsigned char, Value >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
DGtal::VolReader< TImageContainer, TFunctor >::BOOST_STATIC_ASSERT ( ImageContainer::Domain::dimension  = =3)

◆ getHeaderField()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
static int DGtal::VolReader< TImageContainer, TFunctor >::getHeaderField ( const char *  type,
const HeaderField header 
)
staticprivate

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

◆ getHeaderValue()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
static const char * DGtal::VolReader< TImageContainer, TFunctor >::getHeaderValue ( const char *  type,
const HeaderField header 
)
staticprivate

Returns NULL if this field is not found.

◆ getHeaderValueAsInt()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
static int DGtal::VolReader< TImageContainer, TFunctor >::getHeaderValueAsInt ( const char *  type,
int *  dest,
const HeaderField header 
)
staticprivate

Returns non-zero if failure.

◆ importVol()

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
static ImageContainer DGtal::VolReader< TImageContainer, TFunctor >::importVol ( const std::string &  filename,
const Functor aFunctor = Functor() 
)
static

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

Parameters
filenamethe file name to import.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > .
Returns
an instance of the ImageContainer.
Examples
dec/exampleDECSurface.cpp.

Referenced by DGtal::GenericReader< TContainer, 3, TValue >::importWithValueFunctor(), main(), test3dSurfaceHelper(), TEST_CASE(), testConsistence(), testIOException(), testLocalConvolutionNormalVectorEstimator(), testSliceImageFromFunctor(), and testVolReader().

Field Documentation

◆ requiredHeaders

template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
const char* DGtal::VolReader< TImageContainer, TFunctor >::requiredHeaders[]
staticprivate

Global list of required fields in a .vol file.

Definition at line 168 of file VolReader.h.


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