NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxBronchoscopePositionProjection.h
Go to the documentation of this file.
1 #ifndef CXBRONCHOSCOPEPOSITIONPROJECTION_H
2 #define CXBRONCHOSCOPEPOSITIONPROJECTION_H
3 
4 #include "org_custusx_bronchoscopynavigation_Export.h"
6 #include "cxMesh.h"
7 #include <QDomElement>
8 
9 
10 namespace cx
11 {
12 
13 typedef std::vector< Eigen::Matrix4d > M4Vector;
14 typedef boost::shared_ptr<class BronchoscopePositionProjection> BronchoscopePositionProjectionPtr;
15 
16 class org_custusx_bronchoscopynavigation_EXPORT BronchoscopePositionProjection
17 {
18 public:
21  void setRunFromWidget(bool runFromWidget);
23  void setAdvancedCenterlineOption(bool useAdvancedCenterlineProjection);
24  void createMaxDistanceToCenterlineOption(QDomElement root);
25  DoublePropertyPtr getMaxDistanceToCenterlineOption();
26  double getMaxDistanceToCenterlineValue();
27  void createMaxSearchDistanceOption(QDomElement root);
28  DoublePropertyPtr getMaxSearchDistanceOption();
29  double getMaxSearchDistanceValue();
30  void createAlphaOption(QDomElement root);
31  DoublePropertyPtr getAlphaOption();
32  double getAlphaValue();
33  Eigen::MatrixXd getCenterlinePositions(vtkPolyDataPtr centerline, Transform3D rMd);
34  void processCenterline(vtkPolyDataPtr centerline, Transform3D rMd, Transform3D rMpr);
35  void setBranchList(BranchListPtr branchList, Transform3D rMpr);
36  void setMaxDistanceToCenterline(double maxDistance);
37  void setMaxSearchDistance(double maxDistance);
38  void setAlpha(double alpha);
39  Transform3D findClosestPoint(Transform3D prMt, double maxDistance);
40  Transform3D findClosestPointInBranches(Transform3D prMt, double maxDistance);
41  Transform3D findClosestPointInSearchPositions(Transform3D prMt, double maxDistance);
42  void findSearchPositions(double maxSearchDistance);
43  void searchBranchUp(BranchPtr searchBranchPtr, int startIndex, double currentSearchDistance, double maxSearchDistance);
44  void searchBranchDown(BranchPtr searchBranchPtr, int startIndex, double currentSearchDistance, double maxSearchDistance);
45  Transform3D findProjectedPoint(Transform3D prMt, double maxDistance, double maxSearchDistance);
46  bool isAdvancedCenterlineProjectionSelected();
47  Transform3D updateProjectedCameraOrientation(Transform3D prMt, BranchPtr branch, int index);
48 
49 private:
50  bool isPreviousProjectedPointSet;
51  Eigen::MatrixXd mCLpoints;
52  DoublePropertyPtr mMaxDistanceToCenterline;
53  DoublePropertyPtr mMaxSearchDistance;
54  DoublePropertyPtr mAlpha;
55  double mMaxDistanceToCenterlineValue;
56  double mMaxSearchDistanceValue;
57  double mAlphaValue;
58  BranchListPtr mBranchListPtr;
59  BranchPtr mProjectedBranchPtr;
60  int mProjectedIndex;
61  std::vector<BranchPtr> mSearchBranchPtrVector;
62  std::vector<int> mSearchIndexVector;
63  bool mUseAdvancedCenterlineProjection;
64  Vector3D mProjectedViewDirection;
65  Transform3D m_rMpr;
66  bool mRunFromWidget = true;
67 };
68 double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
69 double findDistanceWithOrientation(Eigen::VectorXd p1, Eigen::VectorXd p2, Eigen::VectorXd o1, Eigen::VectorXd o2, double alpha);
70 
71 } /* namespace cx */
72 
73 #endif // CXBRONCHOSCOPEPOSITIONPROJECTION_H
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BranchListPtr
boost::shared_ptr< class BranchList > BranchListPtr
Definition: cxForwardDeclarations.h:151
cxForwardDeclarations.h
cx::findDistanceWithOrientation
double findDistanceWithOrientation(Eigen::VectorXd position1, Eigen::VectorXd position2, Eigen::VectorXd orientation1, Eigen::VectorXd orientation2, double alpha)
Definition: cxBronchoscopePositionProjection.cpp:383
cx::BranchPtr
boost::shared_ptr< class Branch > BranchPtr
Definition: cxForwardDeclarations.h:150
cx::DoublePropertyPtr
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Definition: cxReconstructionMethodService.h:33
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:13
cx::vtkPolyDataPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
Definition: cxCenterlineRegistration.h:42
cx::BronchoscopePositionProjectionPtr
boost::shared_ptr< class BronchoscopePositionProjection > BronchoscopePositionProjectionPtr
Definition: cxBronchoscopePositionProjection.h:14
cx::BronchoscopePositionProjection
Definition: cxBronchoscopePositionProjection.h:16
cxMesh.h
cx::findDistance
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
Definition: cxBronchoscopePositionProjection.cpp:372
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42