SimpleITK  1.3.0.dev466
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

typedef BasicPixelIDTypeList PixelIDTypeList
 
typedef WarpImageFilter Self
 
- Public Types inherited from itk::simple::ImageFilter< 0 >
typedef ImageFilter Self
 
- Public Types inherited from itk::simple::ProcessObject
typedef ProcessObject Self
 

Public Member Functions

Image Execute (const Image &image, const Image &displacementField)
 
Image Execute (const Image &image, const Image &displacementField, InterpolatorEnum interpolator, const std::vector< uint32_t > &outputSize, const std::vector< double > &outputOrigin, const std::vector< double > &outputSpacing, std::vector< double > outputDirection, double edgePaddingValue)
 
double GetEdgePaddingValue () const
 
InterpolatorEnum GetInterpolator () const
 
std::string GetName () const
 
std::vector< double > GetOutputDirection () const
 
std::vector< double > GetOutputOrigin () const
 
std::vector< uint32_tGetOutputSize () const
 
std::vector< double > GetOutputSpacing () const
 
SelfSetEdgePaddingValue (double EdgePaddingValue)
 
SelfSetInterpolator (InterpolatorEnum Interpolator)
 
SelfSetOutputDirection (std::vector< double > OutputDirection)
 
SelfSetOutputOrigin (const std::vector< double > &OutputOrigin)
 
void SetOutputParameteresFromImage (const Image &refImage)
 
SelfSetOutputSize (const std::vector< uint32_t > &OutputSize)
 
SelfSetOutputSpacing (const std::vector< double > &OutputSpacing)
 
std::string ToString () const
 
 WarpImageFilter ()
 
virtual ~WarpImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter< 0 >
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
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
 

Private Types

typedef Image(Self::* MemberFunctionType) (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

nsstd::auto_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
 
double m_EdgePaddingValue
 
InterpolatorEnum m_Interpolator
 
std::vector< double > m_OutputDirection
 
std::vector< double > m_OutputOrigin
 
std::vector< uint32_tm_OutputSize
 
std::vector< double > m_OutputSpacing
 

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 void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 
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...
 
- 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) SITK_NOEXCEPT
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter< 0 >
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 TImageType >
static Image CastITKToImage (TImageType *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)
 
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 LargetPossibleRegion 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 65 of file sitkWarpImageFilter.h.

Member Typedef Documentation

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

Setup for member function dispatching

Definition at line 161 of file sitkWarpImageFilter.h.

Define the pixels types supported by this filter

Definition at line 77 of file sitkWarpImageFilter.h.

Definition at line 67 of file sitkWarpImageFilter.h.

Constructor & Destructor Documentation

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

Destructor

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

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

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

Execute the filter on the input image

Image itk::simple::WarpImageFilter::Execute ( const Image image,
const Image displacementField,
InterpolatorEnum  interpolator,
const std::vector< uint32_t > &  outputSize,
const std::vector< double > &  outputOrigin,
const std::vector< double > &  outputSpacing,
std::vector< double >  outputDirection,
double  edgePaddingValue 
)

Execute the filter on the input image with the given parameters

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

Get the edge padding value

Definition at line 139 of file sitkWarpImageFilter.h.

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

Get/Set the interpolator function.

Definition at line 89 of file sitkWarpImageFilter.h.

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

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 141 of file sitkWarpImageFilter.h.

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

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

Definition at line 129 of file sitkWarpImageFilter.h.

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

Get the output image origin.

Definition at line 109 of file sitkWarpImageFilter.h.

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

Get the size of the output image.

Definition at line 99 of file sitkWarpImageFilter.h.

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

Get the output image spacing.

Definition at line 119 of file sitkWarpImageFilter.h.

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

Set the edge padding value

Definition at line 134 of file sitkWarpImageFilter.h.

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

Get/Set the interpolator function.

Definition at line 84 of file sitkWarpImageFilter.h.

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

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

Definition at line 124 of file sitkWarpImageFilter.h.

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

Set the output image origin.

Definition at line 104 of file sitkWarpImageFilter.h.

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

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

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

Set the size of the output image.

Definition at line 94 of file sitkWarpImageFilter.h.

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

Set the output image spacing.

Definition at line 114 of file sitkWarpImageFilter.h.

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

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

Definition at line 163 of file sitkWarpImageFilter.h.

Definition at line 165 of file sitkWarpImageFilter.h.

Member Data Documentation

nsstd::auto_ptr<detail::DualMemberFunctionFactory<MemberFunctionType> > itk::simple::WarpImageFilter::m_DualMemberFactory
private

Definition at line 168 of file sitkWarpImageFilter.h.

double itk::simple::WarpImageFilter::m_EdgePaddingValue
private

Definition at line 182 of file sitkWarpImageFilter.h.

InterpolatorEnum itk::simple::WarpImageFilter::m_Interpolator
private

Definition at line 173 of file sitkWarpImageFilter.h.

std::vector<double> itk::simple::WarpImageFilter::m_OutputDirection
private

Definition at line 181 of file sitkWarpImageFilter.h.

std::vector<double> itk::simple::WarpImageFilter::m_OutputOrigin
private

Definition at line 177 of file sitkWarpImageFilter.h.

std::vector<uint32_t> itk::simple::WarpImageFilter::m_OutputSize
private

Definition at line 175 of file sitkWarpImageFilter.h.

std::vector<double> itk::simple::WarpImageFilter::m_OutputSpacing
private

Definition at line 179 of file sitkWarpImageFilter.h.


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