Medical Imaging Interaction Toolkit  2016.11.0
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) static Pointer New()
 
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 ()
 

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 ()
 
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
// 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
// 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 118 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Member Typedef Documentation

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

Definition of a correspondeces, index and distance.

Definition at line 130 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Definition of a list of correspondences.

Definition at line 132 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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

Definition of a 3x3 covariance matrix.

Definition at line 122 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Definition of a list of covariance matrices.

Definition at line 124 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Definition of a 3x3 rotation matrix.

Definition at line 128 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Definition of a translation vector.

Definition at line 126 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Constructor & Destructor Documentation

mitk::AnisotropicIterativeClosestPointRegistration::AnisotropicIterativeClosestPointRegistration ( )
protected
mitk::AnisotropicIterativeClosestPointRegistration::~AnisotropicIterativeClosestPointRegistration ( )
protected

Member Function Documentation

Pointer mitk::AnisotropicIterativeClosestPointRegistration::Clone ( ) const
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.

Definition at line 61 of file mitkAnisotropicIterativeClosestPointRegistration.cpp.

References mitk::AnisotropicRegistrationCommon::CalculateWeightMatrix(), max(), and mitk::New().

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

Get the fiducial registration error (FRE).

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

Get the number of iterations used by the algorithm.

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

Returns the 3x3 rotation matrix computed by the algorithm.

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

Returns the 3x1 translation vector computed by the algorithm.

mitk::AnisotropicIterativeClosestPointRegistration::mitkClassMacroItkParent ( AnisotropicIterativeClosestPointRegistration  ,
itk::Object   
)
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 298 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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 286 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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

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

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.

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

Set the maximum amount of iterations used by the algorithm.

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

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

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

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

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

Set search radius for the correspondence search.

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

Set the threshold used to terminate the algorithm.

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.

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.

Definition at line 135 of file mitkAnisotropicIterativeClosestPointRegistration.cpp.

References mitk::ProgressBar::AddStepsToDo(), AICPComp, mitk::ProgressBar::GetInstance(), max(), MITK_DEBUG, mitkThrow, mitk::New(), mitk::ProgressBar::Progress(), mitk::AnisotropicRegistrationCommon::PropagateMatrices(), and mitk::AnisotropicRegistrationCommon::TransformPoints().

Member Data Documentation

CovarianceMatrixList mitk::AnisotropicIterativeClosestPointRegistration::m_CovarianceMatricesFixedSurface
protected

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

Definition at line 175 of file mitkAnisotropicIterativeClosestPointRegistration.h.

CovarianceMatrixList mitk::AnisotropicIterativeClosestPointRegistration::m_CovarianceMatricesMovingSurface
protected

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

Definition at line 172 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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

The fixed / target surface.

Definition at line 166 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_FRE
protected

The fiducial registration error (FRE).

Definition at line 155 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_FRENormalizationFactor
protected

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

Definition at line 144 of file mitkAnisotropicIterativeClosestPointRegistration.h.

unsigned int mitk::AnisotropicIterativeClosestPointRegistration::m_MaxIterations
protected

Max amount of iterations. Default is 1000.

Definition at line 138 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_MaxIterationsInWeightedPointTransform
protected

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

Definition at line 152 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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

Moving surface that is transformed on the fixed surface.

Definition at line 164 of file mitkAnisotropicIterativeClosestPointRegistration.h.

unsigned int mitk::AnisotropicIterativeClosestPointRegistration::m_NumberOfIterations
protected

Amount of iterations used by the algorithm.

Definition at line 161 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Rotation mitk::AnisotropicIterativeClosestPointRegistration::m_Rotation
protected

The computed 3x3 rotation matrix.

Definition at line 180 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_SearchRadius
protected

Search radius for the correspondence search. Default is 30.

Definition at line 147 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_Threshold
protected

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

Definition at line 141 of file mitkAnisotropicIterativeClosestPointRegistration.h.

Translation mitk::AnisotropicIterativeClosestPointRegistration::m_Translation
protected

The computed 3x1 translation vector.

Definition at line 178 of file mitkAnisotropicIterativeClosestPointRegistration.h.

double mitk::AnisotropicIterativeClosestPointRegistration::m_TrimmFactor
protected

Trimmfactor for partial overlapping registration. Default is 0.

Definition at line 158 of file mitkAnisotropicIterativeClosestPointRegistration.h.

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

The weighted point based registration algorithm.

Definition at line 169 of file mitkAnisotropicIterativeClosestPointRegistration.h.


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