Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __WEIGHTEDPOINTTRANSFORM_H__
18 #define __WEIGHTEDPOINTTRANSFORM_H__
19 
20 // EXPORTS
22 
23 // ITK
24 #include <itkMatrix.h>
25 #include <itkVariableSizeMatrix.h>
26 #include <mitkCommon.h>
27 #include <mitkPointSet.h>
28 #include <vector>
29 #include <vtkSmartPointer.h>
30 
31 // forward declarations
32 class vtkPoints;
33 class vtkLandmarkTransform;
34 
35 namespace mitk
36 {
57  {
59  typedef itk::Matrix<double, 3, 3> Matrix3x3;
61  typedef Matrix3x3 WeightMatrix;
63  typedef Matrix3x3 Rotation;
65  typedef itk::Vector<double, 3> Translation;
67  typedef std::vector<WeightMatrix> WeightMatrixList;
69  typedef std::vector<Matrix3x3> CovarianceMatrixList;
70 
71  public:
73  itkFactorylessNewMacro(Self);
74  itkCloneMacro(Self)
75 
76 
77  void ComputeTransformation();
78 
80  itkSetMacro(Threshold, double)
81 
82 
85  itkSetMacro(MaxIterations, double)
86 
87 
91  itkGetMacro(Iterations, int);
92 
96  itkGetMacro(FRE, double);
97 
99  itkSetMacro(FRENormalizationFactor, double);
100 
102  itkGetMacro(FRENormalizationFactor, double);
103 
107  void SetMovingPointSet(vtkSmartPointer<vtkPoints> p);
108 
113  void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices);
114 
118  void SetFixedPointSet(vtkSmartPointer<vtkPoints> p);
119 
124  void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices);
125 
130  const Translation &GetTransformT() const { return m_Translation; }
134  const Rotation &GetTransformR() const { return m_Rotation; }
135  protected:
138 
140  double m_Threshold;
141 
144 
147 
149  double m_FRE;
150 
153 
155  vtkSmartPointer<vtkLandmarkTransform> m_LandmarkTransform;
156 
158  vtkSmartPointer<vtkPoints> m_FixedPointSet;
159 
161  vtkSmartPointer<vtkPoints> m_MovingPointSet;
162 
164  CovarianceMatrixList m_CovarianceMatricesMoving;
165 
167  CovarianceMatrixList m_CovarianceMatricesFixed;
168 
170  Translation m_Translation;
171 
173  Rotation m_Rotation;
174 
189  void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix<double> &returnValue);
190 
205  void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector<double> &returnValue);
206 
218  double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new);
219 
240  void WeightedPointRegister(vtkPoints *X,
241  vtkPoints *Y,
242  const CovarianceMatrixList &Sigma_X,
243  const CovarianceMatrixList &Sigma_Y,
244  double Threshold,
245  int MaxIterations,
246  Rotation &TransformationR,
247  Translation &TransformationT,
248  double &FRE,
249  int &n);
250  };
251 }
252 #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 Rotation & GetTransformR() const
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
vtkSmartPointer< vtkPoints > m_FixedPointSet
itk::Matrix< double, 3, 3 > Matrix3x3
const Translation & GetTransformT() const
CovarianceMatrixList m_CovarianceMatricesMoving