CustusX  20.03-rc1
An IGT application
cxRouteToTarget.h
Go to the documentation of this file.
1 #ifndef CXROUTETOTARGET_H
2 #define CXROUTETOTARGET_H
3 
4 #include "org_custusx_filter_routetotarget_Export.h"
5 
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 RouteToTarget> RouteToTargetPtr;
15 typedef boost::shared_ptr<class BranchList> BranchListPtr;
16 typedef boost::shared_ptr<class Branch> BranchPtr;
17 
18 
19 class org_custusx_filter_routetotarget_EXPORT RouteToTarget
20 {
21 public:
22  RouteToTarget();
23  virtual ~RouteToTarget();
24  //void setCenterline(vtkPolyDataPtr centerline);
25  Eigen::MatrixXd getCenterlinePositions(vtkPolyDataPtr centerline_r);
26  void processCenterline(MeshPtr mesh);
27  void findClosestPointInBranches(Vector3D targetCoordinate_r);
28  void findRoutePositions();
29  void searchBranchUp(BranchPtr searchBranchPtr, int startIndex);
30  vtkPolyDataPtr findRouteToTarget(PointMetricPtr targetPoint);
31  vtkPolyDataPtr findExtendedRoute(PointMetricPtr targetPoint);
32  vtkPolyDataPtr addVTKPoints(std::vector< Eigen::Vector3d > positions);
33  std::vector< Eigen::Vector3d > getBranchPositions(BranchPtr branchPtr, int startIndex);
34  void addRouteInformationToFile(VisServicesPtr services);
35  double calculateRouteLength(std::vector< Eigen::Vector3d > route);
36  void makeMarianaCenterlineFile(QString filename);
37  QJsonArray makeMarianaCenterlineJSON();
38 
39 
40 private:
41  Eigen::MatrixXd mCLpoints;
42  BranchListPtr mBranchListPtr;
43  BranchPtr mProjectedBranchPtr;
44  int mProjectedIndex;
45  Vector3D mTargetPosition;
46  std::vector< Eigen::Vector3d > mRoutePositions;
47  std::vector< Eigen::Vector3d > mExtendedRoutePositions;
48  std::vector< int > mBranchingIndex;
49  std::vector<BranchPtr> mSearchBranchPtrVector;
50  std::vector<int> mSearchIndexVector;
51  std::vector<Eigen::Vector3d> smoothBranch(BranchPtr branchPtr, int startIndex, Eigen::MatrixXd startPosition);
52 };
53 
54 double findDistanceToLine(Eigen::MatrixXd point, Eigen::MatrixXd line);
55 double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
56 
57 } /* namespace cx */
58 
59 #endif // CXROUTETOTARGET_H
boost::shared_ptr< class RouteToTarget > RouteToTargetPtr
Definition: cxAccusurf.h:12
double findDistanceToLine(Eigen::MatrixXd point, Eigen::MatrixXd line)
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
boost::shared_ptr< class BranchList > BranchListPtr
boost::shared_ptr< class Branch > BranchPtr
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
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 Mesh > MeshPtr
Namespace for all CustusX production code.
boost::shared_ptr< class PointMetric > PointMetricPtr