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

itk::ExtractImageFilter< TInputImage, TOutputImage > Class Template Reference
[Geometric Transformation Filters]

Decrease the image size by cropping the image to the selected region bounds. More...

#include <itkExtractImageFilter.h>

Inheritance diagram for itk::ExtractImageFilter:

Inheritance graph
[legend]
Collaboration diagram for itk::ExtractImageFilter< TInputImage, TOutputImage >:

Collaboration graph
[legend]
List of all members.

[NOHEADER]

void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, int threadId)
InputImageRegionType m_ExtractionRegion
OutputImageRegionType m_OutputImageRegion

Public Types

typedef ExtractImageFilter Self
typedef ImageToImageFilter<
TInputImage, TOutputImage > 
Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
typedef TOutputImage::RegionType OutputImageRegionType
typedef TInputImage::RegionType InputImageRegionType
typedef TOutputImage::PixelType OutputImagePixelType
typedef TInputImage::PixelType InputImagePixelType
typedef TOutputImage::IndexType OutputImageIndexType
typedef TInputImage::IndexType InputImageIndexType
typedef TOutputImage::SizeType OutputImageSizeType
typedef TInputImage::SizeType InputImageSizeType
typedef ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
itkGetStaticConstMacro(InputImageDimension),
itkGetStaticConstMacro(OutputImageDimension) 
ExtractImageFilterRegionCopierType )

Public Methods

virtual const char * GetClassName () const
virtual void GenerateOutputInformation ()
virtual void CallCopyRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion)
 itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension)
 itkStaticConstMacro (OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
void SetExtractionRegion (InputImageRegionType extractRegion)
virtual InputImageRegionType GetExtractionRegion ()

Static Public Methods

Pointer New ()

Protected Methods

 ExtractImageFilter ()
 ~ExtractImageFilter ()
void PrintSelf (std::ostream &os, Indent indent) const

Detailed Description

template<class TInputImage, class TOutputImage>
class itk::ExtractImageFilter< TInputImage, TOutputImage >

Decrease the image size by cropping the image to the selected region bounds.

ExtractImageFilter changes the image boundary of an image by removing pixels outside the target region. The target region must be specified.

ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2].

The number of dimension in ExtractionRegion.Size and Index must = InputImageDimension. The number of non-zero dimensions in ExtractionRegion.Size must = OutputImageDimension.

This filter is implemented as a multithreaded filter. It provides a ThreadedGenerateData() method for its implementation.

Definition at line 55 of file itkExtractImageFilter.h.


Member Typedef Documentation

template<class TInputImage, class TOutputImage>
typedef SmartPointer<const Self> itk::ExtractImageFilter< TInputImage, TOutputImage >::ConstPointer
 

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 63 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef ImageToImageFilterDetail::ExtractImageFilterRegionCopier<itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) itk::ExtractImageFilter< TInputImage, TOutputImage >::ExtractImageFilterRegionCopierType)
 

Definition at line 94 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TInputImage::IndexType itk::ExtractImageFilter< TInputImage, TOutputImage >::InputImageIndexType
 

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 81 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TInputImage::PixelType itk::ExtractImageFilter< TInputImage, TOutputImage >::InputImagePixelType
 

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 77 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TInputImage::RegionType itk::ExtractImageFilter< TInputImage, TOutputImage >::InputImageRegionType
 

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 73 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TInputImage::SizeType itk::ExtractImageFilter< TInputImage, TOutputImage >::InputImageSizeType
 

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 83 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TOutputImage::IndexType itk::ExtractImageFilter< TInputImage, TOutputImage >::OutputImageIndexType
 

Typedef to describe the output and input image index and size types.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 80 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TOutputImage::PixelType itk::ExtractImageFilter< TInputImage, TOutputImage >::OutputImagePixelType
 

Typedef to describe the type of pixel.

Reimplemented from itk::ImageSource< TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 76 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TOutputImage::RegionType itk::ExtractImageFilter< TInputImage, TOutputImage >::OutputImageRegionType
 

Typedef to describe the output and input image region types.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 72 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef TOutputImage::SizeType itk::ExtractImageFilter< TInputImage, TOutputImage >::OutputImageSizeType
 

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 82 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef SmartPointer<Self> itk::ExtractImageFilter< TInputImage, TOutputImage >::Pointer
 

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 62 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef ExtractImageFilter itk::ExtractImageFilter< TInputImage, TOutputImage >::Self
 

