Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkWeightedPointTransform.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkWeightedPointTransform_h
14 #define mitkWeightedPointTransform_h
15 
16 // EXPORTS
18 
19 // ITK
20 #include <itkMatrix.h>
21 #include <itkVariableSizeMatrix.h>
22 #include <mitkCommon.h>
23 #include <mitkPointSet.h>
24 #include <vector>
25 #include <vtkSmartPointer.h>
26 
27 // forward declarations
28 class vtkPoints;
29 class vtkLandmarkTransform;
30 
31 namespace mitk
32 {
51  {
53  typedef itk::Matrix<double, 3, 3> Matrix3x3;
55  typedef Matrix3x3 WeightMatrix;
57  typedef Matrix3x3 Rotation;
59  typedef itk::Vector<double, 3> Translation;
61  typedef std::vector<WeightMatrix> WeightMatrixList;
63  typedef std::vector<Matrix3x3> CovarianceMatrixList;
64 
65  public:
67  itkFactorylessNewMacro(Self);
68  itkCloneMacro(Self);
69 
72 
74  itkSetMacro(Threshold, double);
75 
79  itkSetMacro(MaxIterations, double);
80 
85  itkGetMacro(Iterations, int);
86 
90  itkGetMacro(FRE, double);
91 
93  itkSetMacro(FRENormalizationFactor, double);
94 
96  itkGetMacro(FRENormalizationFactor, double);
97 
102 
107  void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices);
108 
113 
118  void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices);
119 
124  const Translation &GetTransformT() const { return m_Translation; }
128  const Rotation &GetTransformR() const { return m_Rotation; }
129  protected:
132 
134  double m_Threshold;
135 
138 
141 
143  double m_FRE;
144 
147 
150 
153 
156 
158  CovarianceMatrixList m_CovarianceMatricesMoving;
159 
161  CovarianceMatrixList m_CovarianceMatricesFixed;
162 
164  Translation m_Translation;
165 
167  Rotation m_Rotation;
168 
183  void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix<double> &returnValue);
184 
199  void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector<double> &returnValue);
200 
212  double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new);
213 
233  void WeightedPointRegister(vtkPoints *X,
234  vtkPoints *Y,
235  const CovarianceMatrixList &Sigma_X,
236  const CovarianceMatrixList &Sigma_Y,
237  double Threshold,
238  int MaxIterations,
239  Rotation &TransformationR,
240  Translation &TransformationT,
241  double &FRE,
242  int &n);
243  };
244 }
245 #endif
#define MITKALGORITHMSEXT_EXPORT
This class implements an extension of the weighted point based registration algorithm from A....
const Rotation & GetTransformR() const
void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices)
CovarianceMatrixList m_CovarianceMatricesMoving
vtkSmartPointer< vtkPoints > m_MovingPointSet
void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix< double > &returnValue)
void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices)
double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new)
vtkSmartPointer< vtkLandmarkTransform > m_LandmarkTransform
void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector< double > &returnValue)
CovarianceMatrixList m_CovarianceMatricesFixed
void ComputeTransformation()
Method which registers both point sets.
vtkSmartPointer< vtkPoints > m_FixedPointSet
mitkClassMacroItkParent(WeightedPointTransform, itk::Object)
void WeightedPointRegister(vtkPoints *X, vtkPoints *Y, const CovarianceMatrixList &Sigma_X, const CovarianceMatrixList &Sigma_Y, double Threshold, int MaxIterations, Rotation &TransformationR, Translation &TransformationT, double &FRE, int &n)
This method performs a variant of the weighted point register algorithm presented by A....
void SetMovingPointSet(vtkSmartPointer< vtkPoints > p)
void SetFixedPointSet(vtkSmartPointer< vtkPoints > p)
const Translation & GetTransformT() const
Find image slices visible on a given plane.