Class ResampleImageFilter


public class ResampleImageFilter extends ImageFilter
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 DynamicThreadedGenerateData() method for its implementation. WARNING: For multithreading, the TransformPoint method of the user-designated coordinate transform must be threadsafe. See: itk::ResampleImageFilter for the Doxygen on the original ITK class. C++ includes: sitkResampleImageFilter.h
  • Constructor Details

    • ResampleImageFilter

      protected ResampleImageFilter(long cPtr, boolean cMemoryOwn)
    • ResampleImageFilter

      public ResampleImageFilter()
      itk::simple::ResampleImageFilter::ResampleImageFilter() Default Constructor that takes no arguments and initializes default parameters
  • Method Details

    • getCPtr

      protected static long getCPtr(ResampleImageFilter obj)
    • swigRelease

      protected static long swigRelease(ResampleImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::ResampleImageFilter::~ResampleImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • setSize

      public void setSize(VectorUInt32 Size)
      Self& itk::simple::ResampleImageFilter::SetSize(std::vector< uint32_t > Size) Get/Set the size of the output image.
    • getSize

      public VectorUInt32 getSize()
      std::vector<uint32_t> itk::simple::ResampleImageFilter::GetSize() const Get/Set the size of the output image.
    • setTransform

      public void setTransform(Transform Transform)
      Self& itk::simple::ResampleImageFilter::SetTransform(Transform Transform)
    • getTransform

      public Transform getTransform()
      Transform itk::simple::ResampleImageFilter::GetTransform() const
    • setInterpolator

      public void setInterpolator(InterpolatorEnum Interpolator)
      Self& itk::simple::ResampleImageFilter::SetInterpolator(InterpolatorEnum Interpolator) Get/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).
    • getInterpolator

      public InterpolatorEnum getInterpolator()
      InterpolatorEnum itk::simple::ResampleImageFilter::GetInterpolator() const Get/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).
    • setOutputOrigin

      public void setOutputOrigin(VectorDouble OutputOrigin)
      Self& itk::simple::ResampleImageFilter::SetOutputOrigin(std::vector< double > OutputOrigin) Set the output image origin.
    • getOutputOrigin

      public VectorDouble getOutputOrigin()
      std::vector<double> itk::simple::ResampleImageFilter::GetOutputOrigin() const Get the output image origin.
    • setOutputSpacing

      public void setOutputSpacing(VectorDouble OutputSpacing)
      Self& itk::simple::ResampleImageFilter::SetOutputSpacing(std::vector< double > OutputSpacing) Set the output image spacing.
    • getOutputSpacing

      public VectorDouble getOutputSpacing()
      std::vector<double> itk::simple::ResampleImageFilter::GetOutputSpacing() const Get the output image spacing.
    • setOutputDirection

      public void setOutputDirection(VectorDouble OutputDirection)
      Self& itk::simple::ResampleImageFilter::SetOutputDirection(std::vector< double > OutputDirection) Set the output direction cosine matrix.
    • getOutputDirection

      public VectorDouble getOutputDirection()
      std::vector<double> itk::simple::ResampleImageFilter::GetOutputDirection() const Set the output direction cosine matrix.
    • setDefaultPixelValue

      public void setDefaultPixelValue(double DefaultPixelValue)
      Self& itk::simple::ResampleImageFilter::SetDefaultPixelValue(double DefaultPixelValue) Get/Set the pixel value when a transformed pixel is outside of the image. The default default pixel value is 0.
    • getDefaultPixelValue

      public double getDefaultPixelValue()
      double itk::simple::ResampleImageFilter::GetDefaultPixelValue() const Get/Set the pixel value when a transformed pixel is outside of the image. The default default pixel value is 0.
    • setOutputPixelType

      public void setOutputPixelType(PixelIDValueEnum OutputPixelType)
      Self& itk::simple::ResampleImageFilter::SetOutputPixelType(PixelIDValueEnum OutputPixelType) Set the output pixel type, if sitkUnknown then the input type is used.
    • getOutputPixelType

      public PixelIDValueEnum getOutputPixelType()
      PixelIDValueEnum itk::simple::ResampleImageFilter::GetOutputPixelType() const Get the ouput pixel type.
    • setUseNearestNeighborExtrapolator

      public void setUseNearestNeighborExtrapolator(boolean UseNearestNeighborExtrapolator)
      Self& itk::simple::ResampleImageFilter::SetUseNearestNeighborExtrapolator(bool UseNearestNeighborExtrapolator) Enables the nearest neighbor extrapolator as opposed to the constant pixel value.
    • useNearestNeighborExtrapolatorOn

      public void useNearestNeighborExtrapolatorOn()
      Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOn() Set the value of UseNearestNeighborExtrapolator to true or false respectfully.
    • useNearestNeighborExtrapolatorOff

      public void useNearestNeighborExtrapolatorOff()
      Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOff()
    • getUseNearestNeighborExtrapolator

      public boolean getUseNearestNeighborExtrapolator()
      bool itk::simple::ResampleImageFilter::GetUseNearestNeighborExtrapolator() const
    • getName

      public String getName()
      std::string itk::simple::ResampleImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::ResampleImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public Image execute(Image image1)
      Image itk::simple::ResampleImageFilter::Execute(const Image &image1) Execute the filter on the input image
    • setReferenceImage

      public void setReferenceImage(Image refImage)
      void itk::simple::ResampleImageFilter::SetReferenceImage(const Image &refImage) This methods sets the output size, origin, spacing and direction to that of the provided image