CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxAirwaysFromCenterline.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 
12 #ifndef CXAIRWAYSFROMCENTERLINE_H
13 #define CXAIRWAYSFROMCENTERLINE_H
14 
15 #include "cxMesh.h"
16 #include "cxForwardDeclarations.h"
17 #include <QDomElement>
18 #include "org_custusx_filter_airwaysfromcenterline_Export.h"
19 
20 namespace cx
21 {
22 
23 typedef std::vector< Eigen::Matrix4d > M4Vector;
24 typedef boost::shared_ptr<class RouteToTarget> RouteToTargetPtr;
25 
26 class org_custusx_filter_airwaysfromcenterline_EXPORT AirwaysFromCenterline
27 {
28 public:
30  virtual ~AirwaysFromCenterline();
31  void setTypeToBloodVessel(bool bloodVessel);
32  Eigen::MatrixXd getCenterlinePositions(vtkPolyDataPtr centerline_r);
33  void setBranches(BranchListPtr branches);
34  void setSegmentedVolume(vtkImageDataPtr segmentedVolume);
35  void processCenterline(vtkPolyDataPtr centerline_r);
36  BranchListPtr getBranchList();
37  vtkPolyDataPtr generateTubes(double staticRadius = 0, bool mergeWithOriginalAirways = false);
38  vtkImageDataPtr initializeEmptyAirwaysVolume();
39  vtkImageDataPtr initializeAirwaysVolumeFromOriginalSegmentation();
40  vtkImageDataPtr addSpheresAlongCenterlines(vtkImageDataPtr airwaysVolumePtr, double staticRadius = 0);
41  vtkImageDataPtr addSphereToImage(vtkImageDataPtr airwaysVolumePtr, double position[3], double radius);
42  void smoothAllBranchesForVB();
43  vtkPolyDataPtr addVTKPoints(std::vector< Eigen::Vector3d > positions);
44  vtkPolyDataPtr getVTKPoints();
45 
46 private:
47  Eigen::MatrixXd mCLpoints;
48  BranchListPtr mBranchListPtr;
49  vtkImageDataPtr mOriginalSegmentedVolume;
50  double mOrigin[3];
51  Vector3D mSpacing;
52  double mBounds[6];
53  Eigen::Array3i mDim;
54  double mAirwaysVolumeBoundaryExtention;
55  double mAirwaysVolumeBoundaryExtentionTracheaStart;
56  double mAirwaysVolumeSpacing;
57  bool mBloodVessel = false;
58  bool mMergeWithOriginalAirways = false;
59 
60 };
61 
62 std::pair<int, double> findDistanceToLine(Eigen::Vector3d point, Eigen::MatrixXd line);
63 double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2);
64 
65 typedef boost::shared_ptr<AirwaysFromCenterline> AirwaysFromCenterlinePtr;
66 
67 } /* namespace cx */
68 
69 #endif // CXAIRWAYSFROMCENTERLINE_H
boost::shared_ptr< AirwaysFromCenterline > AirwaysFromCenterlinePtr
double findDistance(Eigen::MatrixXd p1, Eigen::MatrixXd p2)
boost::shared_ptr< class RouteToTarget > RouteToTargetPtr
Definition: cxAccusurf.h:12
boost::shared_ptr< class BranchList > BranchListPtr
std::pair< int, double > findDistanceToLine(Eigen::Vector3d point, Eigen::MatrixXd line)
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
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Namespace for all CustusX production code.