NorMIT-nav  22.09
An IGT application
cxBranchList.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef BRANCHLIST_H_
12 #define BRANCHLIST_H_
13 
14 #include "cxBranch.h"
15 #include "cxMesh.h"
16 #include "cxVector3D.h"
17 #include "org_custusx_registration_method_bronchoscopy_Export.h"
18 
19 
20 namespace cx
21 {
22 
23 typedef std::vector< Eigen::Matrix4d > M4Vector;
24 typedef boost::shared_ptr<class BranchList> BranchListPtr;
25 
26 #define MAX_ROTATION_TO_TILT_DOWN_DEGREES 30 //Threshold between rotation direction of scope to tilt up or down in a bifurcation.
27 
28 class org_custusx_registration_method_bronchoscopy_EXPORT BranchList
29 {
30  std::vector<BranchPtr> mBranches;
31 public:
32  BranchList();
33  virtual ~BranchList();
34  void addBranch(BranchPtr b);
35  void deleteBranch(BranchPtr b);
36  void deleteAllBranches();
37  std::vector<BranchPtr> getBranches();
38  void findBranchesInCenterline(Eigen::MatrixXd positions_r, bool sortByZindex = true);
39  void selectGenerations(int maxGeneration);
40  void findBronchoscopeRotation();
41  void calculateBronchoscopeRotation(BranchPtr branch);
42  void smoothOrientations();
43  void smoothRadius();
44  BranchPtr findBranchWithLargestRadius();
45  void interpolateBranchPositions(double resolution);
46  void smoothBranchPositions(int controlPointDistance);
47  void excludeClosePositionsInCTCenterline(double minPointDistance);
48  void markLungLap(QString name, Vector3D position);
49  void setLapName(BranchPtr branch, QString name);
50  QString findClosestLungLap(Vector3D position);
51  double findDistance(Vector3D p1, Vector3D p2);
52  BranchPtr findClosestBranch(Vector3D targetCoordinate_r);
53  BranchListPtr removePositionsForLocalRegistration(Eigen::MatrixXd trackingPositions, double maxDistance);
54  vtkPolyDataPtr createVtkPolyDataFromBranches(bool fullyConnected = false, bool straightBranches = false) const;
55 };
56 
57 std::pair<Eigen::MatrixXd,Eigen::MatrixXd > org_custusx_registration_method_bronchoscopy_EXPORT findConnectedPointsInCT(int startIndex , Eigen::MatrixXd positionsNotUsed);
58 Eigen::MatrixXd sortMatrix(int rowNumber, Eigen::MatrixXd matrix);
59 Eigen::MatrixXd org_custusx_registration_method_bronchoscopy_EXPORT eraseCol(int removeIndex, Eigen::MatrixXd positions);
60 std::pair<Eigen::MatrixXd::Index, double> org_custusx_registration_method_bronchoscopy_EXPORT dsearch(Eigen::Vector3d p, Eigen::MatrixXd positions);
61 std::pair<std::vector<Eigen::MatrixXd::Index>, Eigen::VectorXd > org_custusx_registration_method_bronchoscopy_EXPORT dsearchn(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
62 std::vector<Eigen::Vector3d> org_custusx_registration_method_bronchoscopy_EXPORT smoothBranch(BranchPtr branchPtr, int startIndex, Eigen::MatrixXd startPosition);
63 double bendingDirectionToBronchoscopeRotation(Vector3D bendingDirection, Vector3D parentBranchOrientation, double parentRotation);
65 
66 }//namespace cx
67 
68 #endif /* BRANCHLIST_H_ */
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::dsearch
std::pair< Eigen::MatrixXd::Index, double > dsearch(Eigen::Vector3d p, Eigen::MatrixXd positions)
Definition: cxBranchList.cpp:636
cx::findDistance
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
Definition: cxBronchoscopePositionProjection.cpp:372
cxVector3D.h
cx::calculateBronchoscopeBendingDirection
Vector3D calculateBronchoscopeBendingDirection(Vector3D A, Vector3D B)
Definition: cxBranchList.cpp:165
cx::M4Vector
std::vector< Eigen::Matrix4d > M4Vector
Definition: cxBronchoscopePositionProjection.h:12
cx::smoothBranch
std::vector< Eigen::Vector3d > smoothBranch(BranchPtr branchPtr, int startIndex, Eigen::MatrixXd startPosition)
Definition: cxBranchList.cpp:705
cx::dsearchn
std::pair< std::vector< Eigen::MatrixXd::Index >, Eigen::VectorXd > dsearchn(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
Definition: cxBranchList.cpp:646
cxBranch.h
cx::findConnectedPointsInCT
std::pair< Eigen::MatrixXd, Eigen::MatrixXd > findConnectedPointsInCT(int startIndex, Eigen::MatrixXd positionsNotUsed)
Definition: cxBranchList.cpp:661
cx::vtkPolyDataPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
Definition: cxCenterlineRegistration.h:42
cx::BranchList
Definition: cxBranchList.h:28
cx::BranchListPtr
boost::shared_ptr< class BranchList > BranchListPtr
Definition: cxBronchoscopePositionProjection.h:14
cx::eraseCol
Eigen::MatrixXd eraseCol(int removeIndex, Eigen::MatrixXd positions)
Definition: cxBranchList.cpp:629
cx::BranchPtr
boost::shared_ptr< class Branch > BranchPtr
Definition: cxBronchoscopePositionProjection.h:15
cxMesh.h
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::bendingDirectionToBronchoscopeRotation
double bendingDirectionToBronchoscopeRotation(Vector3D bendingDirection, Vector3D parentBranchOrientation, double parentRotation)
Definition: cxBranchList.cpp:121
cx::sortMatrix
Eigen::MatrixXd sortMatrix(int rowNumber, Eigen::MatrixXd matrix)
Definition: cxBranchList.cpp:615