Medical Imaging Interaction Toolkit  2023.12.99-b884b24c
Medical Imaging Interaction Toolkit
mitk::AnisotropicIterativeClosestPointRegistration Class Reference

Implementation of the anisotropic iterative closest point (A-ICP) algoritm. More...

#include <mitkAnisotropicIterativeClosestPointRegistration.h>

Inheritance diagram for mitk::AnisotropicIterativeClosestPointRegistration:
Collaboration diagram for mitk::AnisotropicIterativeClosestPointRegistration:

Public Member Functions

 mitkClassMacroItkParent (AnisotropicIterativeClosestPointRegistration, itk::Object)
 
Pointer Clone () const
 
virtual void SetMaxIterations (unsigned int _arg)
 
virtual void SetThreshold (double _arg)
 
virtual void SetFRENormalizationFactor (double _arg)
 
virtual void SetSearchRadius (double _arg)
 
virtual void SetMaxIterationsInWeightedPointTransform (double _arg)
 
virtual double GetFRE ()
 
virtual unsigned int GetNumberOfIterations ()
 
virtual void SetTrimmFactor (double _arg)
 
virtual void SetMovingSurface (itk::SmartPointer< Surface > _arg)
 
virtual void SetFixedSurface (itk::SmartPointer< Surface > _arg)
 
virtual const TranslationGetTranslation ()
 
virtual const RotationGetRotation ()
 
void SetCovarianceMatricesMovingSurface (CovarianceMatrixList &list)
 
void SetCovarianceMatricesFixedSurface (CovarianceMatrixList &list)
 
void Update ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Types

typedef itk::Matrix< double, 3, 3 > CovarianceMatrix
 
typedef std::vector< CovarianceMatrixCovarianceMatrixList
 
typedef mitk::Vector3D Translation
 
typedef CovarianceMatrix Rotation
 
typedef std::pair< unsigned int, double > Correspondence
 
typedef std::vector< CorrespondenceCorrespondenceList
 

Protected Member Functions

 AnisotropicIterativeClosestPointRegistration ()
 
 ~AnisotropicIterativeClosestPointRegistration () override
 
void ComputeCorrespondences (vtkPoints *X, vtkPoints *Z, vtkKdTreePointLocator *Y, const CovarianceMatrixList &sigma_X, const CovarianceMatrixList &sigma_Y, CovarianceMatrixList &sigma_Z, CorrespondenceList &correspondences, const double radius)
 

Protected Attributes

unsigned int m_MaxIterations
 
double m_Threshold
 
double m_FRENormalizationFactor
 
double m_SearchRadius
 
double m_MaxIterationsInWeightedPointTransform
 
double m_FRE
 
double m_TrimmFactor
 
unsigned int m_NumberOfIterations
 
itk::SmartPointer< Surfacem_MovingSurface
 
itk::SmartPointer< Surfacem_FixedSurface
 
itk::SmartPointer< WeightedPointTransformm_WeightedPointTransform
 
CovarianceMatrixList m_CovarianceMatricesMovingSurface
 
CovarianceMatrixList m_CovarianceMatricesFixedSurface
 
Translation m_Translation
 
Rotation m_Rotation
 

Detailed Description

Implementation of the anisotropic iterative closest point (A-ICP) algoritm.

This class implements the anisotropic interative closest point (A-ICP) algorithm presented in L. Maier-Hein et al. in "Convergent Iterative Closest-Point Algorithm to Accomodate Anisotropic and Inhomogenous Localization Error.", IEEE T Pattern Anal 34 (8), 1520-1532, 2012. The algorithm computes the optimal transformation to align two surfaces. In addition to the surfaces a list of covariance matrices is used as input for every surface. Each covariance matrix represents the error of a specific vertex in the Surface. The covariance matrices for each surface can be defined by the user, or calculated by the CovarianceMatrixCalculator. In addition a trimmed algorithm version is provided to compute the registration of partial overlapping surfaces. The algorithm needs a clean surface non manifold edges and without duplicated vertices. In addition vtkCleanPolyData can be used to ensure a correct Surface representation.

Note
The correspondence search is accelerated when OpenMP is enabled.

