#include <itkImageToImageFilter.h>
Inheritance diagram for itk::ImageToImageFilter< TInputImage, TOutputImage >:
Public Types | |
typedef ImageToImageFilter | Self |
typedef ImageSource< TOutputImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::OutputImageRegionType | OutputImageRegionType |
typedef TInputImage | InputImageType |
typedef InputImageType::Pointer | InputImagePointer |
typedef InputImageType::ConstPointer | InputImageConstPointer |
typedef InputImageType::RegionType | InputImageRegionType |
typedef InputImageType::PixelType | InputImagePixelType |
Public Member Functions | |
virtual const char * | GetNameOfClass () const |
itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension) | |
itkStaticConstMacro (OutputImageDimension, unsigned int, TOutputImage::ImageDimension) | |
virtual void | SetInput (const InputImageType *image) |
virtual void | SetInput (unsigned int, const TInputImage *image) |
const InputImageType * | GetInput (void) |
const InputImageType * | GetInput (unsigned int idx) |
Protected Types | |
typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) | InputToOutputRegionCopierType ) |
typedef ImageToImageFilterDetail::ImageRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) | OutputToInputRegionCopierType ) |
Protected Member Functions | |
ImageToImageFilter () | |
~ImageToImageFilter () | |
virtual void | PrintSelf (std::ostream &os, Indent indent) const |
virtual void | GenerateInputRequestedRegion () |
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
ImageToImageFilter is the base class for all process objects that output image data and require image data as input. Specifically, this class defines the SetInput() method for defining the input to a filter.
This class provides the infrastructure for supporting multithreaded processing of images. If a filter provides an implementation of GenerateData(), the image processing will run in a single thread and the implementation is responsible for allocating its output data. If a filter provides an implementation of ThreadedGenerateData() instead, the image will be divided into a number of pieces, a number of threads will be spawned, and ThreadedGenerateData() will be called in each thread. Here, the output memory will be allocated by this superclass prior to calling ThreadedGenerateData().
ImageToImageFilter provides an implementation of GenerateInputRequestedRegion(). The base assumption to this point in the heirarchy is that a process object would ask for the largest possible region on input in order to produce any output. Imaging filters, however, can usually answer this question more precisely. The default implementation of GenerateInputRequestedRegion() in this class is to request an input that matches the size of the requested output. If a filter requires more input (say a filter that uses neighborhood information) or less input (for instance a magnify filter), then these filters will have to provide another implmentation of this method. By convention, such implementations should call the Superclass' method first.
Definition at line 64 of file itkImageToImageFilter.h.
|
|
|
|
|
|
|
Typedef for the region copier function object that converts an input region to an output region. Definition at line 138 of file itkImageToImageFilter.h. |
|
|
Typedef for the region copier function object that converts an output region to an input region. Definition at line 143 of file itkImageToImageFilter.h. |
|
|
|
|
|
|
|
|
This function calls the actual region copier to do the mapping from input image space to output image space. It uses a Function object used for dispatching to various routines to copy an input region (start index and size) to an output region. For most filters, this is a trivial copy because most filters require the input dimension to match the output dimension. However, some filters like itk::UnaryFunctorImageFilter can support output images of a higher dimension that the input. This function object is used by the default implementation of GenerateOutputInformation(). It can also be used in routines like ThreadedGenerateData() where a filter may need to map an input region to an output region. The default copier uses a "dispatch pattern" to call one of three overloaded functions depending on whether the input and output images are the same dimension, the input is a higher dimension that the output, or the input is of a lower dimension than the output. 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 input image is a higher dimension than the output, the first portion of the input region is copied to the output region. If the input region is a lower dimension than the output, the input region information is copied into the first portion of the output region and the rest of the output region is set to zero. If a filter needs a different default behavior, it can override this method. |
|
This function calls the actual region copier to do the mapping from output image space to input image space. It uses a Function object used for dispatching to various routines to copy an output region (start index and size) to an input region. For most filters, this is a trivial copy because most filters require the input dimension to match the output dimension. However, some filters like itk::ExtractImageFilter can support output images of a lower dimension that the input. This function object can be used by GenerateOutputInformation() to copy the input LargestPossibleRegion to the output LargestPossibleRegion and can also be used in GenerateData or ThreadedGenerateData() where a filter may need to map an output region to an input region. The default copier uses a "dispatch pattern" to call one of three overloaded functions depending on whether the input and output images are the same dimension, the input is a higher dimension that the output, or the input is of a lower dimension than the output. 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 input image is a higher dimension than the output, the output region information is copied into the first portion of the input region and the rest of the input region is set to zero. If the input region is a lower dimension than the output, the first portion of the output region is copied to the input region. If a filter needs a different default behavior, it can override this method. 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). Reimplemented in itk::ExtractImageFilter< TInputImage, TOutputImage >. |
|
|
Set/Get the image input of this process object. Reimplemented from itk::ProcessObject. |
|
Set/Get the image input of this process object. |
|
|
|
|
|
Set/Get the image input of this process object. Reimplemented in itk::WatershedImageFilter< TInputImage >. |
|
Set/Get the image input of this process object. Reimplemented in itk::VoronoiSegmentationRGBImageFilter< TInputImage, TOutputImage >, and itk::WatershedImageFilter< TInputImage >. |