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 (
unsigned int dim = 0; dim < D1; ++dim)
223 destIndex[dim] = srcIndex[dim];
224 destSize[dim] = srcSize[dim];
247template <
unsigned int D1,
unsigned int D2>
263 unsigned int dim = 0;
264 for (; dim < D2; ++dim)
266 destIndex[dim] = srcIndex[dim];
267 destSize[dim] = srcSize[dim];
270 for (; dim < D1; ++dim)
318template <
unsigned int D1,
unsigned int D2>
326 ImageToImageFilterDefaultCopyRegion<D1, D2>(ComparisonType(), destRegion, srcRegion);
334template <
unsigned int D1,
unsigned int D2>
344template <
unsigned int D1,
unsigned int D2>
352template <
unsigned int D1,
unsigned int D2>
362template <
unsigned int D1,
unsigned int D2>
374 const typename SourceImageType::SpacingType & inputSpacing = srcImage->
GetSpacing();
378 typename DestinationImageType::SpacingType destSpacing;
385 for (; i < SourceImageType::ImageDimension; ++i)
387 destSpacing[i] = inputSpacing[i];
388 destOrigin[i] = inputOrigin[i];
389 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; ++j)
391 if (j < SourceImageType::ImageDimension)
393 destDirection[j][i] = inputDirection[j][i];
397 destDirection[j][i] = 0.0;
401 for (; i < DestinationImageType::ImageDimension; ++i)
403 destSpacing[i] = 1.0;
405 for (
unsigned int j = 0; j < DestinationImageType::ImageDimension; ++j)
409 destDirection[j][i] = 1.0;
413 destDirection[j][i] = 0.0;
438template <
unsigned int D1,
unsigned int D2>
446 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.