NorMIT-nav  22.09
An IGT application
cxCenterlineRegistration.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CENTERLINEREGISTRATION_H_
12 #define CENTERLINEREGISTRATION_H_
13 
14 #include <vector>
15 #include "cxVector3D.h"
16 #include "cxTransform3D.h"
17 #include "org_custusx_registration_method_centerline_Export.h"
18 #include "vtkForwardDeclarations.h"
19 #include <map>
20 #include "cxTransform3D.h"
21 #include <vtkSmartPointer.h>
22 #include <vtkPoints.h>
23 #include <vtkPolyData.h>
24 #include <vtkLandmarkTransform.h>
25 
26 #include <itkEuler3DTransform.h>
27 #include <itkEuclideanDistancePointMetric.h>
28 #include <itkLevenbergMarquardtOptimizer.h>
29 #include <itkPointSetToPointSetRegistrationMethod.h>
30 #include <itkPointSet.h>
31 
32 
33 typedef std::vector< Eigen::Matrix4d > M4Vector;
34 
35 
36 namespace cx
37 {
38 
39 typedef std::map<double, Transform3D> TimedTransformMap;
40 typedef vtkSmartPointer<vtkDoubleArray> vtkDoubleArrayPtr;
41 typedef vtkSmartPointer<vtkPoints> vtkPointsPtr;
42 typedef vtkSmartPointer<vtkPolyData> vtkPolyDataPtr;
43 
44 class org_custusx_registration_method_centerline_EXPORT CenterlineRegistration
45 {
46 
47 public:
48  typedef itk::PointSet< float, 3 > PointSetType;
49  typedef PointSetType::PointType PointType;
50  typedef PointSetType::PointsContainer PointsContainer;
51  typedef PointSetType::PointsContainerPointer PointsContainerPtr;
52  typedef PointsContainer::Iterator PointsIterator;
53 
54  typedef itk::EuclideanDistancePointMetric<
58  typedef itk::Euler3DTransform< double > TransformType;
59  typedef itk::LevenbergMarquardtOptimizer OptimizerType;
60 
61  typedef itk::PointSetToPointSetRegistrationMethod<
64 
66  vtkPointsPtr smoothPositions(vtkPointsPtr centerline);
67  void UpdateScales(bool xRot, bool yRot, bool zRot, bool xTrans, bool yTrans, bool zTrans);
68  void SetFixedPoints(vtkPointsPtr points);
69  void SetMovingPoints(vtkPointsPtr points);
70  Transform3D FullRegisterMoving(Transform3D init_transform);
71  vtkPointsPtr processCenterline(vtkPolyDataPtr centerline, Transform3D rMd);
72  vtkPointsPtr ConvertTrackingDataToVTK(TimedTransformMap trackingData_prMt, Transform3D rMpr);
73  Transform3D runCenterlineRegistration(vtkPolyDataPtr centerline, Transform3D rMd, TimedTransformMap trackingData_prMt, Transform3D old_rMpr );
74  virtual ~CenterlineRegistration();
75 
76 private:
77  PointSetType::Pointer mFixedPointSet;
78  PointSetType::Pointer mMovingPointSet;
79 
80  RegistrationType::Pointer mRegistration;
81  TransformType::Pointer mTransform;
82  Transform3D mResultTransform;
83  bool mRegistrationUpdated;
84  OptimizerType::Pointer mOptimizer;
85 
86 };
87 
88 Eigen::Matrix4d registrationAlgorithm(M4Vector Tnavigation);
89 vtkPointsPtr convertTovtkPoints(Eigen::MatrixXd positions);
90 }//namespace cx
91 
92 #endif /* CENTERLINEREGISTRATION_H_ */
cx::CenterlineRegistration::PointSetType
itk::PointSet< float, 3 > PointSetType
Definition: cxCenterlineRegistration.h:48
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::CenterlineRegistration::PointsContainerPtr
PointSetType::PointsContainerPointer PointsContainerPtr
Definition: cxCenterlineRegistration.h:51
cx::CenterlineRegistration::PointsContainer
PointSetType::PointsContainer PointsContainer
Definition: cxCenterlineRegistration.h:50
cx::CenterlineRegistration::MetricType
itk::EuclideanDistancePointMetric< PointSetType, PointSetType > MetricType
Definition: cxCenterlineRegistration.h:57
cxVector3D.h
cx::CenterlineRegistration::RegistrationType
itk::PointSetToPointSetRegistrationMethod< PointSetType, PointSetType > RegistrationType
Definition: cxCenterlineRegistration.h:63
cx::registrationAlgorithm
Eigen::Matrix4d registrationAlgorithm(BranchListPtr branches, M4Vector Tnavigation, Transform3D old_rMpr)
Definition: cxBronchoscopyRegistration.cpp:269
cx::CenterlineRegistration::PointsIterator
PointsContainer::Iterator PointsIterator
Definition: cxCenterlineRegistration.h:52
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::M4Vector
std::vector< Eigen::Matrix4d > M4Vector
Definition: cxBronchoscopePositionProjection.h:12
cx::CenterlineRegistration::OptimizerType
itk::LevenbergMarquardtOptimizer OptimizerType
Definition: cxCenterlineRegistration.h:59
cx::CenterlineRegistration
Definition: cxCenterlineRegistration.h:44
cx::TimedTransformMap
std::map< double, Transform3D > TimedTransformMap
Definition: cxRecordSession.h:36
cx::vtkPointsPtr
vtkSmartPointer< vtkPoints > vtkPointsPtr
Definition: cxCenterlineRegistration.h:41
M4Vector
std::vector< Eigen::Matrix4d > M4Vector
Definition: cxCenterlineRegistration.h:33
vtkForwardDeclarations.h
cx::CenterlineRegistration::TransformType
itk::Euler3DTransform< double > TransformType
Definition: cxCenterlineRegistration.h:58
cx::vtkPolyDataPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
Definition: cxCenterlineRegistration.h:42
cxTransform3D.h
cx::convertTovtkPoints
vtkPointsPtr convertTovtkPoints(Eigen::MatrixXd positions)
Definition: cxBronchoscopyRegistration.cpp:119
cx::CenterlineRegistration::PointType
PointSetType::PointType PointType
Definition: cxCenterlineRegistration.h:49
cx::vtkDoubleArrayPtr
vtkSmartPointer< vtkDoubleArray > vtkDoubleArrayPtr
Definition: cxCenterlineRegistration.h:40