ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage > Class Template Reference

#include <itkLandmarkBasedTransformInitializer.h>

+ Inheritance diagram for itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >:
+ Collaboration diagram for itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >:

Detailed Description

template<typename TTransform, typename TFixedImage, typename TMovingImage>
class itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >

This class computes the transform that aligns the fixed and moving images given a set of pair landmarks. The class is templated over the Transform type as well as fixed image and moving image types. The transform computed gives the best fit transform that maps the fixed and moving images in a least squares sense. The indices are taken to correspond, so point 1 in the first set will get mapped close to point 1 in the second set, etc.

Currently, the following transforms are supported by the class: VersorRigid3DTransform Rigid2DTransform AffineTransform BSplineTransform

An equal number of fixed and moving landmarks need to be specified using SetFixedLandmarks() and SetMovingLandmarks(). Any number of landmarks may be specified. In the case of using Affine or BSpline transforms, each landmark pair can contribute in the final transform based on its defined weight. Number of weights should be equal to the number of landmarks and can be specified using SetLandmarkWeight(). By defaults are weights are set to one. Call InitializeTransform() to initialize the transform.

The class is based in part on Hybrid/vtkLandmarkTransform originally implemented in python by David G. Gobbi.

The solution is based on Berthold K. P. Horn (1987), "Closed-form solution of absolute orientation using unit quaternions," http://people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf

The Affine Transform initializer is based on an algorithm by H Spaeth, and is described in the Insight Journal Article "Affine Transformation for Landmark Based Registration Initializer in ITK" by Kim E.Y., Johnson H., Williams N. available at http://midasjournal.com/browse/publication/825

Wiki Examples:
Examples:
WikiExamples/Registration/LandmarkBasedTransformInitializer.cxx.

Definition at line 82 of file itkLandmarkBasedTransformInitializer.h.

Public Types

typedef AffineTransform
< ParametersValueType,
FixedImageType::ImageDimension > 
AffineTransformType
 
typedef BSplineTransform
< ParametersValueType,
FixedImageType::ImageDimension,
SplineOrder
BSplineTransformType
 
typedef SmartPointer< const SelfConstPointer
 
typedef
FixedImageType::ConstPointer 
FixedImagePointer
 
typedef TFixedImage FixedImageType
 
typedef
TransformType::InputPointType 
InputPointType
 
typedef std::vector
< LandmarkPointType
LandmarkPointContainer
 
typedef Point< double,
ImageDimension
LandmarkPointType
 
typedef
LandmarkWeightType::const_iterator 
LandmarkWeightConstIterator
 
typedef std::vector< double > LandmarkWeightType
 
typedef
MovingImageType::ConstPointer 
MovingImagePointer
 
typedef TMovingImage MovingImageType
 
typedef
TransformType::OutputVectorType 
OutputVectorType
 
typedef
TransformType::ParametersType 
ParametersType
 
typedef ParametersType::ValueType ParametersValueType
 
typedef SmartPointer< SelfPointer
 
typedef
LandmarkPointContainer::const_iterator 
PointsContainerConstIterator
 
typedef Rigid2DTransform
< ParametersValueType
Rigid2DTransformType
 
typedef
LandmarkBasedTransformInitializer 
Self
 
typedef Object Superclass
 
typedef TransformType::Pointer TransformPointer
 
typedef TTransform TransformType
 
typedef VersorRigid3DTransform
< ParametersValueType
VersorRigid3DTransformType
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
virtual void InitializeTransform ()
 
virtual void SetBSplineNumberOfControlPoints (unsigned int _arg)
 
void SetFixedLandmarks (const LandmarkPointContainer &fixedLandmarks)
 
void SetLandmarkWeight (LandmarkWeightType &landmarkWeight)
 
void SetMovingLandmarks (const LandmarkPointContainer &movingLandmarks)
 
virtual void SetReferenceImage (FixedImageType *_arg)
 
virtual void SetTransform (TransformType *_arg)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Static Public Attributes

static const unsigned int ImageDimension = FixedImageType::ImageDimension
 
static const unsigned int SplineOrder = 3
 
static const unsigned int InputSpaceDimension = TransformType::InputSpaceDimension
 
static const unsigned int OutputSpaceDimension = TransformType::OutputSpaceDimension
 

Protected Member Functions

 LandmarkBasedTransformInitializer ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~LandmarkBasedTransformInitializer ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

template<typename TTransform2 >
void InternalInitializeTransform (TTransform *)
 
void InternalInitializeTransform (VersorRigid3DTransformType *)
 
void InternalInitializeTransform (Rigid2DTransformType *)
 
void InternalInitializeTransform (AffineTransformType *)
 
void InternalInitializeTransform (BSplineTransformType *)
 
 LandmarkBasedTransformInitializer (const Self &)
 
void operator= (const Self &)
 

Private Attributes

unsigned int m_BSplineNumberOfControlPoints
 
LandmarkPointContainer m_FixedLandmarks
 
LandmarkWeightType m_LandmarkWeight
 
LandmarkPointContainer m_MovingLandmarks
 
FixedImagePointer m_ReferenceImage
 
TransformPointer m_Transform
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef AffineTransform< ParametersValueType, FixedImageType::ImageDimension > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::AffineTransformType

Definition at line 162 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef BSplineTransform< ParametersValueType, FixedImageType::ImageDimension, SplineOrder> itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::BSplineTransformType

