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>
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>()
126 template<
typename ImageType>
127 static void DispatchedCopy(
const ImageType *inImage, ImageType *outImage,
128 const typename ImageType::RegionType &inRegion,
129 const typename ImageType::RegionType &outRegion,
TrueType isPod );
132 template<
typename InputImageType,
typename OutputImageType>
133 static void DispatchedCopy(
const InputImageType *inImage, OutputImageType *outImage,
134 const typename InputImageType::RegionType &inRegion,
135 const typename OutputImageType::RegionType &outRegion,
FalseType isPod =
FalseType() );
141 template <
typename TImageType>
144 static size_t Get(
const TImageType *)
146 return sizeof(
typename TImageType::PixelType );
152 template <
typename TPixelType,
unsigned int VImageDimension>
153 struct PixelSize<
VectorImage<TPixelType, VImageDimension> >
156 static size_t Get(
const ImageType * i )
158 const size_t vectorLength = ImageType::AccessorFunctorType::GetVectorLength(i);
159 const size_t componentSize =
sizeof(TPixelType);
160 return vectorLength*componentSize;
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkImageAlgorithm.hxx"
175 #endif //__itkImageAlgorithm_h