Example:

typedef itk::Matrix < double, 3, 3 > Matrix3x3;
typedef itk::Vector < double, 3 > Vector3;
typedef std::vector < Matrix3x3 > CovarianceMatrixList;
// compute the covariance matrices
mitk::CovarianceMatrixCalculator::Pointer matrixCalculator =
// compute the covariance matrices for the moving surface (X)
matrixCalculator->SetInputSurface(movingSurface);
matrixCalculator->ComputeCovarianceMatrices();
CovarianceMatrixList sigmas_X = matrixCalculator->GetCovarianceMatrices();
double meanVarX = matrixCalculator->GetMeanVariance();
// compute the covariance matrices for the fixed surface (Y)
matrixCalculator->SetInputSurface(fixedSurface);
matrixCalculator->ComputeCovarianceMatrices();
CovarianceMatrixList sigmas_Y = matrixCalculator->GetCovarianceMatrices();
double meanVarY = matrixCalculator->GetMeanVariance();
// the FRE normalization factor
double normalizationFactor = sqrt( meanVarX + meanVarY);
// A-ICP algorithm
mitk::AnisotropicIterativeClosestPointRegistration::Pointer aICP =
// set up parameters
aICP->SetMovingSurface(movingSurface);
aICP->SetFixedSurface(fixedSurface);
aICP->SetCovarianceMatricesMovingSurface(sigmas_X);
aICP->SetCovarianceMatricesFixedSurface(sigmas_Y);
aICP->SetFRENormalizationFactor(normalizationFactor);
// Trimming is enabled if a fator > 0.0 is set.
// 40 percent of the moving point set
// will be used for registration in this example.
// To disable trimming set the trim factor back to 0.0
aICP->SetTrimmFactor(0.4);
// run the algorithm
aICP->Update();
// retrieve the computed transformation
Matrix3x3 rotation = aICP->GetRotation();
Vector3 translation = aICP->GetTranslation();

Definition at line 114 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Member Typedef Documentation

◆ Correspondence

typedef std::pair<unsigned int, double> mitk::AnisotropicIterativeClosestPointRegistration::Correspondence
protected

Definition of a correspondeces, index and distance.

Definition at line 126 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ CorrespondenceList

Definition of a list of correspondences.

Definition at line 128 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ CovarianceMatrix

typedef itk::Matrix<double, 3, 3> mitk::AnisotropicIterativeClosestPointRegistration::CovarianceMatrix
protected

Definition of a 3x3 covariance matrix.

Definition at line 118 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ CovarianceMatrixList

Definition of a list of covariance matrices.

Definition at line 120 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ Rotation

Definition of a 3x3 rotation matrix.

Definition at line 124 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ Translation

Definition of a translation vector.

Definition at line 122 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Constructor & Destructor Documentation

◆ AnisotropicIterativeClosestPointRegistration()

mitk::AnisotropicIterativeClosestPointRegistration::AnisotropicIterativeClosestPointRegistration ( )
protected

◆ ~AnisotropicIterativeClosestPointRegistration()

mitk::AnisotropicIterativeClosestPointRegistration::~AnisotropicIterativeClosestPointRegistration ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::AnisotropicIterativeClosestPointRegistration::Clone ( ) const

◆ ComputeCorrespondences()

void mitk::AnisotropicIterativeClosestPointRegistration::ComputeCorrespondences ( vtkPoints *  X,
vtkPoints *  Z,
vtkKdTreePointLocator *  Y,
const CovarianceMatrixList sigma_X,
const CovarianceMatrixList sigma_Y,
CovarianceMatrixList sigma_Z,
CorrespondenceList correspondences,
const double  radius 
)
protected

Method that computes the correspondences between the moving point set X and the fixed point set Y. The distances between the points are weighted with weight matrices that are computed from the covariances along the surfaces axes. This method implements the runtime optimization presented by L. Maier-Hein et al.. The correspondences are computed with the help of a kd tree. The correspondences are searched in a given radius in the euklidian space. Every correspondence found in this radius is weighted based on the covariance matrices and the best weighting will be used as a correspondence.

