Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
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 __WEIGHTEDPOINTTRANSFORM_H__
14 #define __WEIGHTEDPOINTTRANSFORM_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 {
53  {
55  typedef itk::Matrix<double, 3, 3> Matrix3x3;
57  typedef Matrix3x3 WeightMatrix;
59  typedef Matrix3x3 Rotation;
61  typedef itk::Vector<double, 3> Translation;
63  typedef std::vector<WeightMatrix> WeightMatrixList;
65  typedef std::vector<Matrix3x3> CovarianceMatrixList;
66 
67  public:
69  itkFactorylessNewMacro(Self);
70  itkCloneMacro(Self);
71 
73  void ComputeTransformation();
74 
76  itkSetMacro(Threshold, double);
77 
81  itkSetMacro(MaxIterations, double);
82 
87  itkGetMacro(Iterations, int);
88 
92  itkGetMacro(FRE, double);
93 
95  itkSetMacro(FRENormalizationFactor, double);
96 
98  itkGetMacro(FRENormalizationFactor, double);
99 
103  void SetMovingPointSet(vtkSmartPointer<vtkPoints> p);
104 
109  void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices);
110 
114  void SetFixedPointSet(vtkSmartPointer<vtkPoints> p);
115 
120  void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices);
121 
126  const Translation &GetTransformT() const { return m_Translation; }
130  const Rotation &GetTransformR() const { return m_Rotation; }
131  protected:
133  ~WeightedPointTransform() override;
134 
136  double m_Threshold;
137 
140 
143 
145  double m_FRE;
146 
149 
151  vtkSmartPointer<vtkLandmarkTransform> m_LandmarkTransform;
152 
154  vtkSmartPointer<vtkPoints> m_FixedPointSet;
155 
157  vtkSmartPointer<vtkPoints> m_MovingPointSet;
158 
160  CovarianceMatrixList m_CovarianceMatricesMoving;
161 
163  CovarianceMatrixList m_CovarianceMatricesFixed;
164 
166  Translation m_Translation;
167 
169  Rotation m_Rotation;
170 
185  void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix<double> &returnValue);
186 
201  void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector<double> &returnValue);
202 
214  double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new);
215 
235  void WeightedPointRegister(vtkPoints *X,
236  vtkPoints *Y,
237  const CovarianceMatrixList &Sigma_X,
238  const CovarianceMatrixList &Sigma_Y,
239  double Threshold,
240  int MaxIterations,
241  Rotation &TransformationR,
242  Translation &TransformationT,
243  double &FRE,
244  int &n);
245  };
246 }
247 #endif
This class implements an extension of the weighted point based registration algorithm from A...
vtkSmartPointer< vtkLandmarkTransform > m_LandmarkTransform
vtkSmartPointer< vtkPoints > m_MovingPointSet
DataCollection - Class to facilitate loading/accessing structured data.
CovarianceMatrixList m_CovarianceMatricesFixed
#define MITKALGORITHMSEXT_EXPORT
const Translation & GetTransformT() const
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
const Rotation & GetTransformR() const
vtkSmartPointer< vtkPoints > m_FixedPointSet
CovarianceMatrixList m_CovarianceMatricesMoving