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
A Function object used to dispatching to a routine to copy a region (start index and size)...
Represent a n-dimensional index in a n-dimensional image.
virtual void SetDirection(const DirectionType &direction)
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
virtual void SetNumberOfComponentsPerPixel(unsigned int)
void ImageToImageFilterDefaultCopyRegion(const typename BinaryUnsignedIntDispatch< D1, D2 >::FirstEqualsSecondType &, ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion)
ImageBaseType::DirectionType DirectionType
virtual unsigned int GetNumberOfComponentsPerPixel() const
Templated class to produce a unique type for a pairing of booleans.
Represent a n-dimensional size (bounds) of a n-dimensional image.
const SizeType & GetSize() const
virtual ~ImageRegionCopier()=default
Templated class to produce a unique type for a pairing of integers.
Templated class to produce a unique type for each unsigned integer (usually a dimension).
Base class for templated image classes.
virtual const DirectionType & GetDirection() const
ImageBaseType::PointType PointType
void CopyInformation(const DataObject *data) override
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 > &)
void SetIndex(const IndexType &index)
virtual const PointType & GetOrigin() const
Base class for a class used to dispatch to dimension specific implementations.
virtual void SetOrigin(PointType _arg)