File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::GenericReader< TContainer, 3, DGtal::uint32_t > Struct Template Reference

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

Inheritance diagram for DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >:
[legend]

Public Member Functions

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

Static Public Member Functions

static TContainer import (const std::string &filename, unsigned int x=0, unsigned int y=0, unsigned int z=0)
template<typename TFunctor>
static TContainer importWithValueFunctor (const std::string &filename, const TFunctor &aFunctor, unsigned int x=0, unsigned int y=0, unsigned int z=0)
static TContainer importWithColorFunctor (const std::string &filename, const TFunctor &aFunctor, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())

Detailed Description

template<typename TContainer>
struct DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >

GenericReader Template partial specialisation for volume images with 32 bits values

Definition at line 301 of file GenericReader.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TContainer>
DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TContainer >) )

◆ import()

template<typename TContainer>
TContainer DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >::import ( const std::string & filename,
unsigned int x = 0,
unsigned int y = 0,
unsigned int z = 0 )
static

Import a volume image file. For the special format of raw image, the default parameter x,y, z need to be updated according to the dimension if the image.

Parameters
filenamethe image filename to be imported.
xthe size in the x direction.
ythe size in the y direction.
zthe size in the z direction.

◆ importWithColorFunctor()

TContainer DGtal::GenericReader< TContainer, Tdim, DGtal::uint32_t >::importWithColorFunctor ( const std::string & filename,
const TFunctor & aFunctor,
std::vector< unsigned int > dimSpace = std::vector<unsigned int>() )
inlinestatic

Import a volume nd image file by specifying a value functor.

Template Parameters
TFunctorThe type of the functor (should verify the concept CUnaryFunctor<TFunctor, TValue , TContainer::Value > )
Parameters
dimSpacea vector containing the n dimensional image size.
filenamethe image filename to be imported.
aFunctoran ColorRGBEncoder. The type of the functor (should verify the concept CUnaryFunctor<TFunctor, TContainer::Value, DGtal::Color >).

Definition at line 174 of file GenericReader.h.

179 {
182 typename TContainer::Value>));
183
185 const std::string extension =
186 filename.substr( filename.find_last_of( "." ) + 1 );
187
188 if ( extension == "raw" )
189 {
190 for ( unsigned int i = 0; i < dimSpace.size(); i++ )
191 ASSERT( dimSpace[ i ] != 0 );
192 typename TContainer::Point const pt;
193 for ( unsigned int i = 0; i < dimSpace.size(); i++ )
194 pt[ i ] = dimSpace[ i ];
197 }
198
199 trace.error() << "Extension " << extension
200 << " not yet implemented in DGtal GenericReader."
201 << std::endl;
202 throw dgtalio;
203 }
BOOST_CONCEPT_ASSERT((concepts::CImage< TContainer >))
Aim: Provide a mechanism to load with the bestloader according to an image (2D or 3D) filename (by pa...

◆ importWithValueFunctor()

template<typename TContainer>
template<typename TFunctor>
TContainer DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >::importWithValueFunctor ( const std::string & filename,
const TFunctor & aFunctor,
unsigned int x = 0,
unsigned int y = 0,
unsigned int z = 0 )
inlinestatic

Import an image file by specifying a value functor (used for gray scale image format: vol, longvol, pgm3D, raw).

Template Parameters
TFunctorThe type of the functor (should verify the concept CUnaryFunctor<TFunctor, unsigned char , TContainer::Value > ).
Parameters
filenamethe image filename to be imported.
aFunctoran ColorRGBEncoder. The type of the functor (should verify the concept CUnaryFunctor<TFunctor, TContainer::Value, DGtal::Color > ).
xspecify the x image size to be used with raw format.
yspecify the y image size to be used with raw format.
zspecify the " image size to be used with raw format.

Definition at line 334 of file GenericReader.h.

338 {
341 const std::string extension = filename.substr( filename.find_last_of(".") + 1 );
342
343 if ( extension == "longvol" )
344 {
346 }
347 else if ( extension == "raw" )
348 {
349 ASSERT( x != 0 && y != 0 && z != 0 );
350 typename TContainer::Point const pt (x, y, z);
352 }
353
354#ifdef DGTAL_WITH_ITK
355 if ( extension == "dcm" )
356 {
358 }
359 else if ( extension == "mha" || extension == "mhd" )
360 {
362 }
363#endif
364
365 trace.error() << "Extension " << extension<< " not yet implemented in DGtal GenericReader." << std::endl;
366 throw dgtalio;
367 }
static ImageContainer importDicom(const std::string &aFilename, const Functor &aFunctor=Functor())
static Image importITK(const std::string &filename, const TFunctor &aFunctor=TFunctor(), bool shiftDomainUsingOrigin=true)
static ImageContainer importLongvol(const std::string &filename, const Functor &aFunctor=Functor())
static ImageContainer importRaw32(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())

References DGtal::GenericReader< TContainer, Tdim, TValue >::BOOST_CONCEPT_ASSERT(), DGtal::DicomReader< TImageContainer, TFunctor >::importDicom(), DGtal::ITKReader< TImage >::importITK(), DGtal::LongvolReader< TImageContainer, TFunctor >::importLongvol(), DGtal::RawReader< TImageContainer, TFunctor >::importRaw32(), and DGtal::trace.


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