18 #ifndef itkImageAlgorithm_h
19 #define itkImageAlgorithm_h
23 #include <type_traits>
28 template <
typename TPixelType,
unsigned int VImageDimension>
58 while( !it.IsAtEnd() )
60 ot.Set( static_cast< typename TInputImage::PixelType >( it.Get() ) );
66 * \note: It is important not to explicitly pass the
template
67 * arguments to
this method as it may not result in an optimized
68 * method being called.
70 template <
typename InputImageType,
typename OutputImageType>
72 Copy(
const InputImageType * inImage,
73 OutputImageType * outImage,
81 template <
typename TPixel1,
typename TPixel2,
unsigned int VImageDimension>
95 std::is_convertible<typename _ImageType1::PixelType, typename _ImageType2::PixelType>());
98 template <
typename TPixel1,
typename TPixel2,
unsigned int VImageDimension>
100 Copy(
const VectorImage<TPixel1, VImageDimension> * inImage,
101 VectorImage<TPixel2, VImageDimension> * outImage,
105 using _ImageType1 = VectorImage<TPixel1, VImageDimension>;
106 using _ImageType2 = VectorImage<TPixel2, VImageDimension>;
112 std::is_convertible<typename _ImageType1::PixelType, typename _ImageType2::PixelType>());
123 template <
typename InputImageType,
typename OutputImageType>
126 const InputImageType * inputImage,
127 const OutputImageType * outputImage);
129 template <
typename InputImageType,
typename OutputImageType,
typename TransformType>
132 const InputImageType * inputImage,
133 const OutputImageType * outputImage,
134 const TransformType * transform);
141 template <
typename InputImageType,
typename OutputImageType>
144 OutputImageType * outImage,
150 template <
typename InputImageType,
typename OutputImageType>
153 OutputImageType * outImage,
162 template <
typename TImageType>
173 template <
typename TPixelType,
unsigned int VImageDimension>
174 struct PixelSize<VectorImage<TPixelType, VImageDimension>>
178 Get(
const ImageType * i)
180 const size_t vectorLength = ImageType::AccessorFunctorType::GetVectorLength(i);
187 template <
typename TInputType,
typename TOutputType>
193 return static_cast<TOutputType>(i);
200 template <
typename TType>
202 CopyHelper(
const TType * first,
const TType * last, TType * result)
207 return std::copy(first, last, result);
211 template <
typename TInputType,
typename TOutputType>
213 CopyHelper(
const TInputType * first,
const TInputType * last, TOutputType * result)
215 return std::transform(first, last, result, StaticCast<TInputType, TOutputType>());
222 #ifndef ITK_MANUAL_INSTANTIATION
223 # include "itkImageAlgorithm.hxx"
227 #endif // itkImageAlgorithm_h