NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkICPBasedRegistration.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 niftkICPBasedRegistration_h
16 #define niftkICPBasedRegistration_h
17 
18 #include <niftkICPRegExports.h>
19 #include <vtkMatrix4x4.h>
20 #include <mitkDataNode.h>
21 #include <mitkPointSet.h>
22 #include <itkObject.h>
23 #include <itkObjectFactoryBase.h>
24 #include <vtkPolyData.h>
25 #include <vtkSmartPointer.h>
26 
27 namespace niftk {
28 
29 namespace ICPBasedRegistrationConstants
30 {
31 static const int DEFAULT_MAX_ITERATIONS = 2000;
32 static const int DEFAULT_MAX_POINTS = 8000;
33 static const int DEFAULT_TLS_ITERATIONS = 0; // Zero means 'off'.
34 static const int DEFAULT_TLS_PERCENTAGE = 50; // Should be (0-100].
35 }
36 
41 class NIFTKICPREG_EXPORT ICPBasedRegistration : public itk::Object
42 {
43 public:
44 
45  mitkClassMacroItkParent(ICPBasedRegistration, itk::Object)
46  itkNewMacro(ICPBasedRegistration)
47 
48  itkSetMacro(MaximumIterations, int);
49  itkSetMacro(MaximumNumberOfLandmarkPointsToUse, int);
50  itkSetMacro(CameraNode, mitk::DataNode::Pointer);
51  itkSetMacro(FlipNormals, bool);
52  itkSetMacro(TLSIterations, unsigned int);
53  itkSetMacro(TLSPercentage, unsigned int);
54 
61  double Update(const mitk::DataNode::Pointer fixedNode,
62  const mitk::DataNode::Pointer movingNode,
63  vtkMatrix4x4& transformMovingToFixed);
64 
68  static void NodeToPolyData (const mitk::DataNode::Pointer& node,
69  vtkPolyData& polyOut,
70  const mitk::DataNode::Pointer& cameranode = mitk::DataNode::Pointer(),
71  bool flipnormals = false);
72 
76  static void PointSetToPolyData (const mitk::PointSet::Pointer& pointsIn, vtkPolyData& polyOut);
77 
78 protected:
79 
80  ICPBasedRegistration(); // Purposefully hidden.
81  virtual ~ICPBasedRegistration(); // Purposefully hidden.
82 
83  ICPBasedRegistration(const ICPBasedRegistration&); // Purposefully not implemented.
84  ICPBasedRegistration& operator=(const ICPBasedRegistration&); // Purposefully not implemented.
85 
86 private:
87 
88  int m_MaximumIterations;
89  int m_MaximumNumberOfLandmarkPointsToUse;
90  unsigned int m_TLSIterations;
91  unsigned int m_TLSPercentage;
92  mitk::DataNode::Pointer m_CameraNode;
93  bool m_FlipNormals;
94 
95  double RunVTKICP(vtkPolyData* fixedPoly,
96  vtkPolyData* movingPoly,
97  vtkMatrix4x4& transformMovingToFixed);
98 
99 }; // end class
100 
101 } // end namespace
102 
103 #endif
static const int DEFAULT_MAX_POINTS
Definition: niftkICPBasedRegistration.h:32
static const int DEFAULT_MAX_ITERATIONS
Definition: niftkICPBasedRegistration.h:31
static const int DEFAULT_TLS_PERCENTAGE
Definition: niftkICPBasedRegistration.h:34
Class to perform a surface based registration of two MITK Surfaces/PointSets, using VTKs ICP...
Definition: niftkICPBasedRegistration.h:41
static const int DEFAULT_TLS_ITERATIONS
Definition: niftkICPBasedRegistration.h:33
Definition: niftkExceptionObject.h:21