|
SimpleITK
|
Resample an image via a coordinate transform. More...
#include <sitkResampleImageFilter.h>
Inheritance diagram for itk::simple::ResampleImageFilter:
Collaboration diagram for 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.
Definition at line 67 of file sitkResampleImageFilter.h.
Public Types | |
| using | PixelIDTypeList = BasicPixelIDTypeList |
| using | Self = ResampleImageFilter |
Public Types inherited from itk::simple::ImageFilter | |
| using | Self = ImageFilter |
Public Types inherited from itk::simple::ProcessObject | |
| using | Self = ProcessObject |
Public Member Functions | |
| Image | Execute (const Image &image1) |
| double | GetDefaultPixelValue () const |
| InterpolatorEnum | GetInterpolator () const |
| std::string | GetName () const |
| std::vector< double > | GetOutputDirection () const |
| std::vector< double > | GetOutputOrigin () const |
| PixelIDValueEnum | GetOutputPixelType () const |
| Get the ouput pixel type. | |
| std::vector< double > | GetOutputSpacing () const |
| std::vector< uint32_t > | GetSize () const |
| Transform | GetTransform () const |
| bool | GetUseNearestNeighborExtrapolator () const |
| ResampleImageFilter () | |
| void | SetDefaultPixelValue (double DefaultPixelValue) |
| void | SetInterpolator (InterpolatorEnum Interpolator) |
| void | SetOutputDirection (std::vector< double > OutputDirection) |
| void | SetOutputOrigin (std::vector< double > OutputOrigin) |
| void | SetOutputPixelType (PixelIDValueEnum OutputPixelType) |
| Set the output pixel type, if sitkUnknown then the input type is used. | |
| void | SetOutputSpacing (std::vector< double > OutputSpacing) |
| void | SetReferenceImage (const Image &refImage) |
| void | SetSize (std::vector< uint32_t > Size) |
| void | SetTransform (Transform Transform) |
| void | SetUseNearestNeighborExtrapolator (bool UseNearestNeighborExtrapolator) |
| Enables the nearest neighbor extrapolator as opposed to the constant pixel value. | |
| std::string | ToString () const |
| void | UseNearestNeighborExtrapolatorOff () |
| void | UseNearestNeighborExtrapolatorOn () |
| virtual | ~ResampleImageFilter () |
Public Member Functions inherited from itk::simple::ImageFilter | |
| ImageFilter () | |
| virtual | ~ImageFilter ()=0 |
Public Member Functions inherited from itk::simple::ProcessObject | |
| virtual void | Abort () |
| virtual int | AddCommand (itk::simple::EventEnum event, const std::function< void()> &func) |
| Directly add a callback to observe an event. | |
| virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
| Add a Command Object to observer the event. | |
| virtual float | GetProgress () const |
| An Active Measurement of the progress of execution. | |
| virtual bool | HasCommand (itk::simple::EventEnum event) const |
| Query of this object has any registered commands for event. | |
| ProcessObject () | |
| virtual void | RemoveAllCommands () |
| Remove all registered commands. | |
| virtual | ~ProcessObject () |
| virtual void | DebugOn () |
| virtual void | DebugOff () |
| virtual bool | GetDebug () const |
| virtual void | SetDebug (bool debugFlag) |
| virtual void | SetNumberOfThreads (unsigned int n) |
| virtual unsigned int | GetNumberOfThreads () const |
| virtual void | SetNumberOfWorkUnits (unsigned int n) |
| virtual unsigned int | GetNumberOfWorkUnits () const |
Private Types | |
| using | MemberFunctionType = Image (Self::*)(const Image &image1) |
Private Member Functions | |
| template<class TImageType1, class TImageType2> | |
| Image | DualExecuteInternal (const Image &image1) |
| template<class TImageType1, class TImageType2> | |
| Image | DualExecuteInternalVector (const Image &image1) |
Static Private Member Functions | |
| static const detail::DualMemberFunctionFactory< MemberFunctionType > & | GetMemberFunctionFactory () |
Private Attributes | |
| double | m_DefaultPixelValue { 0.0 } |
| InterpolatorEnum | m_Interpolator { itk::simple::sitkLinear } |
| std::vector< double > | m_OutputDirection { std::vector<double>() } |
| std::vector< double > | m_OutputOrigin { std::vector<double>(3, 0.0) } |
| PixelIDValueEnum | m_OutputPixelType { itk::simple::sitkUnknown } |
| std::vector< double > | m_OutputSpacing { std::vector<double>(3, 1.0) } |
| std::vector< uint32_t > | m_Size { std::vector<uint32_t>(3, 0) } |
| Transform | m_Transform { itk::simple::Transform() } |
| bool | m_UseNearestNeighborExtrapolator { false } |
Friends | |
| struct | detail::DualExecuteInternalAddressor< MemberFunctionType > |
| struct | detail::DualExecuteInternalVectorAddressor< MemberFunctionType > |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::simple::ProcessObject | |
| static bool | GetGlobalDefaultDebug () |
| static void | GlobalDefaultDebugOff () |
| static void | GlobalDefaultDebugOn () |
| static void | SetGlobalDefaultDebug (bool debugFlag) |
| static void | GlobalWarningDisplayOn () |
| static void | GlobalWarningDisplayOff () |
| static void | SetGlobalWarningDisplay (bool flag) |
| static bool | GetGlobalWarningDisplay () |
| static double | GetGlobalDefaultCoordinateTolerance () |
| Access the global tolerance to determine congruent spaces. | |
| static void | SetGlobalDefaultCoordinateTolerance (double) |
| Access the global tolerance to determine congruent spaces. | |
| static double | GetGlobalDefaultDirectionTolerance () |
| Access the global tolerance to determine congruent spaces. | |
| static void | SetGlobalDefaultDirectionTolerance (double) |
| Access the global tolerance to determine congruent spaces. | |
| static bool | SetGlobalDefaultThreader (const std::string &threader) |
| Set/Get the default threader used for process objects. | |
| static std::string | GetGlobalDefaultThreader () |
| Set/Get the default threader used for process objects. | |
| static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
| static unsigned int | GetGlobalDefaultNumberOfThreads () |
| Set/Get the default threader used for process objects. | |
Protected Member Functions inherited from itk::simple::ImageFilter | |
| void | CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name) |
| void | CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name) |
| void | CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name) |
Protected Member Functions inherited from itk::simple::ProcessObject | |
| virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
| virtual itk::ProcessObject * | GetActiveProcess () |
| virtual void | OnActiveProcessDelete () |
| virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
| virtual void | PreUpdate (itk::ProcessObject *p) |
| virtual void | RemoveITKObserver (EventCommand &e) |
Protected Member Functions inherited from itk::simple::NonCopyable | |
| NonCopyable ()=default | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
Static Protected Member Functions inherited from itk::simple::ImageFilter | |
| template<class TImageType> | |
| static void | FixNonZeroIndex (TImageType *img) |
Static Protected Member Functions inherited from itk::simple::ProcessObject | |
| template<class TImageType> | |
| static TImageType::ConstPointer | CastImageToITK (const Image &img) |
| template<class TPixelType, unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
| static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
| template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector> | |
| static Image | CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img) |
| template<class TImageType> | |
| static Image | CastITKToImage (TImageType *img) |
| static const itk::EventObject & | GetITKEventObject (EventEnum e) |
| template<typename T> | |
| static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
| static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
| static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
| static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
|
private |
Setup for member function dispatching
Definition at line 228 of file sitkResampleImageFilter.h.
Define the pixels types supported by this filter
Definition at line 79 of file sitkResampleImageFilter.h.
Definition at line 69 of file sitkResampleImageFilter.h.
|
virtual |
Destructor
| itk::simple::ResampleImageFilter::ResampleImageFilter | ( | ) |
Default Constructor that takes no arguments and initializes default parameters
|
private |
Execute the filter on the input image
|
inline |
Get/Set the pixel value when a transformed pixel is outside of the image. The default default pixel value is 0.
Definition at line 176 of file sitkResampleImageFilter.h.
References m_DefaultPixelValue.
|
inline |
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).
Definition at line 124 of file sitkResampleImageFilter.h.
References m_Interpolator.
|
staticprivate |
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 211 of file sitkResampleImageFilter.h.
|
inline |
Set the output direction cosine matrix.
Definition at line 163 of file sitkResampleImageFilter.h.
References m_OutputDirection.
|
inline |
Get the output image origin.
Definition at line 137 of file sitkResampleImageFilter.h.
References m_OutputOrigin.
|
inline |
Get the ouput pixel type.
Definition at line 189 of file sitkResampleImageFilter.h.
References m_OutputPixelType.
|
inline |
Get the output image spacing.
Definition at line 150 of file sitkResampleImageFilter.h.
References m_OutputSpacing.
|
inline |
Get/Set the size of the output image.
Definition at line 94 of file sitkResampleImageFilter.h.
References m_Size.
|
inline |
Definition at line 105 of file sitkResampleImageFilter.h.
References m_Transform.
|
inline |
Definition at line 207 of file sitkResampleImageFilter.h.
References m_UseNearestNeighborExtrapolator.
|
inline |
Get/Set the pixel value when a transformed pixel is outside of the image. The default default pixel value is 0.
Definition at line 170 of file sitkResampleImageFilter.h.
References m_DefaultPixelValue.
|
inline |
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).
Definition at line 115 of file sitkResampleImageFilter.h.
References m_Interpolator.
|
inline |
Set the output direction cosine matrix.
Definition at line 157 of file sitkResampleImageFilter.h.
References m_OutputDirection.
|
inline |
Set the output image origin.
Definition at line 131 of file sitkResampleImageFilter.h.
References m_OutputOrigin.
|
inline |
Set the output pixel type, if sitkUnknown then the input type is used.
Definition at line 183 of file sitkResampleImageFilter.h.
References m_OutputPixelType.
|
inline |
Set the output image spacing.
Definition at line 144 of file sitkResampleImageFilter.h.
References m_OutputSpacing.
| void itk::simple::ResampleImageFilter::SetReferenceImage | ( | const Image & | refImage | ) |
This methods sets the output size, origin, spacing and direction to that of the provided image
Referenced by detail::DualExecuteInternalAddressor< MemberFunctionType >.
|
inline |
Get/Set the size of the output image.
Definition at line 88 of file sitkResampleImageFilter.h.
References m_Size.
|
inline |
Definition at line 100 of file sitkResampleImageFilter.h.
References m_Transform.
|
inline |
Enables the nearest neighbor extrapolator as opposed to the constant pixel value.
Definition at line 196 of file sitkResampleImageFilter.h.
References m_UseNearestNeighborExtrapolator.
Referenced by UseNearestNeighborExtrapolatorOff(), and UseNearestNeighborExtrapolatorOn().
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
inline |
Definition at line 203 of file sitkResampleImageFilter.h.
References SetUseNearestNeighborExtrapolator().
|
inline |
Set the value of UseNearestNeighborExtrapolator to true or false respectfully.
Definition at line 201 of file sitkResampleImageFilter.h.
References SetUseNearestNeighborExtrapolator().
|
friend |
Definition at line 220 of file sitkResampleImageFilter.h.
References SetReferenceImage().
|
friend |
Definition at line 231 of file sitkResampleImageFilter.h.
References DualExecuteInternal().
|
private |
Definition at line 254 of file sitkResampleImageFilter.h.
Referenced by GetDefaultPixelValue(), and SetDefaultPixelValue().
|
private |
Definition at line 245 of file sitkResampleImageFilter.h.
Referenced by GetInterpolator(), and SetInterpolator().
|
private |
Definition at line 252 of file sitkResampleImageFilter.h.
Referenced by GetOutputDirection(), and SetOutputDirection().
|
private |
Definition at line 247 of file sitkResampleImageFilter.h.
Referenced by GetOutputOrigin(), and SetOutputOrigin().
|
private |
Definition at line 256 of file sitkResampleImageFilter.h.
Referenced by GetOutputPixelType(), and SetOutputPixelType().
|
private |
Definition at line 249 of file sitkResampleImageFilter.h.
Referenced by GetOutputSpacing(), and SetOutputSpacing().
|
private |
Definition at line 241 of file sitkResampleImageFilter.h.
|
private |
Definition at line 243 of file sitkResampleImageFilter.h.
Referenced by GetTransform(), and SetTransform().
|
private |
Definition at line 258 of file sitkResampleImageFilter.h.
Referenced by GetUseNearestNeighborExtrapolator(), and SetUseNearestNeighborExtrapolator().
1.13.2 |
Privacy Policy