28#ifndef itkImageToImageFilterDetail_h
29#define itkImageToImageFilterDetail_h
44namespace ImageToImageFilterDetail
92template <
unsigned int>
102template <
bool B1,
bool B2>
116template <
int D1,
int D2>
135template <
unsigned int D1,
unsigned int D2>
180template <
unsigned int D1,
unsigned int D2>
186 destRegion = srcRegion;
205template <
unsigned int D1,
unsigned int D2>
221 for (dim = 0; dim < D1; ++dim)
223 destIndex[dim] = srcIndex[dim];
224 destSize[dim] = srcSize[dim];
247template <
unsigned int D1,
unsigned int D2>
263 for (dim = 0; dim < D2; ++dim)
265 destIndex[dim] = srcIndex[dim];
266 destSize[dim] = srcSize[dim];
269 for (; dim < D1; ++dim)
317template <
unsigned int D1,
unsigned int D2>
325 ImageToImageFilterDefaultCopyRegion<D1, D2>(ComparisonType(), destRegion, srcRegion);
333template <
unsigned int D1,
unsigned int D2>
343template <
unsigned int D1,
unsigned int D2>
351template <
unsigned int D1,
unsigned int D2>
361template <
unsigned int D1,
unsigned int D2>
373 const typename SourceImageType::SpacingType & inputSpacing = srcImage->
GetSpacing();
377 typename DestinationImageType::SpacingType destSpacing;
384 for (; i < SourceImageType::ImageDimension; ++i)
386 destSpacing[i] = inputSpacing[i];
387 destOrigin[i] = inputOrigin[i];
388 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; ++j)
390 if (j < SourceImageType::ImageDimension)
392 destDirection[j][i] = inputDirection[j][i];
396 destDirection[j][i] = 0.0;
400 for (; i < DestinationImageType::ImageDimension; ++i)
402 destSpacing[i] = 1.0;
404 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; ++j)
408 destDirection[j][i] = 1.0;
412 destDirection[j][i] = 0.0;
437template <
unsigned int D1,
unsigned int D2>
445 ImageToImageFilterDefaultCopyInformation<D1, D2>(ComparisonType(), destImage, srcImage);
Base class for templated image classes.
virtual const SpacingType & GetSpacing() const
virtual void SetDirection(const DirectionType &direction)
virtual const DirectionType & GetDirection() const
virtual const PointType & GetOrigin() const
virtual void SetSpacing(const SpacingType &spacing)
virtual void SetNumberOfComponentsPerPixel(unsigned int)
virtual void SetOrigin(PointType _arg)
virtual unsigned int GetNumberOfComponentsPerPixel() const
void CopyInformation(const DataObject *data) override
An image region represents a structured region of data.
void SetSize(const SizeType &size)
const IndexType & GetIndex() const
void SetIndex(const IndexType &index)
const SizeType & GetSize() const
A Function object used to dispatching to a routine to copy a region (start index and size).
virtual void operator()(ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion) const
virtual ~ImageRegionCopier()=default
ImageBaseType::DirectionType DirectionType
ImageBaseType::PointType PointType
void ImageToImageFilterDefaultCopyInformation(const typename BinaryUnsignedIntDispatch< D1, D2 >::FirstEqualsSecondType &, ImageBase< D1 > *destImage, const ImageBase< D2 > *srcImage)
void ImageToImageFilterDefaultCopyRegion(const typename BinaryUnsignedIntDispatch< D1, D2 >::FirstEqualsSecondType &, ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion)
bool operator!=(const ImageRegionCopier< D1, D2 > &c1, const ImageRegionCopier< D1, D2 > &c2)
std::ostream & operator<<(std::ostream &os, const ImageRegionCopier< D1, D2 > &)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Templated class to produce a unique type for a pairing of booleans.
Templated class to produce a unique type for a pairing of integers.
Templated class to produce a unique type for a pairing of unsigned integers (usually two dimensions).
Templated class to produce a unique type "true" and "false".
Base class for a class used to dispatch to dimension specific implementations.
Templated class to produce a unique type for each integer.
Templated class to produce a unique type for each unsigned integer (usually a dimension).
Represent a n-dimensional index in a n-dimensional image.
Represent a n-dimensional size (bounds) of a n-dimensional image.