Definition at line 167 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef SmartPointer<const Self> itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ConstPointer

Definition at line 90 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef FixedImageType::ConstPointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::FixedImagePointer

Definition at line 118 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TFixedImage itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::FixedImageType

Image Types to use in the initialization of the transform

Definition at line 108 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TransformType::InputPointType itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InputPointType

Convenience typedefs

Definition at line 127 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef std::vector< LandmarkPointType > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkPointContainer

Definition at line 131 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef Point< double, ImageDimension > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkPointType

Definition at line 130 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef LandmarkWeightType::const_iterator itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkWeightConstIterator

Definition at line 137 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef std::vector< double > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkWeightType

Definition at line 136 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef MovingImageType::ConstPointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::MovingImagePointer

Definition at line 121 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TMovingImage itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::MovingImageType

Definition at line 112 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TransformType::OutputVectorType itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::OutputVectorType

Definition at line 128 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TransformType::ParametersType itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ParametersType

Definition at line 134 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef ParametersType::ValueType itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ParametersValueType

Definition at line 135 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef SmartPointer<Self> itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Pointer

Definition at line 89 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef LandmarkPointContainer::const_iterator itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::PointsContainerConstIterator

Definition at line 132 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef Rigid2DTransform< ParametersValueType > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Rigid2DTransformType

Definition at line 161 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef LandmarkBasedTransformInitializer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Self

Standard class typedefs.

Definition at line 87 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef Object itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Superclass

Definition at line 88 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TransformType::Pointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::TransformPointer

Definition at line 100 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef TTransform itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::TransformType

Type of the transform to initialize

Definition at line 96 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
typedef VersorRigid3DTransform< ParametersValueType > itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::VersorRigid3DTransformType

Supported Transform typedefs

Definition at line 160 of file itkLandmarkBasedTransformInitializer.h.

Constructor & Destructor Documentation

template<typename TTransform , typename TFixedImage , typename TMovingImage >
itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkBasedTransformInitializer ( )
protected
template<typename TTransform , typename TFixedImage , typename TMovingImage >
itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::~LandmarkBasedTransformInitializer ( )
inlineprotected

Definition at line 174 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkBasedTransformInitializer ( const Self )
private

Member Function Documentation

template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual::itk::LightObject::Pointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual const char* itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InitializeTransform ( )
virtual

Initialize the transform from the landmarks

template<typename TTransform , typename TFixedImage , typename TMovingImage >
template<typename TTransform2 >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InternalInitializeTransform ( TTransform *  )
private

fallback Initializer just sets transform to identity

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InternalInitializeTransform ( VersorRigid3DTransformType )
private

Initializer for VersorRigid3D

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InternalInitializeTransform ( Rigid2DTransformType )
private

Initializer for Rigid2DTransform

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InternalInitializeTransform ( AffineTransformType )
private

Initializer for AffineTransform

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InternalInitializeTransform ( BSplineTransformType )
private

Initializer for BSplineTransform

template<typename TTransform , typename TFixedImage , typename TMovingImage >
static Pointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::New ( )
static

New macro for creation of through a Smart Pointer.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::operator= ( const Self )
private
template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetBSplineNumberOfControlPoints ( unsigned int  _arg)
virtual

Set the number of control points to define the parametric domain for the BSpline transform

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetFixedLandmarks ( const LandmarkPointContainer fixedLandmarks)
inline
template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetLandmarkWeight ( LandmarkWeightType landmarkWeight)
inline

Set the landmark weight point containers Weight includes diagonal elements of weight matrix

Definition at line 154 of file itkLandmarkBasedTransformInitializer.h.

References itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_LandmarkWeight.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetMovingLandmarks ( const LandmarkPointContainer movingLandmarks)
inline
template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetReferenceImage ( FixedImageType _arg)
virtual

Set the reference image to define the parametric domain for the BSpline transform

template<typename TTransform , typename TFixedImage , typename TMovingImage >
virtual void itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SetTransform ( TransformType _arg)
virtual

Set the transform to be initialized

Member Data Documentation

template<typename TTransform , typename TFixedImage , typename TMovingImage >
const unsigned int itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ImageDimension = FixedImageType::ImageDimension
static

Determine the image dimension.

Definition at line 124 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
const unsigned int itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InputSpaceDimension = TransformType::InputSpaceDimension
static

Dimension of parameters.

Definition at line 103 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
unsigned int itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_BSplineNumberOfControlPoints
private

Definition at line 205 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
LandmarkPointContainer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_FixedLandmarks
private
template<typename TTransform , typename TFixedImage , typename TMovingImage >
LandmarkWeightType itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_LandmarkWeight
private
template<typename TTransform , typename TFixedImage , typename TMovingImage >
LandmarkPointContainer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_MovingLandmarks
private
template<typename TTransform , typename TFixedImage , typename TMovingImage >
FixedImagePointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_ReferenceImage
private

Definition at line 199 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
TransformPointer itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::m_Transform
private

Definition at line 200 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
const unsigned int itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::OutputSpaceDimension = TransformType::OutputSpaceDimension
static

Dimension of parameters.

Definition at line 104 of file itkLandmarkBasedTransformInitializer.h.

template<typename TTransform , typename TFixedImage , typename TMovingImage >
const unsigned int itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::SplineOrder = 3
static

Definition at line 164 of file itkLandmarkBasedTransformInitializer.h.


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