35#if defined(ITKReader_RECURSES)
36#error Recursive header files inclusion detected in ITKReader.h
39#define ITKReader_RECURSES
41#if !defined ITKReader_h
45#include "DGtal/base/Common.h"
46#include "DGtal/base/CUnaryFunctor.h"
47#include "DGtal/images/CImage.h"
48#include "DGtal/base/BasicFunctors.h"
49#include "DGtal/io/ITKIOTrait.h"
50#include "DGtal/images/ImageContainerByITKImage.h"
52#pragma GCC diagnostic push
53#pragma GCC diagnostic ignored "-Wpedantic"
56#pragma clang diagnostic push
57#pragma clang diagnostic ignored "-Wdocumentation"
59#include <itkImageFileReader.h>
61#pragma clang diagnostic pop
64#pragma GCC diagnostic pop
78 template <
typename TImage>
82 typedef typename TImage::Value
Value;
86 BOOST_STATIC_ASSERT(( (TImage::Domain::dimension == 3)
87 || (TImage::Domain::dimension == 2) ));
104 template <
typename TFunctor =
107 const std::string & filename,
108 const TFunctor & aFunctor = TFunctor(),
bool shiftDomainUsingOrigin=
true);
122 static Image importITK(
const std::string & filename,
bool shiftDomainUsingOrigin);
132 static itk::ImageIOBase::IOComponentType
137 template <
typename Domain,
typename PixelType>
142 template <
typename Image,
typename Domain,
typename OrigValue,
143 typename TFunctor,
typename Value>
148 const TFunctor & aFunctor,
bool shiftDomainUsingOrigin=
true);
152 template <
typename Domain,
typename OrigValue,
typename TFunctor,
159 const TFunctor & aFunctor,
bool shiftDomainUsingOrigin=
true);
174 template <
typename TypeDGtalImage,
typename TFunctor>
176 const std::string & filename,
177 const TFunctor & aFunctor,
bool shiftDomainUsingOrigin=
true);
183#include "DGtal/io/readers/ITKReader.ih"
190#undef ITKReader_RECURSES
Aim: implements a model of CImageContainer using a ITK Image.
DGtal is the top-level namespace which contains all DGtal functions and types.
static ImageContainerByITKImage< Domain, Value > readDGtalImageFromITKtypes(const std::string &filename, const TFunctor &aFunctor, bool shiftDomainUsingOrigin=true)
static Image readDGtalImageFromITKtypes(const std::string &filename, const TFunctor &aFunctor, bool shiftDomainUsingOrigin=true)
Aim: Import a 2D/3D Image using the ITK formats.
static Image importITK(const std::string &filename, const TFunctor &aFunctor=TFunctor(), bool shiftDomainUsingOrigin=true)
ITKIOTrait< Value >::ValueOut ValueOut
static Image readDGtalImageFromITKtypes(const std::string &filename, const TFunctor &aFunctor, bool shiftDomainUsingOrigin=true)
static itk::ImageIOBase::IOComponentType getITKComponentType(const std::string &filename)
static Image importITK(const std::string &filename, bool shiftDomainUsingOrigin)
BOOST_CONCEPT_ASSERT((concepts::CImage< TImage >))
static ImageContainerByITKImage< Domain, PixelType > readDGtalITKImage(const std::string &filename, bool shiftDomainUsingOrigin=true)
Aim: Defines the concept describing a read/write image, having an output iterator.
Aim: Define a simple functor using the static cast operator.
HyperRectDomain< Space > Domain