SimpleITK
2.0.0
|
Resample an image via a coordinate transform. More...
#include <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. More... | |
std::vector< double > | GetOutputSpacing () const |
std::vector< uint32_t > | GetSize () const |
Transform | GetTransform () const |
bool | GetUseNearestNeighborExtrapolator () const |
ResampleImageFilter () | |
Self & | SetDefaultPixelValue (double DefaultPixelValue) |
Self & | SetInterpolator (InterpolatorEnum Interpolator) |
Self & | SetOutputDirection (std::vector< double > OutputDirection) |
Self & | SetOutputOrigin (std::vector< double > OutputOrigin) |
Self & | SetOutputPixelType (PixelIDValueEnum OutputPixelType) |
Set the output pixel type, if sitkUnknown then the input type is used. More... | |
Self & | SetOutputSpacing (std::vector< double > OutputSpacing) |
void | SetReferenceImage (const Image &refImage) |
Self & | SetSize (std::vector< uint32_t > Size) |
Self & | SetTransform (Transform Transform) |
Self & | SetUseNearestNeighborExtrapolator (bool UseNearestNeighborExtrapolator) |
Enables the nearest neighbor extrapolator as opposed to the constant pixel value. More... | |
std::string | ToString () const |
Self & | UseNearestNeighborExtrapolatorOff () |
Self & | 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. More... | |
virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
Add a Command Object to observer the event. More... | |
virtual float | GetProgress () const |
An Active Measurement of the progress of execution. More... | |
virtual bool | HasCommand (itk::simple::EventEnum event) const |
Query of this object has any registered commands for event. More... | |
ProcessObject () | |
virtual void | RemoveAllCommands () |
Remove all registered commands. More... | |
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) |
Private Attributes | |
double | m_DefaultPixelValue {0.0} |
std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > | m_DualMemberFactory |
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. More... | |
static void | SetGlobalDefaultCoordinateTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static double | GetGlobalDefaultDirectionTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultDirectionTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static bool | SetGlobalDefaultThreader (const std::string &threader) |
Set/Get the default threader used for process objects. More... | |
static std::string | GetGlobalDefaultThreader () |
Set/Get the default threader used for process objects. More... | |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
Set/Get the default threader used for process objects. More... | |
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<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) |
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 53 of file sitkResampleImageFilter.h.
|
private |
Setup for member function dispatching
Definition at line 178 of file sitkResampleImageFilter.h.
Define the pixels types supported by this filter
Definition at line 65 of file sitkResampleImageFilter.h.
Definition at line 55 of file sitkResampleImageFilter.h.
|
virtual |
Destructor
itk::simple::ResampleImageFilter::ResampleImageFilter | ( | ) |
Default Constructor that takes no arguments and initializes default parameters
|
private |
|
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 135 of file sitkResampleImageFilter.h.
|
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 95 of file sitkResampleImageFilter.h.
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 161 of file sitkResampleImageFilter.h.
|
inline |
Set the output direciton cosine matrix.
Definition at line 125 of file sitkResampleImageFilter.h.
|
inline |
Get the output image origin.
Definition at line 105 of file sitkResampleImageFilter.h.
|
inline |
Get the ouput pixel type.
Definition at line 145 of file sitkResampleImageFilter.h.
|
inline |
Get the output image spacing.
Definition at line 115 of file sitkResampleImageFilter.h.
|
inline |
Get/Set the size of the output image.
Definition at line 77 of file sitkResampleImageFilter.h.
|
inline |
Definition at line 85 of file sitkResampleImageFilter.h.
|
inline |
Definition at line 158 of file sitkResampleImageFilter.h.
|
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 130 of file sitkResampleImageFilter.h.
|
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 90 of file sitkResampleImageFilter.h.
|
inline |
Set the output direciton cosine matrix.
Definition at line 120 of file sitkResampleImageFilter.h.
|
inline |
Set the output image origin.
Definition at line 100 of file sitkResampleImageFilter.h.
|
inline |
Set the output pixel type, if sitkUnknown then the input type is used.
Definition at line 140 of file sitkResampleImageFilter.h.
|
inline |
Set the output image spacing.
Definition at line 110 of file sitkResampleImageFilter.h.
void itk::simple::ResampleImageFilter::SetReferenceImage | ( | const Image & | refImage | ) |
This methods sets the output size, origin, spacing and direction to that of the provided image
Get/Set the size of the output image.
Definition at line 72 of file sitkResampleImageFilter.h.
Definition at line 81 of file sitkResampleImageFilter.h.
|
inline |
Enables the nearest neighbor extrapolator as opposed to the constant pixel value.
Definition at line 150 of file sitkResampleImageFilter.h.
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
inline |
Definition at line 154 of file sitkResampleImageFilter.h.
|
inline |
Set the value of UseNearestNeighborExtrapolator to true or false respectfully.
Definition at line 153 of file sitkResampleImageFilter.h.
|
friend |
Definition at line 180 of file sitkResampleImageFilter.h.
|
friend |
Definition at line 182 of file sitkResampleImageFilter.h.
|
private |
Definition at line 206 of file sitkResampleImageFilter.h.
|
private |
Definition at line 185 of file sitkResampleImageFilter.h.
|
private |
Definition at line 195 of file sitkResampleImageFilter.h.
|
private |
Definition at line 204 of file sitkResampleImageFilter.h.
|
private |
Definition at line 198 of file sitkResampleImageFilter.h.
|
private |
Definition at line 208 of file sitkResampleImageFilter.h.
|
private |
Definition at line 201 of file sitkResampleImageFilter.h.
|
private |
Definition at line 190 of file sitkResampleImageFilter.h.
|
private |
Definition at line 192 of file sitkResampleImageFilter.h.
|
private |
Definition at line 210 of file sitkResampleImageFilter.h.