Parameters
XThe moving point set.
ZThe returned correspondences from the fixed point set.
YThe fixed point set saved in a kd tree.
sigma_XCovariance matrices belonging to the moving point set.
sigma_YCovariance matrices belonging to the fixed point set.
sigma_ZCovariance matrices belonging to the correspondences found.
correspondencesSaved correspondences, in a pair containing the their index in Y and distance.
radiusThe search radius used in in kd tree.

◆ GetFRE()

virtual double mitk::AnisotropicIterativeClosestPointRegistration::GetFRE ( )
virtual

Get the fiducial registration error (FRE).

◆ GetNumberOfIterations()

virtual unsigned int mitk::AnisotropicIterativeClosestPointRegistration::GetNumberOfIterations ( )
virtual

Get the number of iterations used by the algorithm.

◆ GetRotation()

virtual const Rotation& mitk::AnisotropicIterativeClosestPointRegistration::GetRotation ( )
virtual

Returns the 3x3 rotation matrix computed by the algorithm.

◆ GetTranslation()

virtual const Translation& mitk::AnisotropicIterativeClosestPointRegistration::GetTranslation ( )
virtual

Returns the 3x1 translation vector computed by the algorithm.

◆ mitkClassMacroItkParent()

mitk::AnisotropicIterativeClosestPointRegistration::mitkClassMacroItkParent ( AnisotropicIterativeClosestPointRegistration  ,
itk::Object   
)

◆ New()

static Pointer mitk::AnisotropicIterativeClosestPointRegistration::New ( )
static

◆ SetCovarianceMatricesFixedSurface()

void mitk::AnisotropicIterativeClosestPointRegistration::SetCovarianceMatricesFixedSurface ( CovarianceMatrixList list)
inline

Set the covariance matrices of the fixed surface. The algorithm need the same amount of covariance and points available in the surface. The covariance matrix for every vertex in a Surface can be calculated by the CovarianceMatrixCalculator. It is also possible to define arbitrary matrices by hand.

Definition at line 295 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ SetCovarianceMatricesMovingSurface()

void mitk::AnisotropicIterativeClosestPointRegistration::SetCovarianceMatricesMovingSurface ( CovarianceMatrixList list)
inline

Set the covariance matrices of the moving surface. The algorithm need the same amount of covariance and points available in the surface. The covariance matrix for every vertex in a Surface can be calculated by the CovarianceMatrixCalculator. It is also possible to define arbitrary matrices by hand.

Definition at line 283 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ SetFixedSurface()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetFixedSurface ( itk::SmartPointer< Surface _arg)
virtual

Set fixed surface that includes the point set (Y).

◆ SetFRENormalizationFactor()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetFRENormalizationFactor ( double  _arg)
virtual

Set the normalization factor for the fiducial registration error (FRE). The normalization factor is computed with the help of the mean variance of both CovarianceMatrixList that can be obtained when the covariance matrices are calculated with the CovarianceMatrixCalculator:

double FRENormalizationFactor = sqrt ( MeanVarianceX + MeanVarianceY );

if no FRE normalization is used the normalization factor is set to 1.0 as default value.

◆ SetMaxIterations()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetMaxIterations ( unsigned int  _arg)
virtual

Set the maximum amount of iterations used by the algorithm.

◆ SetMaxIterationsInWeightedPointTransform()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetMaxIterationsInWeightedPointTransform ( double  _arg)
virtual

Set the maximim number of iterations used by the point based registration algorithm.

◆ SetMovingSurface()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetMovingSurface ( itk::SmartPointer< Surface _arg)
virtual

Set moving surface that includes the point set (X).

◆ SetSearchRadius()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetSearchRadius ( double  _arg)
virtual

Set search radius for the correspondence search.

◆ SetThreshold()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetThreshold ( double  _arg)
virtual

Set the threshold used to terminate the algorithm.

◆ SetTrimmFactor()

virtual void mitk::AnisotropicIterativeClosestPointRegistration::SetTrimmFactor ( double  _arg)
virtual

Factor that trimms the point set in percent for partial overlapping surfaces. E.g. 0.4 will use 40 precent of the point set. To enable the trimmed version a factor > 0 and < 1 must be set. The default value is 0.0.

