NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkVTKIterativeClosestPoint.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkVTKIterativeClosestPoint_h
16 #define niftkVTKIterativeClosestPoint_h
17 
19 #include <vtkPolyData.h>
20 #include <vtkSmartPointer.h>
21 #include <vtkMatrix4x4.h>
22 #include <vtkCellLocator.h>
23 
24 namespace niftk {
25 
40 
41 public:
42 
45 
50  double Run();
51 
55  double GetRMSResidual(vtkPolyData &source) const;
56 
60  vtkSmartPointer<vtkMatrix4x4> GetTransform() const;
61 
65  void ApplyTransform(vtkPolyData *solution);
66 
70  void SetSource(vtkSmartPointer<vtkPolyData>);
71 
75  void SetTarget(vtkSmartPointer<vtkPolyData>);
76 
80  void SetICPMaxLandmarks(unsigned int);
81 
85  void SetICPMaxIterations(unsigned int);
86 
92  void SetTLSIterations(unsigned int);
93 
97  void SetTLSPercentage(unsigned int);
98 
99 private:
100 
101  vtkSmartPointer<vtkPolyData> m_Source;
102  vtkSmartPointer<vtkPolyData> m_Target;
103  vtkSmartPointer<vtkMatrix4x4> m_TransformMatrix;
104  vtkSmartPointer<vtkCellLocator> m_Locator;
105  unsigned int m_ICPMaxLandmarks;
106  unsigned int m_ICPMaxIterations;
107  unsigned int m_TLSPercentage;
108  unsigned int m_TLSIterations;
109 
110  int GetStepSize(vtkPolyData *source) const;
111 
112  bool CheckInverted(vtkPolyData *source, vtkPolyData *target) const;
113 
114  vtkSmartPointer<vtkMatrix4x4> InternalRunICP(vtkPolyData *source,
115  vtkPolyData *target,
116  unsigned int landmarks,
117  unsigned int iterations,
118  bool inverted
119  ) const;
120 
121  double InternalGetRMSResidual(vtkPolyData &source,
122  vtkCellLocator &locator,
123  vtkMatrix4x4 &matrix
124  ) const;
125 };
126 
127 } // end namespace
128 
129 #endif
Uses vtkIterativeClosestPointTransform to register two vtkPolyData sets.
Definition: niftkVTKIterativeClosestPoint.h:39
#define NIFTKVTK_WINEXPORT
Definition: niftkVTKWin32ExportHeader.h:28
GLuint GLenum matrix
Definition: glew.h:12775
Definition: niftkExceptionObject.h:21
GLsizei GLsizei GLchar * source
Definition: glew.h:1816
GLenum target
Definition: glew.h:5584