Import an image file by specifying a value functor (used for gray scale image format: vol, longvol, pgm3D, raw).
249 {
250 BOOST_CONCEPT_ASSERT(( concepts::CUnaryFunctor<TFunctor, unsigned char, typename TContainer::Value > )) ;
252 const std::string extension = filename.substr(filename.find_last_of(".") + 1);
253
254 if ( extension == "vol" )
255 {
257 }
258 else if ( extension == "longvol" )
259 {
261 }
262 else if ( extension == "pgm3d" || extension == "pgm3D" || extension == "p3d" || extension == "pgm" )
263 {
265 }
266 else if ( extension == "raw" )
267 {
268 ASSERT( x != 0 && y != 0 && z != 0 );
269 typename TContainer::Point const pt (x, y, z);
270 return RawReader< TContainer, TFunctor >::template importRaw<TValue>( filename, pt, aFunctor );
271 }
272
273#ifdef WITH_HDF5
274 if ( extension == "h5" )
276#endif
277
278#ifdef WITH_ITK
279 if ( extension == "dcm" )
280 {
282 }
284 {
286 }
287#endif
288
289 trace.
error() <<
"Extension " << extension<<
" in 3D, not yet implemented in DGtal GenericReader." << std::endl;
290 throw dgtalio;
291 }
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())