18 #ifndef __itkImageAlgorithm_h
19 #define __itkImageAlgorithm_h
23 #ifdef ITK_HAS_STLTR1_TR1_TYPE_TRAITS
24 # include <tr1/type_traits>
25 #elif defined ITK_HAS_STLTR1_TYPE_TRAITS
26 # include <type_traits>
34 template <
typename TPixelType,
unsigned int VImageDimension >
class VectorImage;
50 #if defined(ITK_HAS_STLTR1_TR1_TYPE_TRAITS) || defined(ITK_HAS_STLTR1_TYPE_TRAITS)
51 typedef std::tr1::true_type
TrueType;
79 template<
typename InputImageType,
typename OutputImageType>
80 static void Copy(
const InputImageType *inImage, OutputImageType *outImage,
81 const typename InputImageType::RegionType &inRegion,
82 const typename OutputImageType::RegionType &outRegion )
89 template<
class TPixel,
unsigned int VImageDimension>
97 #
if defined(ITK_HAS_STLTR1_TR1_TYPE_TRAITS) || defined(ITK_HAS_STLTR1_TYPE_TRAITS)
98 , std::tr1::is_pod<typename _ImageType::InternalPixelType>()
104 template<
class TPixel,
unsigned int VImageDimension>
105 static void Copy(
const VectorImage<TPixel, VImageDimension> * inImage,
106 VectorImage<TPixel, VImageDimension> * outImage,
107 const typename VectorImage<TPixel, VImageDimension>::RegionType &inRegion,
108 const typename VectorImage<TPixel, VImageDimension>::RegionType &outRegion )
110 typedef Image<TPixel, VImageDimension> _ImageType;
112 #
if defined(ITK_HAS_STLTR1_TR1_TYPE_TRAITS) || defined(ITK_HAS_STLTR1_TYPE_TRAITS)
113 , std::tr1::is_pod<typename _ImageType::InternalPixelType>()
127 template<
typename ImageType>
128 static void DispatchedCopy(
const ImageType *inImage, ImageType *outImage,
129 const typename ImageType::RegionType &inRegion,
130 const typename ImageType::RegionType &outRegion,
TrueType isPod );
133 template<
typename InputImageType,
typename OutputImageType>
134 static void DispatchedCopy(
const InputImageType *inImage, OutputImageType *outImage,
135 const typename InputImageType::RegionType &inRegion,
136 const typename OutputImageType::RegionType &outRegion,
FalseType isPod =
FalseType() );
142 template <
typename TImageType>
145 static size_t Get(
const TImageType *)
147 return sizeof(
typename TImageType::PixelType );
153 template <
typename TPixelType,
unsigned int VImageDimension>
154 struct PixelSize<
VectorImage<TPixelType, VImageDimension> >
157 static size_t Get(
const ImageType * i )
159 const size_t vectorLength = ImageType::AccessorFunctorType::GetVectorLength(i);
160 const size_t componentSize =
sizeof(TPixelType);
161 return vectorLength*componentSize;
172 #include "itkImageAlgorithm.hxx"
176 #endif //__itkImageAlgorithm_h