CustusX  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
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
boost::shared_ptr< class BranchList > BranchListPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Branch > BranchPtr
double findDistanceWithOrientation(Eigen::VectorXd position1, Eigen::VectorXd position2, Eigen::VectorXd orientation1, Eigen::VectorXd orientation2, double alpha)
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
std::vector< Eigen::Matrix4d > M4Vector
boost::shared_ptr< class BronchoscopePositionProjection > BronchoscopePositionProjectionPtr
Namespace for all CustusX production code.