SimpleITK  1.2.4
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
itk::simple::Transform Class Reference

A simplified wrapper around a variety of ITK transforms. More...

#include <sitkTransform.h>

+ Inheritance diagram for itk::simple::Transform:

Classes

struct  DisplacementInitializationMemberFunctionAddressor
 
struct  TransformTryCastVisitor
 

Public Types

typedef Transform Self
 

Public Member Functions

SelfAddTransform (Transform t)
 
SelfFlattenTransform ()
 Remove nested composite transforms. More...
 
unsigned int GetDimension (void) const
 
Transform GetInverse () const
 Return a new inverse transform of the same type as this. More...
 
virtual std::string GetName () const
 
unsigned int GetNumberOfFixedParameters (void) const
 
unsigned int GetNumberOfParameters (void) const
 
virtual bool IsLinear () const
 
void MakeUnique (void)
 Performs actually coping if needed to make object unique. More...
 
virtual void SetIdentity ()
 
virtual bool SetInverse ()
 Try to change the current transform to it's inverse. More...
 
std::string ToString (void) const
 
 Transform (void)
 By default a 3-d identity transform is constructed. More...
 
template<unsigned int NDimension>
 Transform (itk::CompositeTransform< double, NDimension > *compositeTransform)
 Construct a SimpleITK Transform from a pointer to an ITK composite transform. More...
 
 Transform (itk::TransformBase *transform)
 
 Transform (unsigned int dimensions, TransformEnum type)
 Construct a specific transformation. More...
 
 Transform (Image &displacement, TransformEnum type=sitkDisplacementField)
 Use an image to construct a transform. More...
 
std::vector< double > TransformPoint (const std::vector< double > &point) const
 
std::vector< double > TransformVector (const std::vector< double > &vector, const std::vector< double > &point) const
 
void WriteTransform (const std::string &filename) const
 
virtual ~Transform (void)
 
Transformoperator= (const Transform &)
 Copy constructor and assignment operator. More...
 
 Transform (const Transform &)
 Copy constructor and assignment operator. More...
 
itk::TransformBaseGetITKBase (void)
 
const itk::TransformBaseGetITKBase (void) const
 
void SetParameters (const std::vector< double > &parameters)
 
std::vector< double > GetParameters (void) const
 
void SetFixedParameters (const std::vector< double > &parameters)
 
std::vector< double > GetFixedParameters (void) const
 

Protected Member Functions

virtual void SetPimpleTransform (PimpleTransformBase *pimpleTransform)
 
 Transform (PimpleTransformBase *pimpleTransform)
 

Private Member Functions

template<unsigned int>
void InternalBSplineInitialization (Image &img)
 
template<typename TDisplacementType >
void InternalDisplacementInitialization (Image &img)
 
template<unsigned int VDimension>
void InternalInitialization (TransformEnum type, itk::TransformBase *base=SITK_NULLPTR)
 
template<class TransformType >
void InternalInitialization (TransformType *t)
 
void InternalInitialization (itk::TransformBase *base)
 

Private Attributes

PimpleTransformBase * m_PimpleTransform
 

Detailed Description

A simplified wrapper around a variety of ITK transforms.

The interface to ITK transform objects to be used with the ImageRegistrationMethod, ResampleImageFilter and other SimpleITK process objects. The transforms are designed to have a serialized array of parameters to facilitate optimization for registration.

Provides a base class interface to any type of ITK transform. Objects of this type may have their interface converted to a derived interface while keeping the same reference to the ITK object.

Additionally, this class provides a basic interface to a composite transforms.

See also
itk::CompositeTransform
Examples:
DemonsRegistration2/DemonsRegistration2.cxx, ImageRegistrationMethod1/ImageRegistrationMethod1.cxx, ImageRegistrationMethod2/ImageRegistrationMethod2.cxx, ImageRegistrationMethodBSpline1/ImageRegistrationMethodBSpline1.cxx, ImageRegistrationMethodBSpline3/ImageRegistrationMethodBSpline3.cxx, and ImageRegistrationMethodDisplacement1/ImageRegistrationMethodDisplacement1.cxx.

Definition at line 84 of file sitkTransform.h.

Member Typedef Documentation

Definition at line 87 of file sitkTransform.h.

Constructor & Destructor Documentation

itk::simple::Transform::Transform ( void  )

By default a 3-d identity transform is constructed.

template<unsigned int NDimension>
itk::simple::Transform::Transform ( itk::CompositeTransform< double, NDimension > *  compositeTransform)
inlineexplicit

Construct a SimpleITK Transform from a pointer to an ITK composite transform.

Definition at line 98 of file sitkTransform.h.

References SITK_NULLPTR, itk::simple::sitkComposite, sitkExceptionMacro, and sitkStaticAssert.

itk::simple::Transform::Transform ( itk::TransformBase transform)
explicit
itk::simple::Transform::Transform ( unsigned int  dimensions,
TransformEnum  type 
)

Construct a specific transformation.

Deprecated:
This constructor will be removed in future releases.
itk::simple::Transform::Transform ( Image displacement,
TransformEnum  type = sitkDisplacementField 
)

