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 SummaryFields inherited from class org.itk.simple.ProcessObjectswigCMemOwn
- 
Constructor SummaryConstructorsModifierConstructorDescriptionitk::simple::ResampleImageFilter::ResampleImageFilter() Default Constructor that takes no arguments and initializes default parametersprotectedResampleImageFilter(long cPtr, boolean cMemoryOwn) 
- 
Method SummaryModifier and TypeMethodDescriptionvoiddelete()virtual itk::simple::ResampleImageFilter::~ResampleImageFilter() DestructorImage itk::simple::ResampleImageFilter::Execute(const Image &image1) Execute the filter on the input imageprotected voidfinalize()protected static longdoubledouble 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() constbooleanbool itk::simple::ResampleImageFilter::GetUseNearestNeighborExtrapolator() constvoidsetDefaultPixelValue(double DefaultPixelValue) Self& itk::simple::ResampleImageFilter::SetDefaultPixelValue(double DefaultPixelValue) Get/Set the pixel value when a transformed pixel is outside of the image.voidsetInterpolator(InterpolatorEnum Interpolator) Self& itk::simple::ResampleImageFilter::SetInterpolator(InterpolatorEnum Interpolator) Get/Set the interpolator function.voidsetOutputDirection(VectorDouble OutputDirection) Self& itk::simple::ResampleImageFilter::SetOutputDirection(std::vector< double > OutputDirection) Set the output direction cosine matrix.voidsetOutputOrigin(VectorDouble OutputOrigin) Self& itk::simple::ResampleImageFilter::SetOutputOrigin(std::vector< double > OutputOrigin) Set the output image origin.voidsetOutputPixelType(PixelIDValueEnum OutputPixelType) Self& itk::simple::ResampleImageFilter::SetOutputPixelType(PixelIDValueEnum OutputPixelType) Set the output pixel type, if sitkUnknown then the input type is used.voidsetOutputSpacing(VectorDouble OutputSpacing) Self& itk::simple::ResampleImageFilter::SetOutputSpacing(std::vector< double > OutputSpacing) Set the output image spacing.voidsetReferenceImage(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 imagevoidsetSize(VectorUInt32 Size) Self& itk::simple::ResampleImageFilter::SetSize(std::vector< uint32_t > Size) Get/Set the size of the output image.voidsetTransform(Transform Transform) Self& itk::simple::ResampleImageFilter::SetTransform(Transform Transform)voidsetUseNearestNeighborExtrapolator(boolean UseNearestNeighborExtrapolator) Self& itk::simple::ResampleImageFilter::SetUseNearestNeighborExtrapolator(bool UseNearestNeighborExtrapolator) Enables the nearest neighbor extrapolator as opposed to the constant pixel value.protected static longtoString()std::string itk::simple::ResampleImageFilter::ToString() const Print ourselves outvoidSelf& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOff()voidSelf& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOn() Set the value of UseNearestNeighborExtrapolator to true or false respectfully.Methods inherited from class org.itk.simple.ImageFiltergetCPtr, swigReleaseMethods inherited from class org.itk.simple.ProcessObjectabort, 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- 
ResampleImageFilterprotected ResampleImageFilter(long cPtr, boolean cMemoryOwn) 
- 
ResampleImageFilterpublic ResampleImageFilter()itk::simple::ResampleImageFilter::ResampleImageFilter() Default Constructor that takes no arguments and initializes default parameters
 
- 
- 
Method Details- 
getCPtr
- 
swigRelease
- 
finalizeprotected void finalize()- Overrides:
- finalizein class- ImageFilter
 
- 
deletepublic void delete()virtual itk::simple::ResampleImageFilter::~ResampleImageFilter() Destructor- Overrides:
- deletein class- ImageFilter
 
- 
setSizeSelf& itk::simple::ResampleImageFilter::SetSize(std::vector< uint32_t > Size) Get/Set the size of the output image.
- 
getSizestd::vector<uint32_t> itk::simple::ResampleImageFilter::GetSize() const Get/Set the size of the output image.
- 
setTransformSelf& itk::simple::ResampleImageFilter::SetTransform(Transform Transform)
- 
getTransformTransform itk::simple::ResampleImageFilter::GetTransform() const
- 
setInterpolatorSelf& 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).
- 
getInterpolatorInterpolatorEnum 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).
- 
setOutputOriginSelf& itk::simple::ResampleImageFilter::SetOutputOrigin(std::vector< double > OutputOrigin) Set the output image origin.
- 
getOutputOriginstd::vector<double> itk::simple::ResampleImageFilter::GetOutputOrigin() const Get the output image origin.
- 
setOutputSpacingSelf& itk::simple::ResampleImageFilter::SetOutputSpacing(std::vector< double > OutputSpacing) Set the output image spacing.
- 
getOutputSpacingstd::vector<double> itk::simple::ResampleImageFilter::GetOutputSpacing() const Get the output image spacing.
- 
setOutputDirectionSelf& itk::simple::ResampleImageFilter::SetOutputDirection(std::vector< double > OutputDirection) Set the output direction cosine matrix.
- 
getOutputDirectionstd::vector<double> itk::simple::ResampleImageFilter::GetOutputDirection() const Set the output direction cosine matrix.
- 
setDefaultPixelValuepublic 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.
- 
getDefaultPixelValuepublic 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.
- 
setOutputPixelTypeSelf& itk::simple::ResampleImageFilter::SetOutputPixelType(PixelIDValueEnum OutputPixelType) Set the output pixel type, if sitkUnknown then the input type is used.
- 
getOutputPixelTypePixelIDValueEnum itk::simple::ResampleImageFilter::GetOutputPixelType() const Get the ouput pixel type.
- 
setUseNearestNeighborExtrapolatorpublic void setUseNearestNeighborExtrapolator(boolean UseNearestNeighborExtrapolator) Self& itk::simple::ResampleImageFilter::SetUseNearestNeighborExtrapolator(bool UseNearestNeighborExtrapolator) Enables the nearest neighbor extrapolator as opposed to the constant pixel value.
- 
useNearestNeighborExtrapolatorOnpublic void useNearestNeighborExtrapolatorOn()Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOn() Set the value of UseNearestNeighborExtrapolator to true or false respectfully.
- 
useNearestNeighborExtrapolatorOffpublic void useNearestNeighborExtrapolatorOff()Self& itk::simple::ResampleImageFilter::UseNearestNeighborExtrapolatorOff()
- 
getUseNearestNeighborExtrapolatorpublic boolean getUseNearestNeighborExtrapolator()bool itk::simple::ResampleImageFilter::GetUseNearestNeighborExtrapolator() const
- 
getNamestd::string itk::simple::ResampleImageFilter::GetName() const Name of this class- Overrides:
- getNamein class- ProcessObject
 
- 
toStringstd::string itk::simple::ResampleImageFilter::ToString() const Print ourselves out- Overrides:
- toStringin class- ProcessObject
 
- 
execute
- 
setReferenceImagevoid itk::simple::ResampleImageFilter::SetReferenceImage(const Image &refImage) This methods sets the output size, origin, spacing and direction to that of the provided image
 
-