CustusX  22.04-rc3
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"
5 #include "cxMesh.h"
6 #include <QDomElement>
7 
8 
9 namespace cx
10 {
11 
12 typedef std::vector< Eigen::Matrix4d > M4Vector;
13 typedef boost::shared_ptr<class BronchoscopePositionProjection> BronchoscopePositionProjectionPtr;
14 typedef boost::shared_ptr<class BranchList> BranchListPtr;
15 typedef boost::shared_ptr<class Branch> BranchPtr;
16 
17 
18 class org_custusx_bronchoscopynavigation_EXPORT BronchoscopePositionProjection
19 {
20 public:
23  void setRunFromWidget(bool runFromWidget);
25  void setAdvancedCenterlineOption(bool useAdvancedCenterlineProjection);
26  void createMaxDistanceToCenterlineOption(QDomElement root);
27  DoublePropertyPtr getMaxDistanceToCenterlineOption();
28  double getMaxDistanceToCenterlineValue();
29  void createMaxSearchDistanceOption(QDomElement root);
30  DoublePropertyPtr getMaxSearchDistanceOption();
31  double getMaxSearchDistanceValue();
32  void createAlphaOption(QDomElement root);
33  DoublePropertyPtr getAlphaOption();
34  double getAlphaValue();
35  Eigen::MatrixXd getCenterlinePositions(vtkPolyDataPtr centerline, Transform3D rMd);
36  void processCenterline(vtkPolyDataPtr centerline, Transform3D rMd, Transform3D rMpr);
37  void setBranchList(BranchListPtr branchList, Transform3D rMpr);
38  void setMaxDistanceToCenterline(double maxDistance);
39  void setMaxSearchDistance(double maxDistance);
40  void setAlpha(double alpha);
41  Transform3D findClosestPoint(Transform3D prMt, double maxDistance);
42  Transform3D findClosestPointInBranches(Transform3D prMt, double maxDistance);
43  Transform3D findClosestPointInSearchPositions(Transform3D prMt, double maxDistance);
44  void findSearchPositions(double maxSearchDistance);
45  void searchBranchUp(BranchPtr searchBranchPtr, int startIndex, double currentSearchDistance, double maxSearchDistance);
46  void searchBranchDown(BranchPtr searchBranchPtr, int startIndex, double currentSearchDistance, double maxSearchDistance);
47  Transform3D findProjectedPoint(Transform3D prMt, double maxDistance, double maxSearchDistance);
48  bool isAdvancedCenterlineProjectionSelected();
49  Transform3D updateProjectedCameraOrientation(Transform3D prMt, BranchPtr branch, int index);
50 
51 private:
52  bool isPreviousProjectedPointSet;
53  Eigen::MatrixXd mCLpoints;
54  DoublePropertyPtr mMaxDistanceToCenterline;
55  DoublePropertyPtr mMaxSearchDistance;
56  DoublePropertyPtr mAlpha;
57  double mMaxDistanceToCenterlineValue;
58  double mMaxSearchDistanceValue;
59  double mAlphaValue;
60  BranchListPtr mBranchListPtr;
61  BranchPtr mProjectedBranchPtr;
62  int mProjectedIndex;
63  std::vector<BranchPtr> mSearchBranchPtrVector;
64  std::vector<int> mSearchIndexVector;
65  bool mUseAdvancedCenterlineProjection;
66  Vector3D mProjectedViewDirection;
67  Transform3D m_rMpr;
68  bool mRunFromWidget = true;
69 };
70 double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
71 double findDistanceWithOrientation(Eigen::VectorXd p1, Eigen::VectorXd p2, Eigen::VectorXd o1, Eigen::VectorXd o2, double alpha);
72 
73 } /* namespace cx */
74 
75 #endif // CXBRONCHOSCOPEPOSITIONPROJECTION_H
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class BranchList > BranchListPtr
boost::shared_ptr< class Branch > BranchPtr
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
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.