SimpleITK  
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::WarpImageFilter Class Reference

Warps an image using an input displacement field. More...

#include <sitkWarpImageFilter.h>

+ Inheritance diagram for itk::simple::WarpImageFilter:
+ Collaboration diagram for itk::simple::WarpImageFilter:

Public Types

using PixelIDTypeList = BasicPixelIDTypeList
 
using Self = WarpImageFilter
 
- 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 &image, const Image &displacementField)
 
double GetEdgePaddingValue () const
 
InterpolatorEnum GetInterpolator () const
 
std::string GetName () const
 
std::vector< double > GetOutputDirection () const
 
std::vector< double > GetOutputOrigin () const
 
std::vector< uint32_t > GetOutputSize () const
 
std::vector< double > GetOutputSpacing () const
 
SelfSetEdgePaddingValue (double EdgePaddingValue)
 
SelfSetInterpolator (InterpolatorEnum Interpolator)
 
SelfSetOutputDirection (std::vector< double > OutputDirection)
 
SelfSetOutputOrigin (std::vector< double > OutputOrigin)
 
void SetOutputParameteresFromImage (const Image &refImage)
 
SelfSetOutputSize (std::vector< uint32_t > OutputSize)
 
SelfSetOutputSpacing (std::vector< double > OutputSpacing)
 
std::string ToString () const
 
 WarpImageFilter ()
 
virtual ~WarpImageFilter ()
 
- 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 *image, const Image *displacementField)
 

Private Member Functions

template<class TImageType1 , class TImageType2 >
Image DualExecuteInternal (const Image *image, const Image *displacementField)
 
template<class TImageType1 , class TImageType2 >
Image DualExecuteInternalVector (const Image *image, const Image *displacementField)
 

Private Attributes

std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
 
double m_EdgePaddingValue {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)}
 
std::vector< uint32_t > m_OutputSize {std::vector<uint32_t>(3, 0)}
 
std::vector< double > m_OutputSpacing {std::vector<double>(3, 1.0)}
 

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::ProcessObjectGetActiveProcess ()
 
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
 