Use an image to construct a transform.

The input displacement image is transferred to the constructed transform object. The input image is modified to be a default constructed Image object.

Only the sitkDisplacementField transformation type can currently be constructed this way. Image must be of sitkVectorFloat64 pixel type with the number of components equal to the image dimension.

Deprecated:
This constructor will be removed in future releases.
virtual itk::simple::Transform::~Transform ( void  )
virtual
itk::simple::Transform::Transform ( const Transform )

Copy constructor and assignment operator.

Performs a shallow copy of the internal ITK transform. A deep copy will be done if the transform in modified.

itk::simple::Transform::Transform ( PimpleTransformBase *  pimpleTransform)
explicitprotected

Member Function Documentation

Self& itk::simple::Transform::AddTransform ( Transform  t)
Self& itk::simple::Transform::FlattenTransform ( )

Remove nested composite transforms.

This method has no effect on non-composite transforms.

If this transform is a composite which contains another nested composite transform, then the nested composite's transforms are placed into this transform. Nested composite transform may not be written to a file.

unsigned int itk::simple::Transform::GetDimension ( void  ) const

Return the dimension of the Transform ( 2D or 3D )

std::vector<double> itk::simple::Transform::GetFixedParameters ( void  ) const

Set/Get Fixed Transform Parameter

Transform itk::simple::Transform::GetInverse ( ) const

Return a new inverse transform of the same type as this.

Creates a new transform object and tries to set the value to the inverse. As not all transform types have inverse and some transforms are not invertable, an exception will be throw is there is no inverse.

itk::TransformBase* itk::simple::Transform::GetITKBase ( void  )

Get access to internal ITK data object.

The return value should immediately be assigned to as itk::SmartPointer.

In many cases the value may need to be dynamically cast to the actual transform type.

const itk::TransformBase* itk::simple::Transform::GetITKBase ( void  ) const

Get access to internal ITK data object.

The return value should immediately be assigned to as itk::SmartPointer.

In many cases the value may need to be dynamically cast to the actual transform type.

virtual std::string itk::simple::Transform::GetName ( ) const
virtual
unsigned int itk::simple::Transform::GetNumberOfFixedParameters ( void  ) const

Get the number of fixed parameters

unsigned int itk::simple::Transform::GetNumberOfParameters ( void  ) const

Return the number of optimizable parameters

std::vector<double> itk::simple::Transform::GetParameters ( void  ) const

Set/Get Transform Parameter

template<unsigned int>
void itk::simple::Transform::InternalBSplineInitialization ( Image img)
private
template<typename TDisplacementType >
void itk::simple::Transform::InternalDisplacementInitialization ( Image img)
private
template<unsigned int VDimension>
void itk::simple::Transform::InternalInitialization ( TransformEnum  type,
itk::TransformBase base = SITK_NULLPTR 
)
private
template<class TransformType >
void itk::simple::Transform::InternalInitialization ( TransformType *  t)
private
void itk::simple::Transform::InternalInitialization ( itk::TransformBase base)
private
virtual bool itk::simple::Transform::IsLinear ( ) const
virtual
void itk::simple::Transform::MakeUnique ( void  )

Performs actually coping if needed to make object unique.

The Transform class by default performs lazy coping and assignment. This method make sure that coping actually happens to the itk::Transform pointed to is only pointed to by this object.

Transform& itk::simple::Transform::operator= ( const Transform )

Copy constructor and assignment operator.

Performs a shallow copy of the internal ITK transform. A deep copy will be done if the transform in modified.

void itk::simple::Transform::SetFixedParameters ( const std::vector< double > &  parameters)

Set/Get Fixed Transform Parameter

virtual void itk::simple::Transform::SetIdentity ( )
virtual
virtual bool itk::simple::Transform::SetInverse ( )
virtual

Try to change the current transform to it's inverse.

If the transform has an inverse, i.e. non-singular linear transforms, then a new ITK transform is created of the same type and this object is set to it.

However not all transform have a direct inverse, if the inverse does not exist or fails false will be returned and this transform will not be modified.

void itk::simple::Transform::SetParameters ( const std::vector< double > &  parameters)

Set/Get Transform Parameter

virtual void itk::simple::Transform::SetPimpleTransform ( PimpleTransformBase *  pimpleTransform)
protectedvirtual
std::string itk::simple::Transform::ToString ( void  ) const
std::vector< double > itk::simple::Transform::TransformPoint ( const std::vector< double > &  point) const

Apply transform to a point.

The dimension of the point must match the transform.

std::vector< double > itk::simple::Transform::TransformVector ( const std::vector< double > &  vector,
const std::vector< double > &  point 
) const

Apply transform to a vector at a point.

The ITK concept of a vector is a direction at a specific point, for example the difference between two points is a vector.

For linear transforms the point does not matter, in general the vector is transformed by the Jacobian with respect to point position.

The dimension of the vector and point must match the transform.

void itk::simple::Transform::WriteTransform ( const std::string &  filename) const

Member Data Documentation

PimpleTransformBase* itk::simple::Transform::m_PimpleTransform
private

Definition at line 318 of file sitkTransform.h.


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