Standard class typedefs.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 60 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
typedef ImageToImageFilter<TInputImage,TOutputImage> itk::ExtractImageFilter< TInputImage, TOutputImage >::Superclass
 

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

Definition at line 61 of file itkExtractImageFilter.h.


Constructor & Destructor Documentation

template<class TInputImage, class TOutputImage>
itk::ExtractImageFilter< TInputImage, TOutputImage >::ExtractImageFilter   [protected]
 

template<class TInputImage, class TOutputImage>
itk::ExtractImageFilter< TInputImage, TOutputImage >::~ExtractImageFilter   [inline, protected]
 

Definition at line 118 of file itkExtractImageFilter.h.


Member Function Documentation

template<class TInputImage, class TOutputImage>
virtual void itk::ExtractImageFilter< TInputImage, TOutputImage >::CallCopyRegion InputImageRegionType   destRegion,
const OutputImageRegionType   srcRegion
[virtual]
 

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 is used by the default implementation of GenerateInputRequestedRegion(). It can also be used in routines like ThreadedGenerateData() where a filter may need to map the the output region for a particular thread 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 call the SetRegionCopier() method passing in a subclass of the ImageToImageDetail::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).

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
virtual void itk::ExtractImageFilter< TInputImage, TOutputImage >::GenerateOutputInformation   [virtual]
 

ExtractImageFilter produces an image which is a different resolution than its input image. As such, ExtractImageFilter needs to provide an implementation for GenerateOutputInformation() in order to inform the pipeline execution model. The original documentation of this method is below.

See also:
ProcessObject::GenerateOutputInformaton()

Reimplemented from itk::ProcessObject.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
virtual const char* itk::ExtractImageFilter< TInputImage, TOutputImage >::GetClassName   const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
virtual InputImageRegionType itk::ExtractImageFilter< TInputImage, TOutputImage >::GetExtractionRegion   [virtual]
 

Set/Get the output image region. If any of the ExtractionRegion.Size = 0 for any particular dimension dim, we have to collapse dimension dim. This means the output image will have 'c' dimensions less than the input image, where c = # of ExtractionRegion.Size = 0.

template<class TInputImage, class TOutputImage>
itk::ExtractImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro OutputImageDimension   ,
unsigned    int,
TOutputImage::ImageDimension   
 

ImageDimension enumeration

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
itk::ExtractImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro InputImageDimension   ,
unsigned    int,
TInputImage::ImageDimension   
 

ImageDimension enumeration

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
Pointer itk::ExtractImageFilter< TInputImage, TOutputImage >::New   [static]
 

Method for creation through the object factory.

Reimplemented from itk::Object.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
void itk::ExtractImageFilter< TInputImage, TOutputImage >::PrintSelf std::ostream &    os,
Indent    indent
const [protected, virtual]
 

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Reimplemented in itk::CropImageFilter< TInputImage, TOutputImage >.

template<class TInputImage, class TOutputImage>
void itk::ExtractImageFilter< TInputImage, TOutputImage >::SetExtractionRegion InputImageRegionType    extractRegion
 

Set/Get the output image region. If any of the ExtractionRegion.Size = 0 for any particular dimension dim, we have to collapse dimension dim. This means the output image will have 'c' dimensions less than the input image, where c = # of ExtractionRegion.Size = 0.

template<class TInputImage, class TOutputImage>
void itk::ExtractImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData const OutputImageRegionType   outputRegionForThread,
int    threadId
[protected, virtual]
 

ExtractImageFilter can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"

See also:
ImageToImageFilter::ThreadedGenerateData(), ImageToImageFilter::GenerateData()

Reimplemented from itk::ImageSource< TOutputImage >.


Member Data Documentation

template<class TInputImage, class TOutputImage>
InputImageRegionType itk::ExtractImageFilter< TInputImage, TOutputImage >::m_ExtractionRegion [protected]
 

ExtractImageFilter can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"

See also:
ImageToImageFilter::ThreadedGenerateData(), ImageToImageFilter::GenerateData()

Definition at line 132 of file itkExtractImageFilter.h.

template<class TInputImage, class TOutputImage>
OutputImageRegionType itk::ExtractImageFilter< TInputImage, TOutputImage >::m_OutputImageRegion [protected]
 

ExtractImageFilter can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"

See also:
ImageToImageFilter::ThreadedGenerateData(), ImageToImageFilter::GenerateData()

Definition at line 133 of file itkExtractImageFilter.h.


The documentation for this class was generated from the following file:
Generated at Fri May 21 01:26:17 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000