ITK
4.3.0
Insight Segmentation and Registration Toolkit
|
#include <itkResampleImageFilter.h>
Resample an image via a coordinate transform.
ResampleImageFilter resamples an existing image through some coordinate transform, interpolating via some image function. The class is templated over the types of the input and output images.
Note that the choice of interpolator function can be important. This function is set via SetInterpolator(). The default is LinearInterpolateImageFunction<InputImageType, TInterpolatorPrecisionType>, which is reasonable for ordinary medical images. However, some synthetic images have pixels drawn from a finite prescribed set. An example would be a mask indicating the segmentation of a brain into a small number of tissue types. For such an image, one does not want to interpolate between different pixel values, and so NearestNeighborInterpolateImageFunction< InputImageType, TCoordRep > would be a better choice.
If an sample is taken from outside the image domain, the default behavior is to use a default pixel value. If different behavior is desired, an extrapolator function can be set with SetExtrapolator().
Output information (spacing, size and direction) for the output image should be set. This information has the normal defaults of unit spacing, zero origin and identity direction. Optionally, the output information can be obtained from a reference image. If the reference image is provided and UseReferenceImage is On, then the spacing, origin and direction of the reference image will be used.
Since this filter produces an image which is a different size than its input, it needs to override several of the methods defined in ProcessObject in order to properly manage the pipeline execution model. In particular, this filter overrides ProcessObject::GenerateInputRequestedRegion() and ProcessObject::GenerateOutputInformation().
This filter is implemented as a multithreaded filter. It provides a ThreadedGenerateData() method for its implementation.
Definition at line 86 of file itkResampleImageFilter.h.
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | ImageDimension = TOutputImage::ImageDimension |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Private Member Functions | |
void | operator= (const Self &) |
ResampleImageFilter (const Self &) | |
Additional Inherited Members | |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) > | InputToOutputRegionCopierType |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | OutputToInputRegionCopierType |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
typedef InterpolatorConvertType::ComponentType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ComponentType |
Definition at line 137 of file itkResampleImageFilter.h.
typedef SmartPointer< const Self > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ConstPointer |
Definition at line 94 of file itkResampleImageFilter.h.
typedef ContinuousIndex< TInterpolatorPrecisionType, ImageDimension > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ContinuousInputIndexType |
Input pixel continuous index typdef
Definition at line 169 of file itkResampleImageFilter.h.
typedef TOutputImage::DirectionType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::DirectionType |
Definition at line 177 of file itkResampleImageFilter.h.
typedef ExtrapolatorType::Pointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ExtrapolatorPointerType |
Definition at line 147 of file itkResampleImageFilter.h.
typedef ExtrapolateImageFunction< InputImageType, TInterpolatorPrecisionType > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ExtrapolatorType |
Extrapolator typedef.
Definition at line 146 of file itkResampleImageFilter.h.
typedef ImageBase< itkGetStaticConstMacro(ImageDimension) > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::ImageBaseType |
base type for images of the current ImageDimension
Definition at line 117 of file itkResampleImageFilter.h.
typedef TOutputImage::IndexType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::IndexType |
Image index typedef.
Definition at line 153 of file itkResampleImageFilter.h.
typedef InputImageType::ConstPointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InputImageConstPointer |
Definition at line 99 of file itkResampleImageFilter.h.
typedef InputImageType::Pointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InputImagePointer |
Definition at line 98 of file itkResampleImageFilter.h.
typedef InputImageType::RegionType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InputImageRegionType |
Definition at line 101 of file itkResampleImageFilter.h.
typedef TInputImage itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InputImageType |
Definition at line 96 of file itkResampleImageFilter.h.
typedef TInputImage::PixelType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InputPixelType |
Definition at line 161 of file itkResampleImageFilter.h.
typedef DefaultConvertPixelTraits< InterpolatorOutputType > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InterpolatorConvertType |
Definition at line 135 of file itkResampleImageFilter.h.
typedef InterpolatorType::OutputType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InterpolatorOutputType |
Definition at line 133 of file itkResampleImageFilter.h.
typedef InterpolatorType::Pointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InterpolatorPointerType |
Definition at line 131 of file itkResampleImageFilter.h.
typedef InterpolateImageFunction< InputImageType, TInterpolatorPrecisionType > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::InterpolatorType |
Interpolator typedef.
Definition at line 130 of file itkResampleImageFilter.h.
typedef LinearInterpolatorType::Pointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::LinearInterpolatorPointerType |
Definition at line 142 of file itkResampleImageFilter.h.
typedef LinearInterpolateImageFunction< InputImageType, TInterpolatorPrecisionType > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::LinearInterpolatorType |
Definition at line 140 of file itkResampleImageFilter.h.
typedef TOutputImage::PointType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::OriginPointType |
Definition at line 176 of file itkResampleImageFilter.h.
typedef OutputImageType::Pointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::OutputImagePointer |
Definition at line 100 of file itkResampleImageFilter.h.
typedef TOutputImage::RegionType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::OutputImageRegionType |
Typedef to describe the output image region type.
Definition at line 172 of file itkResampleImageFilter.h.
typedef TOutputImage itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::OutputImageType |
Definition at line 97 of file itkResampleImageFilter.h.
typedef PixelConvertType::ComponentType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::PixelComponentType |
Definition at line 165 of file itkResampleImageFilter.h.
typedef DefaultConvertPixelTraits<PixelType> itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::PixelConvertType |
Definition at line 163 of file itkResampleImageFilter.h.
typedef TOutputImage::PixelType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::PixelType |
Image pixel value typedef.
Definition at line 160 of file itkResampleImageFilter.h.
typedef SmartPointer< Self > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::Pointer |
Definition at line 93 of file itkResampleImageFilter.h.
typedef InterpolatorType::PointType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::PointType |
Image point typedef.
Definition at line 156 of file itkResampleImageFilter.h.
typedef ResampleImageFilter itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::Self |
Standard class typedefs.
Definition at line 91 of file itkResampleImageFilter.h.
typedef Size< itkGetStaticConstMacro(ImageDimension) > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::SizeType |
Image size typedef.
Definition at line 150 of file itkResampleImageFilter.h.
typedef TOutputImage::SpacingType itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::SpacingType |
Image spacing,origin and direction typedef
Definition at line 175 of file itkResampleImageFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::Superclass |
Definition at line 92 of file itkResampleImageFilter.h.
typedef TransformType::ConstPointer itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::TransformPointerType |
Transform typedef.
Definition at line 125 of file itkResampleImageFilter.h.
typedef Transform< TInterpolatorPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::TransformType |
Transform typedef.
Definition at line 124 of file itkResampleImageFilter.h.
|
protected |
End concept checking
|
inlineprotected |
Definition at line 303 of file itkResampleImageFilter.h.
|
private |
|
virtual |
This method is used to set the state of the filter after multi-threading.
Reimplemented from itk::ImageSource< TOutputImage >.
|
virtual |
This method is used to set the state of the filter before multi-threading.
Reimplemented from itk::ImageSource< TOutputImage >.
|
protectedvirtual |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
virtual |
ResampleImageFilter needs a different input requested region than the output requested region. As such, ResampleImageFilter needs to provide an implementation for GenerateInputRequestedRegion() in order to inform the pipeline execution model.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
ResampleImageFilter produces an image which is a different size than its input. As such, it needs to provide an implementation for GenerateOutputInformation() in order to inform the pipeline execution model. The original documentation of this method is below.
Reimplemented from itk::ProcessObject.
|
virtual |
Get the pixel value when a transformed pixel is outside of the image
|
virtual |
Get a pointer to the extrapolator function.
|
virtual |
Get a pointer to the interpolator function.
|
virtual |
Method Compute the Modified Time based on changed to the components.
Reimplemented from itk::Object.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set the output direciton cosine matrix.
|
virtual |
Get the output image origin.
|
virtual |
Get the output image spacing.
|
virtual |
Get the start index of the output largest possible region.
const TOutputImage* itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::GetReferenceImage | ( | ) | const |
|
virtual |
Get the size of the output image.
|
virtual |
Get a pointer to the coordinate transform.
|
virtual |
|
protectedvirtual |
Implementation for resampling that works for with linear transformation types.
|
static |
Method for creation through the object factory.
|
protectedvirtual |
Default implementation for resampling that works for any transformation type.
|
private |
|
protectedvirtual |
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 >.
|
virtual |
Set the pixel value when a transformed pixel is outside of the image. The default default pixel value is 0.
|
virtual |
Set the extrapolator function. The default behavior when sampling outside of the input image is to use the DefaultPixelValue. Some other options include NearestNeighborExtrapolateImageFunction.
|
virtual |
Set the interpolator function. The default is LinearInterpolateImageFunction<InputImageType, TInterpolatorPrecisionType>. Some other options are NearestNeighborInterpolateImageFunction (useful for binary masks and other images with a small number of possible pixel values), and BSplineInterpolateImageFunction (which provides a higher order of interpolation).
|
virtual |
Set the output direciton cosine matrix.
|
virtual |
Set the output image origin.
|
virtual |
Set the output image origin.
void itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::SetOutputParametersFromImage | ( | const ImageBaseType * | image | ) |
Helper method to set the output parameters based on this image
|
virtual |
Set the output image spacing.
|
virtual |
Set the output image spacing.
|
virtual |
Set the start index of the output largest possible region. The default is an index of all zeros.
void itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::SetReferenceImage | ( | const TOutputImage * | image | ) |
Copy the output information from another Image. By default, the information is specified with the SetOutputSpacing, Origin, and Direction methods. UseReferenceImage must be On and a Reference image must be present to override the defaul behavior.
|
virtual |
Set the size of the output image.
|
virtual |
Set the coordinate transformation. Set the coordinate transform to use for resampling. Note that this must be in physical coordinates and it is the output-to-input transform, NOT the input-to-output transform that you might naively expect. By default the filter uses an Identity transform. You must provide a different transform here, before attempting to run the filter, if you do not want to use the default Identity transform.
|
virtual |
|
protectedvirtual |
ResampleImageFilter 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"
Reimplemented from itk::ImageSource< TOutputImage >.
itk::ResampleImageFilter< TInputImage, TOutputImage, TInterpolatorPrecisionType >::typedef | ( | Concept::HasNumericTraits< PixelComponentType > | ) |
Begin concept checking This class requires OutputHasNumericTraitsCheck in the form of ( Concept::HasNumericTraits< PixelComponentType > )
|
virtual |
|
virtual |
|
inlineprotectedvirtual |
Override VeriyInputInformation() since this filter's inputs do not need to occoupy the same physical space.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 312 of file itkResampleImageFilter.h.
|
static |
Number of dimensions.
Definition at line 111 of file itkResampleImageFilter.h.
|
static |
Number of dimensions.
Definition at line 113 of file itkResampleImageFilter.h.
|
private |
Definition at line 353 of file itkResampleImageFilter.h.
|
private |
Definition at line 351 of file itkResampleImageFilter.h.
|
private |
Definition at line 349 of file itkResampleImageFilter.h.
|
private |
Definition at line 358 of file itkResampleImageFilter.h.
|
private |
Definition at line 357 of file itkResampleImageFilter.h.
|
private |
Definition at line 356 of file itkResampleImageFilter.h.
|
private |
Definition at line 359 of file itkResampleImageFilter.h.
|
private |
Definition at line 347 of file itkResampleImageFilter.h.
|
private |
Definition at line 348 of file itkResampleImageFilter.h.
|
private |
Definition at line 360 of file itkResampleImageFilter.h.