Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::ImageToImageFilterDetail::ImageRegionCopier< D1, D2 > Class Template Reference

Function object used to dispatching to a routine to copy a region (start index and size). More...

#include <itkImageToImageFilterDetail.h>

Inheritance diagram for itk::ImageToImageFilterDetail::ImageRegionCopier:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual void operator() (ImageRegion< D1 > &destRegion, const ImageRegion< D2 > &srcRegion) const

Detailed Description

template<unsigned int D1, unsigned int D2>
class itk::ImageToImageFilterDetail::ImageRegionCopier< D1, D2 >

Function object used to dispatching to a routine to copy a region (start index and size).

Function object used for dispatching to various routines to copy a region (start index and size). Most filters use this function object as trivial copy because they require the input image dimension to match the output image dimension. However, some filters like itk::ExtractImageFilter can support output images of a lower dimension that the input.

This function object is used by the default implementation of ImageToImageFilter::GenerateInputRequestedRegion(). It can also be used in routines like ImageSource::ThreadedGenerateData() where a filter may need to map the the output region for a particular thread to an input region.

This copier uses a "dispatch pattern" to call one of three overloaded functions depending on whether the source and destination dimensions are the same, the source is of a higher dimension than the destination, or the source is of a lower dimension than the destination. The use of an overloaded function is required for proper compilation of the various cases.

For the latter two cases, trivial implementations are used. If the source dimension is a lower dimension than the destination, the output region information is copied into the first portion of the destination region and the rest of the input region is set to zero. If the source region is a higher dimension than the destination, the first portion of the source region is copied to the destination region.

ImageToImageFilter has an ivar which is a ImageRegionCopier. If a filter needs a different default behavior, it can call the ImageToImageFilter::SetRegionCopier() method passing in a subclass of the ImageToImageFilterDetail::RegionCopier function object. This would typically be done in the constructor of the filter. The ExtractImageFilter overrides this function object so that if the input image is a higher dimension than the output image, the filter can control "where" in the input image the output subimage is extracted (as opposed to mapping to first few dimensions of the input).

Definition at line 322 of file itkImageToImageFilterDetail.h.


Member Function Documentation

template<unsigned int D1, unsigned int D2>
virtual void itk::ImageToImageFilterDetail::ImageRegionCopier< D1, D2 >::operator() ImageRegion< D1 > &    destRegion,
const ImageRegion< D2 > &    srcRegion
const [inline, virtual]
 

Reimplemented in itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier< D1, D2 >.

Definition at line 325 of file itkImageToImageFilterDetail.h.


The documentation for this class was generated from the following file:
Generated at Wed Mar 12 01:22:29 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000