NonCopyableoperator= (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::EventObjectGetITKEventObject (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)
 

Detailed Description

Warps an image using an input displacement field.

WarpImageFilter warps an existing image with respect to a given displacement field.

A displacement field is represented as a image whose pixel type is some vector type with at least N elements, where N is the dimension of the input image. The vector type must support element access via operator [].

The output image is produced by inverse mapping: the output pixels are mapped back onto the input image. This scheme avoids the creation of any holes and overlaps in the output image.

Each vector in the displacement field represent the distance between a geometric point in the input space and a point in the output space such that:

\[ p_{in} = p_{out} + d \]

Typically the mapped position does not correspond to an integer pixel position in the input image. Interpolation via an image function is used to compute values at non-integer positions. The default interpolation typed used is the LinearInterpolateImageFunction . The user can specify a particular interpolation function via SetInterpolator() . Note that the input interpolator must derive from base class InterpolateImageFunction .

Position mapped to outside of the input image buffer are assigned a edge padding value.

The LargestPossibleRegion for the output is inherited from the input displacement field. The output image spacing, origin and orientation may be set via SetOutputSpacing, SetOutputOrigin and SetOutputDirection. The default are respectively a vector of 1's, a vector of 0's and an identity matrix.

This class is templated over the type of the input image, the type of the output image and the type of the displacement field.

The input image is set via SetInput. The input displacement field is set via SetDisplacementField.

This filter is implemented as a multithreaded filter.

Warning
This filter assumes that the input type, output type and displacement field type all have the same number of dimensions.
See also
itk::simple::Warp for the procedural interface
itk::WarpImageFilter for the Doxygen on the original ITK class.

Definition at line 64 of file sitkWarpImageFilter.h.

Member Typedef Documentation

◆ MemberFunctionType

using itk::simple::WarpImageFilter::MemberFunctionType = Image (Self::*)( const Image * image, const Image * displacementField )
private

Setup for member function dispatching

Definition at line 158 of file sitkWarpImageFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 76 of file sitkWarpImageFilter.h.

◆ Self

Definition at line 66 of file sitkWarpImageFilter.h.

Constructor & Destructor Documentation

◆ ~WarpImageFilter()

virtual itk::simple::WarpImageFilter::~WarpImageFilter ( )
virtual

Destructor

◆ WarpImageFilter()

itk::simple::WarpImageFilter::WarpImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ DualExecuteInternal()

template<class TImageType1 , class TImageType2 >
Image itk::simple::WarpImageFilter::DualExecuteInternal ( const Image image,
const Image displacementField 
)
private

◆ DualExecuteInternalVector()

template<class TImageType1 , class TImageType2 >
Image itk::simple::WarpImageFilter::DualExecuteInternalVector ( const Image image,
const Image displacementField 
)
private

◆ Execute()

Image itk::simple::WarpImageFilter::Execute ( const Image image,
const Image displacementField 
)

Execute the filter on the input image

◆ GetEdgePaddingValue()

double itk::simple::WarpImageFilter::GetEdgePaddingValue ( ) const
inline

Get the edge padding value

Definition at line 138 of file sitkWarpImageFilter.h.

◆ GetInterpolator()

InterpolatorEnum itk::simple::WarpImageFilter::GetInterpolator ( ) const
inline

Get/Set the interpolator function.

Definition at line 88 of file sitkWarpImageFilter.h.

◆ GetName()

std::string itk::simple::WarpImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 141 of file sitkWarpImageFilter.h.

◆ GetOutputDirection()

std::vector<double> itk::simple::WarpImageFilter::GetOutputDirection ( ) const
inline

Set/Get the direction (orientation) of the output image

Definition at line 128 of file sitkWarpImageFilter.h.

◆ GetOutputOrigin()

std::vector<double> itk::simple::WarpImageFilter::GetOutputOrigin ( ) const
inline

Get the output image origin.

Definition at line 108 of file sitkWarpImageFilter.h.

◆ GetOutputSize()

std::vector<uint32_t> itk::simple::WarpImageFilter::GetOutputSize ( ) const
inline

Get the size of the output image.

Definition at line 98 of file sitkWarpImageFilter.h.

◆ GetOutputSpacing()

std::vector<double> itk::simple::WarpImageFilter::GetOutputSpacing ( ) const
inline

Get the output image spacing.

Definition at line 118 of file sitkWarpImageFilter.h.

◆ SetEdgePaddingValue()

Self& itk::simple::WarpImageFilter::SetEdgePaddingValue ( double  EdgePaddingValue)
inline

Set the edge padding value

Definition at line 133 of file sitkWarpImageFilter.h.

◆ SetInterpolator()

Self& itk::simple::WarpImageFilter::SetInterpolator ( InterpolatorEnum  Interpolator)
inline

Get/Set the interpolator function.

Definition at line 83 of file sitkWarpImageFilter.h.

◆ SetOutputDirection()

Self& itk::simple::WarpImageFilter::SetOutputDirection ( std::vector< double >  OutputDirection)
inline

Set/Get the direction (orientation) of the output image

Definition at line 123 of file sitkWarpImageFilter.h.

◆ SetOutputOrigin()

Self& itk::simple::WarpImageFilter::SetOutputOrigin ( std::vector< double >  OutputOrigin)
inline

Set the output image origin.

Definition at line 103 of file sitkWarpImageFilter.h.

◆ SetOutputParameteresFromImage()

void itk::simple::WarpImageFilter::SetOutputParameteresFromImage ( const Image refImage)

This methods sets the output size, origin, spacing and direction to that of the provided image

◆ SetOutputSize()

Self& itk::simple::WarpImageFilter::SetOutputSize ( std::vector< uint32_t >  OutputSize)
inline

Set the size of the output image.

Definition at line 93 of file sitkWarpImageFilter.h.

◆ SetOutputSpacing()

Self& itk::simple::WarpImageFilter::SetOutputSpacing ( std::vector< double >  OutputSpacing)
inline

Set the output image spacing.

Definition at line 113 of file sitkWarpImageFilter.h.

◆ ToString()

std::string itk::simple::WarpImageFilter::ToString ( ) const
virtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

◆ detail::DualExecuteInternalAddressor< MemberFunctionType >

Definition at line 160 of file sitkWarpImageFilter.h.

◆ detail::DualExecuteInternalVectorAddressor< MemberFunctionType >

Definition at line 162 of file sitkWarpImageFilter.h.

Member Data Documentation

◆ m_DualMemberFactory

std::unique_ptr<detail::DualMemberFunctionFactory<MemberFunctionType> > itk::simple::WarpImageFilter::m_DualMemberFactory
private

Definition at line 165 of file sitkWarpImageFilter.h.

◆ m_EdgePaddingValue

double itk::simple::WarpImageFilter::m_EdgePaddingValue {0.0}
private

Definition at line 184 of file sitkWarpImageFilter.h.

◆ m_Interpolator

InterpolatorEnum itk::simple::WarpImageFilter::m_Interpolator {itk::simple::sitkLinear}
private

Definition at line 170 of file sitkWarpImageFilter.h.

◆ m_OutputDirection

std::vector<double> itk::simple::WarpImageFilter::m_OutputDirection {std::vector<double>()}
private

Definition at line 182 of file sitkWarpImageFilter.h.

◆ m_OutputOrigin

std::vector<double> itk::simple::WarpImageFilter::m_OutputOrigin {std::vector<double>(3, 0.0)}
private

Definition at line 176 of file sitkWarpImageFilter.h.

◆ m_OutputSize

std::vector<uint32_t> itk::simple::WarpImageFilter::m_OutputSize {std::vector<uint32_t>(3, 0)}
private

Definition at line 173 of file sitkWarpImageFilter.h.

◆ m_OutputSpacing

std::vector<double> itk::simple::WarpImageFilter::m_OutputSpacing {std::vector<double>(3, 1.0)}
private

Definition at line 179 of file sitkWarpImageFilter.h.


The documentation for this class was generated from the following file: