template<typename TContainer, typename TValue>
struct DGtal::GenericReader< TContainer, 3, TValue >
GenericReader Template partial specialisation for volume images of dimension 3
Definition at line 212 of file GenericReader.h.
template<typename TContainer , typename TValue >
template<typename TFunctor >
static TContainer DGtal::GenericReader< TContainer, 3, TValue >::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
-
TFunctor | The type of the functor (should verify the concept CUnaryFunctor<TFunctor, unsigned char , TContainer::Value > ). |
- Parameters
-
filename | the image filename to be imported. |
aFunctor | an ColorRGBEncoder. The type of the functor (should verify the concept CUnaryFunctor<TFunctor, TContainer::Value, DGtal::Color > ). |
x | x |
y | y |
z | z |
Definition at line 245 of file GenericReader.h.
250 BOOST_CONCEPT_ASSERT(( concepts::CUnaryFunctor<TFunctor, unsigned char, typename TContainer::Value > )) ;
252 const std::string extension = filename.substr(filename.find_last_of(
".") + 1);
254 if ( extension ==
"vol" )
258 else if ( extension ==
"longvol" )
262 else if ( extension ==
"pgm3d" || extension ==
"pgm3D" || extension ==
"p3d" || extension ==
"pgm" )
266 else if ( extension ==
"raw" )
268 ASSERT( x != 0 && y != 0 && z != 0 );
270 return RawReader< TContainer, TFunctor >::template importRaw<TValue>( filename, pt, aFunctor );
274 if ( extension ==
"h5" )
279 if ( extension ==
"dcm" )
289 trace.
error() <<
"Extension " << extension<<
" in 3D, not yet implemented in DGtal GenericReader." << std::endl;
const auto ITK_IO_IMAGE_EXT
static ImageContainer importDicom(const std::string &aFilename, const Functor &aFunctor=Functor())
BOOST_CONCEPT_ASSERT((concepts::CImage< TContainer >))
static ImageContainer importHDF5_3D(const std::string &aFilename, const std::string &aDataset, 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 importPGM3D(const std::string &aFilename, const Functor &aFunctor=Functor())
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
References DGtal::GenericReader< TContainer, Tdim, TValue >::BOOST_CONCEPT_ASSERT(), DGtal::Trace::error(), DGtal::DicomReader< TImageContainer, TFunctor >::importDicom(), DGtal::HDF5Reader< TImageContainer, TFunctor >::importHDF5_3D(), DGtal::ITKReader< TImage >::importITK(), DGtal::LongvolReader< TImageContainer, TFunctor >::importLongvol(), DGtal::PGMReader< TImageContainer, TFunctor >::importPGM3D(), DGtal::VolReader< TImageContainer, TFunctor >::importVol(), DGtal::ITK_IO_IMAGE_EXT, and DGtal::trace.