ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkLandmarkBasedTransformInitializer.h>
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 the Affine transformation the number of landmarks must be greater than the landmark dimensionality. If this is not the case an exception is thrown. In the case of the VersorRigid3DTransform and Rigid2DTransform the number of landmarks must be equal or greater than the landmark dimensionality. If this is not the case, only the translational component of the transformation is computed and the rotation is the identity. 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
Definition at line 88 of file itkLandmarkBasedTransformInitializer.h.
Public Types | |
using | AffineTransformType = AffineTransform< ParametersValueType, FixedImageType::ImageDimension > |
using | BSplineTransformType = BSplineTransform< ParametersValueType, FixedImageType::ImageDimension, SplineOrder > |
using | ConstPointer = SmartPointer< const Self > |
using | FixedImagePointer = typename FixedImageType::ConstPointer |
using | FixedImageType = TFixedImage |
using | InputPointType = typename TransformType::InputPointType |
using | LandmarkPointContainer = std::vector< LandmarkPointType > |
using | LandmarkPointType = Point< double, ImageDimension > |
using | LandmarkWeightConstIterator = LandmarkWeightType::const_iterator |
using | LandmarkWeightType = std::vector< double > |
using | MovingImagePointer = typename MovingImageType::ConstPointer |
using | MovingImageType = TMovingImage |
using | OutputVectorType = typename TransformType::OutputVectorType |
using | ParametersType = typename TransformType::ParametersType |
using | ParametersValueType = typename ParametersType::ValueType |
using | Pointer = SmartPointer< Self > |
using | PointsContainerConstIterator = typename LandmarkPointContainer::const_iterator |
using | Rigid2DTransformType = Rigid2DTransform< ParametersValueType > |
using | Self = LandmarkBasedTransformInitializer |
using | Superclass = Object |
using | TransformPointer = typename TransformType::Pointer |
using | TransformType = TTransform |
using | VersorRigid3DTransformType = VersorRigid3DTransform< ParametersValueType > |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
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 (const 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 |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexceptoverride |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
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 constexpr unsigned int | ImageDimension = FixedImageType::ImageDimension |
static constexpr unsigned int | InputSpaceDimension = TransformType::InputSpaceDimension |
static constexpr unsigned int | OutputSpaceDimension = TransformType::OutputSpaceDimension |
static constexpr unsigned int | SplineOrder = 3 |
Protected Member Functions | |
LandmarkBasedTransformInitializer () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~LandmarkBasedTransformInitializer () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &time) |
~Object () override | |
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 (TTransform2 *) |
void | InternalInitializeTransform (VersorRigid3DTransformType *) |
void | InternalInitializeTransform (Rigid2DTransformType *) |
void | InternalInitializeTransform (AffineTransformType *) |
void | InternalInitializeTransform (BSplineTransformType *) |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::AffineTransformType = AffineTransform< ParametersValueType, FixedImageType::ImageDimension > |
Definition at line 169 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::BSplineTransformType = BSplineTransform< ParametersValueType, FixedImageType::ImageDimension, SplineOrder> |
Definition at line 174 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 98 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::FixedImagePointer = typename FixedImageType::ConstPointer |
Definition at line 127 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::FixedImageType = TFixedImage |
Image Types to use in the initialization of the transform
Definition at line 118 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::InputPointType = typename TransformType::InputPointType |
Convenience type alias
Definition at line 134 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkPointContainer = std::vector< LandmarkPointType > |
Definition at line 138 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkPointType = Point< double, ImageDimension > |
Definition at line 137 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkWeightConstIterator = LandmarkWeightType::const_iterator |
Definition at line 144 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::LandmarkWeightType = std::vector< double > |
Definition at line 143 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::MovingImagePointer = typename MovingImageType::ConstPointer |
Definition at line 128 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::MovingImageType = TMovingImage |
Definition at line 119 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::OutputVectorType = typename TransformType::OutputVectorType |
Definition at line 135 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ParametersType = typename TransformType::ParametersType |
Definition at line 141 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::ParametersValueType = typename ParametersType::ValueType |
Definition at line 142 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Pointer = SmartPointer<Self> |
Definition at line 97 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::PointsContainerConstIterator = typename LandmarkPointContainer::const_iterator |
Definition at line 139 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Rigid2DTransformType = Rigid2DTransform< ParametersValueType > |
Definition at line 168 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Self = LandmarkBasedTransformInitializer |
Standard class type aliases.
Definition at line 95 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::Superclass = Object |
Definition at line 96 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::TransformPointer = typename TransformType::Pointer |
Definition at line 108 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::TransformType = TTransform |
Type of the transform to initialize
Definition at line 107 of file itkLandmarkBasedTransformInitializer.h.
using itk::LandmarkBasedTransformInitializer< TTransform, TFixedImage, TMovingImage >::VersorRigid3DTransformType = VersorRigid3DTransform< ParametersValueType > |
Supported Transform type alias
Definition at line 167 of file itkLandmarkBasedTransformInitializer.h.
|
protected |
|
overrideprotecteddefault |
|
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.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
|
virtual |
Initialize the transform from the landmarks
|
private |
fallback Initializer just sets transform to identity
|
private |
Initializer for VersorRigid3D
|
private |
Initializer for Rigid2DTransform
|
private |
Initializer for AffineTransform
|
private |
Initializer for BSplineTransform
|
static |
New macro for creation of through a Smart Pointer.
|
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.
|
virtual |
Set the number of control points to define the parametric domain for the BSpline transform
|
inline |
Set the Fixed landmark point containers
Definition at line 147 of file itkLandmarkBasedTransformInitializer.h.
|
inline |
Set the landmark weight point containers Weight includes diagonal elements of weight matrix
Definition at line 161 of file itkLandmarkBasedTransformInitializer.h.
|
inline |
Set the Moving landmark point containers
Definition at line 153 of file itkLandmarkBasedTransformInitializer.h.
|
virtual |
Set the reference image to define the parametric domain for the BSpline transform
|
virtual |
Set the transform to be initialized
|
static |
Determine the image dimension.
Definition at line 131 of file itkLandmarkBasedTransformInitializer.h.
|
static |
Dimension of parameters.
Definition at line 111 of file itkLandmarkBasedTransformInitializer.h.
|
private |
Definition at line 209 of file itkLandmarkBasedTransformInitializer.h.
|
private |
Definition at line 205 of file itkLandmarkBasedTransformInitializer.h.
|
private |
weights for affine landmarks
Definition at line 208 of file itkLandmarkBasedTransformInitializer.h.
|
private |
Definition at line 206 of file itkLandmarkBasedTransformInitializer.h.
|
private |
Definition at line 203 of file itkLandmarkBasedTransformInitializer.h.
|
private |
Definition at line 204 of file itkLandmarkBasedTransformInitializer.h.
|
static |
Definition at line 112 of file itkLandmarkBasedTransformInitializer.h.
|
static |
Definition at line 171 of file itkLandmarkBasedTransformInitializer.h.