28 #ifndef itkImageToImageFilterDetail_h
29 #define itkImageToImageFilterDetail_h
44 namespace ImageToImageFilterDetail
92 template<
unsigned int >
103 template<
bool B1,
bool B2 >
118 template<
int D1,
int D2 >
138 template<
unsigned int D1,
unsigned int D2 >
183 template<
unsigned int D1,
unsigned int D2 >
189 destRegion = srcRegion;
208 template<
unsigned int D1,
unsigned int D2 >
224 for ( dim = 0; dim < D1; ++dim )
226 destIndex[dim] = srcIndex[dim];
227 destSize[dim] = srcSize[dim];
250 template<
unsigned int D1,
unsigned int D2 >
266 for ( dim = 0; dim < D2; ++dim )
268 destIndex[dim] = srcIndex[dim];
269 destSize[dim] = srcSize[dim];
272 for (; dim < D1; ++dim )
320 template<
unsigned int D1,
unsigned int D2 >
328 ImageToImageFilterDefaultCopyRegion< D1, D2 >(
330 destRegion, srcRegion);
338 template<
unsigned int D1,
unsigned int D2 >
342 os <<
"ImageRegionCopier: "
349 template<
unsigned int D1,
unsigned int D2 >
357 template<
unsigned int D1,
unsigned int D2 >
367 template<
unsigned int D1,
unsigned int D2 >
379 const typename SourceImageType::SpacingType &inputSpacing = srcImage->
GetSpacing();
383 typename DestinationImageType::SpacingType destSpacing;
390 for (; i < SourceImageType::ImageDimension; ++i )
392 destSpacing[i] = inputSpacing[i];
393 destOrigin[i] = inputOrigin[i];
394 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; j++ )
396 if ( j < SourceImageType::ImageDimension )
398 destDirection[j][i] = inputDirection[j][i];
402 destDirection[j][i] = 0.0;
406 for (; i < DestinationImageType::ImageDimension; ++i )
408 destSpacing[i] = 1.0;
410 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; j++ )
414 destDirection[j][i] = 1.0;
418 destDirection[j][i] = 0.0;
443 template<
unsigned int D1,
unsigned int D2 >
451 ImageToImageFilterDefaultCopyInformation< D1, D2 >(
453 destImage, srcImage);
bool operator!=(const ImageRegionCopier< D1, D2 > &c1, const ImageRegionCopier< D1, D2 > &c2)
void SetSize(const SizeType &size)
const IndexType & GetIndex() const
IntDispatch< 0 > FirstEqualsSecondType
virtual void CopyInformation(const DataObject *data) override
A Function object used to dispatching to a routine to copy a region (start index and size)...
Represent the size (bounds) of a n-dimensional image.
virtual void SetDirection(const DirectionType &direction)
virtual ~ImageRegionCopier()
virtual void operator()(ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion) const
Templated class to produce a unique type "true" and "false".
An image region represents a structured region of data.
void ImageToImageFilterDefaultCopyInformation(const typename BinaryUnsignedIntDispatch< D1, D2 >::FirstEqualsSecondType &, ImageBase< D1 > *destImage, const ImageBase< D2 > *srcImage)
virtual void SetSpacing(const SpacingType &spacing)
virtual const SpacingType & GetSpacing() const
IntDispatch< (D1 > D2)-(D1< D2) > ComparisonType
ImageBaseType::DirectionType DirectionType
IntDispatch< -1 > FirstLessThanSecondType
virtual void SetNumberOfComponentsPerPixel(unsigned int)
BooleanDispatch< B2 > SecondType
void ImageToImageFilterDefaultCopyRegion(const typename BinaryUnsignedIntDispatch< D1, D2 >::FirstEqualsSecondType &, ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion)
ImageBaseType::PointType PointType
virtual unsigned int GetNumberOfComponentsPerPixel() const
Templated class to produce a unique type for a pairing of booleans.
const SizeType & GetSize() const
BooleanDispatch< B1 > FirstType
Templated class to produce a unique type for a pairing of integers.
UnsignedIntDispatch< D1 > FirstType
Templated class to produce a unique type for each unsigned integer (usually a dimension).
IntDispatch< D2 > SecondType
Base class for templated image classes.
virtual const DirectionType & GetDirection() const
Templated class to produce a unique type for each integer.
Templated class to produce a unique type for a pairing of unsigned integers (usually two dimensions)...
std::ostream & operator<<(std::ostream &os, const ImageRegionCopier< D1, D2 > &)
Represent a n-dimensional index in a n-dimensional image.
void SetIndex(const IndexType &index)
UnsignedIntDispatch< D2 > SecondType
IntDispatch< 1 > FirstGreaterThanSecondType
virtual const PointType & GetOrigin() const
Base class for a class used to dispatch to dimension specific implementations.
IntDispatch< D1 > FirstType
virtual void SetOrigin(PointType _arg)