1 #ifndef CXROUTETOTARGET_H
2 #define CXROUTETOTARGET_H
4 #include "org_custusx_filter_routetotarget_Export.h"
13 typedef std::vector< Eigen::Matrix4d >
M4Vector;
16 typedef boost::shared_ptr<class Branch>
BranchPtr;
24 void setBloodVesselVolume(
ImagePtr bloodVesselVolume);
26 Eigen::MatrixXd getCenterlinePositions(
vtkPolyDataPtr centerline_r);
27 void setSmoothing(
bool smoothing);
28 void processCenterline(
MeshPtr mesh);
30 void processBloodVesselCenterline(Eigen::MatrixXd positions);
31 void findClosestPointInBranches(
Vector3D targetCoordinate_r);
32 void findClosestPointInBloodVesselBranches(
Vector3D targetCoordinate_r);
33 void findRoutePositions();
34 void findRoutePositionsInBloodVessels();
35 void searchBranchUp(
BranchPtr searchBranchPtr,
int startIndex);
36 void searchBloodVesselBranchUp(
BranchPtr searchBranchPtr,
int startIndex);
41 bool makeConnectedAirwayAndBloodVesselRoute();
43 vtkPolyDataPtr addVTKPoints(std::vector< Eigen::Vector3d > positions);
45 static double calculateRouteLength(std::vector< Eigen::Vector3d > route);
46 void setBloodVesselRadius();
47 double calculateBloodVesselRadius(Eigen::Vector3d position, Eigen::Vector3d orientation);
48 double findDistanceToSegmentationEdge(
vtkImageDataPtr bloodVesselImage, Eigen::Vector3i indexVector, Eigen::Vector3d perpendicularVector,
int* dim,
double* spacing,
int direction);
49 void makeMarianaCenterlineFile(QString filename);
50 QJsonArray makeMarianaCenterlineJSON();
51 std::vector< Eigen::Vector3d > getRoutePositions();
52 std::vector< double > getCameraRotation();
54 double getTracheaLength();
55 static std::vector<Eigen::Vector3d> getRoutePositions(
MeshPtr route);
59 Eigen::MatrixXd mCLpoints;
60 bool mSmoothing =
true;
66 int mProjectedBloodVesselIndex;
69 std::vector< Eigen::Vector3d > mRoutePositions;
70 std::vector< Eigen::Vector3d > mExtendedRoutePositions;
71 std::vector< double > mCameraRotation;
72 std::vector< double > mExtendedCameraRotation;
73 std::vector< Eigen::Vector3d > mBloodVesselRoutePositions;
74 std::vector< Eigen::Vector3d > mMergedAirwayAndBloodVesselRoutePositions;
75 std::vector< int > mBranchingIndex;
76 std::vector<BranchPtr> mSearchBranchPtrVector;
77 std::vector<int> mSearchIndexVector;
78 Eigen::MatrixXd mConnectedPointsInBVCL;
79 bool checkIfRouteToTargetEndsAtEndOfLastBranch();
80 bool mPathToBloodVesselsFound =
false;
84 std::pair< Eigen::MatrixXd, Eigen::MatrixXd >
findLocalPointsInCT(
int closestCLIndex , Eigen::MatrixXd CLpoints);
87 double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
95 #endif // CXROUTETOTARGET_H