DGtal  0.9.3beta
Public Member Functions | Static Public Member Functions
DGtal::GenericReader< TContainer, Tdim, TValue > Struct Template Reference

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

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TContainer >))
 

Static Public Member Functions

static TContainer import (const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >()) throw (DGtal::IOException)
 

Detailed Description

template<typename TContainer, int Tdim = TContainer::Point::dimension, typename TValue = typename TContainer::Value>
struct DGtal::GenericReader< TContainer, Tdim, TValue >

Aim: Provide a mechanism to load with the bestloader according to an image (2D or 3D) filename (by parsing the extension).

Description of template class 'GenericReader'

The typical use is very simple:

Advanced:
the file format value type will be cast to TContainer::Value. For instance, VOL file format deals with "unsigned char" and if the TContainer::Value type is different, you could have type conversion issues.
Template Parameters
TContainerthe container (mainly an ImageContainer like ImageContainerBySTLVector or ImageContainerBySTLMap).
Tdimthe dimension of the container (by default given by the container).
Examples:
geometry/surfaces/dvcm-3d.cpp, images/imageBasicSubsampling.cpp, io/viewers/viewer3D-9-3Dimages.cpp, and tutorial-examples/2DSliceImageFromVol.cpp.

Definition at line 101 of file GenericReader.h.

Member Function Documentation

template<typename TContainer , int Tdim = TContainer::Point::dimension, typename TValue = typename TContainer::Value>
DGtal::GenericReader< TContainer, Tdim, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TContainer >)  )
template<typename TContainer , int Tdim = TContainer::Point::dimension, typename TValue = typename TContainer::Value>
static TContainer DGtal::GenericReader< TContainer, Tdim, TValue >::import ( const std::string &  filename,
std::vector< unsigned int >  dimSpace = std::vector< unsigned int >() 
)
throw (DGtal::IOException
)
static

Import a volume nd image file. For the special format of raw image, the default parameter of the image size must be given in the optional function vector parameter (dimSpace) .

Parameters
filenamethe image filename to imported.
dimSpacea vector containing the n dimensional image size.

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