Package org.itk.simple
Class ResampleImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.ResampleImageFilter
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
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::ResampleImageFilter::ResampleImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
ResampleImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::ResampleImageFilter::~ResampleImageFilter() DestructorImage itk::simple::ResampleImageFilter::Execute(const Image &image1) Execute the filter on the input imageprotected void
finalize()
protected static long
double
double itk::simple::ResampleImageFilter::GetDefaultPixelValue() const Get/Set the pixel value when a transformed pixel is outside of the image.InterpolatorEnum itk::simple::ResampleImageFilter::GetInterpolator() const Get/Set the interpolator function.getName()
std::string itk::simple::ResampleImageFilter::GetName() const Name of this classstd::vector<double> itk::simple::ResampleImageFilter::GetOutputDirection() const Set the output direction cosine matrix.std::vector<double> itk::simple::ResampleImageFilter::GetOutputOrigin() const Get the output image origin.PixelIDValueEnum itk::simple::ResampleImageFilter::GetOutputPixelType() const Get the ouput pixel type.std::vector<double> itk::simple::ResampleImageFilter::GetOutputSpacing() const Get the output image spacing.getSize()
std::vector<uint32_t> itk::simple::ResampleImageFilter::GetSize() const Get/Set the size of the output image.Transform itk::simple::ResampleImageFilter::GetTransform() constboolean
bool itk::simple::ResampleImageFilter::GetUseNearestNeighborExtrapolator() constvoid
setDefaultPixelValue
(double DefaultPixelValue) Self& itk::simple::ResampleImageFilter::SetDefaultPixelValue(double DefaultPixelValue) Get/Set the pixel value when a transformed pixel is outside of the image.void
setInterpolator
(InterpolatorEnum Interpolator) Self& itk::simple::ResampleImageFilter::SetInterpolator(InterpolatorEnum Interpolator) Get/Set the interpolator function.void
setOutputDirection
(VectorDouble OutputDirection) Self& itk::simple::ResampleImageFilter::SetOutputDirection(std::vector< double > OutputDirection) Set the output direction cosine matrix.void
setOutputOrigin
(VectorDouble OutputOrigin) Self& itk::simple::ResampleImageFilter::SetOutputOrigin(std::vector< double > OutputOrigin) Set the output image origin.void
setOutputPixelType
(PixelIDValueEnum OutputPixelType) Self& itk::simple::ResampleImageFilter::SetOutputPixelType(PixelIDValueEnum OutputPixelType) Set the output pixel type, if sitkUnknown then the input type is used.void
setOutputSpacing
(VectorDouble OutputSpacing) Self& itk::simple::ResampleImageFilter::SetOutputSpacing(std::vector< double > OutputSpacing) Set the output image spacing.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 imagevoid
setSize
(VectorUInt32 Size) Self& itk::simple::ResampleImageFilter::SetSize(std::vector< uint32_t > Size) Get/Set the size of the output image.void
setTransform
(Transform Transform) Self& itk::simple::ResampleImageFilter::SetTransform(Transform Transform)void
setUseNearestNeighborExtrapolator
(boolean UseNearestNeighborExtrapolator) Self& itk::simple::ResampleImageFilter::SetUseNearestNeighborExtrapolator(bool UseNearestNeighborExtrapolator) Enables the nearest neighbor extrapolator as opposed to the constant pixel value.protected static long
toString()
std::string itk::simple::ResampleImageFilter::ToString() const Print ourselves outvoid
Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOff()void
Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOn() Set the value of UseNearestNeighborExtrapolator to true or false respectfully.Methods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
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
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::ResampleImageFilter::~ResampleImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setSize
Self& itk::simple::ResampleImageFilter::SetSize(std::vector< uint32_t > Size) Get/Set the size of the output image. -
getSize
std::vector<uint32_t> itk::simple::ResampleImageFilter::GetSize() const Get/Set the size of the output image. -
setTransform
Self& itk::simple::ResampleImageFilter::SetTransform(Transform Transform) -
getTransform
Transform itk::simple::ResampleImageFilter::GetTransform() const -
setInterpolator
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
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
Self& itk::simple::ResampleImageFilter::SetOutputOrigin(std::vector< double > OutputOrigin) Set the output image origin. -
getOutputOrigin
std::vector<double> itk::simple::ResampleImageFilter::GetOutputOrigin() const Get the output image origin. -
setOutputSpacing
Self& itk::simple::ResampleImageFilter::SetOutputSpacing(std::vector< double > OutputSpacing) Set the output image spacing. -
getOutputSpacing
std::vector<double> itk::simple::ResampleImageFilter::GetOutputSpacing() const Get the output image spacing. -
setOutputDirection
Self& itk::simple::ResampleImageFilter::SetOutputDirection(std::vector< double > OutputDirection) Set the output direction cosine matrix. -
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
Self& itk::simple::ResampleImageFilter::SetOutputPixelType(PixelIDValueEnum OutputPixelType) Set the output pixel type, if sitkUnknown then the input type is used. -
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
std::string itk::simple::ResampleImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::ResampleImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::ResampleImageFilter::Execute(const Image &image1) Execute the filter on the input image -
setReferenceImage
void itk::simple::ResampleImageFilter::SetReferenceImage(const Image &refImage) This methods sets the output size, origin, spacing and direction to that of the provided image
-