◆ Update()

void mitk::AnisotropicIterativeClosestPointRegistration::Update ( )

This method executes the algorithm.

Warning
The algorithm is only a simple calculation filter and can not be used in a mitk filter pipline.
Exceptions
Exceptionif the search radius was doubled more than 20 times to prevent endless loops. Re-run the with a different search radius that will find the correspondences.

Member Data Documentation

◆ m_CovarianceMatricesFixedSurface

CovarianceMatrixList mitk::AnisotropicIterativeClosestPointRegistration::m_CovarianceMatricesFixedSurface
protected

The covariance matrices belonging to the moving surface (Y).

Definition at line 171 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_CovarianceMatricesMovingSurface

CovarianceMatrixList mitk::AnisotropicIterativeClosestPointRegistration::m_CovarianceMatricesMovingSurface
protected

The covariance matrices belonging to the moving surface (X).

Definition at line 168 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_FixedSurface

itk::SmartPointer<Surface> mitk::AnisotropicIterativeClosestPointRegistration::m_FixedSurface
protected

The fixed / target surface.

Definition at line 162 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_FRE

double mitk::AnisotropicIterativeClosestPointRegistration::m_FRE
protected

The fiducial registration error (FRE).

Definition at line 151 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_FRENormalizationFactor

double mitk::AnisotropicIterativeClosestPointRegistration::m_FRENormalizationFactor
protected

Normalization factor for the feducial registration error. default is 0.0.

Definition at line 140 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_MaxIterations

unsigned int mitk::AnisotropicIterativeClosestPointRegistration::m_MaxIterations
protected

Max amount of iterations. Default is 1000.

Definition at line 134 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_MaxIterationsInWeightedPointTransform

double mitk::AnisotropicIterativeClosestPointRegistration::m_MaxIterationsInWeightedPointTransform
protected

The maximum number of iterations in the weighted point based registration. Default is 1000.

Definition at line 148 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_MovingSurface

itk::SmartPointer<Surface> mitk::AnisotropicIterativeClosestPointRegistration::m_MovingSurface
protected

Moving surface that is transformed on the fixed surface.

Definition at line 160 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_NumberOfIterations

unsigned int mitk::AnisotropicIterativeClosestPointRegistration::m_NumberOfIterations
protected

Amount of iterations used by the algorithm.

Definition at line 157 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_Rotation

Rotation mitk::AnisotropicIterativeClosestPointRegistration::m_Rotation
protected

The computed 3x3 rotation matrix.

Definition at line 176 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_SearchRadius

double mitk::AnisotropicIterativeClosestPointRegistration::m_SearchRadius
protected

Search radius for the correspondence search. Default is 30.

Definition at line 143 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_Threshold

double mitk::AnisotropicIterativeClosestPointRegistration::m_Threshold
protected

Threshold used for termination. Default is 1.0e-6.

Definition at line 137 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_Translation

Translation mitk::AnisotropicIterativeClosestPointRegistration::m_Translation
protected

The computed 3x1 translation vector.

Definition at line 174 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_TrimmFactor

double mitk::AnisotropicIterativeClosestPointRegistration::m_TrimmFactor
protected

Trimmfactor for partial overlapping registration. Default is 0.

Definition at line 154 of file mitkAnisotropicIterativeClosestPointRegistration.h.

◆ m_WeightedPointTransform

itk::SmartPointer<WeightedPointTransform> mitk::AnisotropicIterativeClosestPointRegistration::m_WeightedPointTransform
protected

The weighted point based registration algorithm.

Definition at line 165 of file mitkAnisotropicIterativeClosestPointRegistration.h.


The documentation for this class was generated from the following file:
mitk::AnisotropicIterativeClosestPointRegistration::CovarianceMatrixList
std::vector< CovarianceMatrix > CovarianceMatrixList
Definition: mitkAnisotropicIterativeClosestPointRegistration.h:120
mitk::CovarianceMatrixCalculator::New
static Pointer New()
mitk::AnisotropicIterativeClosestPointRegistration::New
static Pointer New()