NorMIT-nav  18.04
An IGT application
cxAirwaysFilterService.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 CXAIRWAYSFILTERSERVICE_H_
13 #define CXAIRWAYSFILTERSERVICE_H_
14 
15 #include "org_custusx_filter_airways_Export.h"
16 
17 #include "cxFilter.h"
18 #include "cxFilterImpl.h"
19 
20 #include <boost/unordered_map.hpp>
21 #include <boost/shared_ptr.hpp>
22 
23 #include "cxPatientModelService.h"
24 
25 #include "cxStringProperty.h"
26 #include "cxBoolProperty.h"
27 
28 class ctkPluginContext;
29 
30 typedef vtkSmartPointer<class vtkImageData> vtkImageDataPtr;
31 typedef vtkSmartPointer<class vtkPolyData> vtkPolyDataPtr;
32 
33 namespace cx {
34 
41 class org_custusx_filter_airways_EXPORT AirwaysFilter : public FilterImpl
42 {
43 Q_OBJECT
44 Q_INTERFACES(cx::Filter)
45 
46 public:
47  AirwaysFilter(VisServicesPtr services);
48  virtual ~AirwaysFilter();
49 
50  virtual QString getType() const;
51  virtual QString getName() const;
52  virtual QString getHelp() const;
53  static QString getNameSuffix();
54  static QString getNameSuffixStraight();
55  static QString getNameSuffixTubes();
56  void setDefaultStraightCLTubesOption(bool defaultStraightCLTubesOption);
57 
58  bool preProcess();
59  virtual bool execute();
60  virtual bool postProcess();
61 
62 protected:
63  virtual void createOptions();
64  virtual void createInputTypes();
65  virtual void createOutputTypes();
66 
67 private:
68  static Vector3D getSeedPointFromTool(SpaceProviderPtr spaceProvider, DataPtr image);
69  static bool isSeedPointInsideImage(Vector3D, DataPtr);
70  BoolPropertyPtr getManualSeedPointOption(QDomElement root);
71  BoolPropertyPtr getLungSegmentationOption(QDomElement root);
72  BoolPropertyPtr getStraightCLTubesOption(QDomElement root);
73  void createStraightCL();
74  void createTubes();
75  vtkImageDataPtr mAirwaySegmentationOutput;
76  vtkImageDataPtr mLungSegmentationOutput;
77  vtkPolyDataPtr mCenterlineOutput;
78  Transform3D mTransformation;
79  ImagePtr mInputImage;
80  Vector3D seedPoint;
81  bool mDefaultStraightCLTubesOption;
82 };
83 typedef boost::shared_ptr<class AirwaysFilter> AirwaysFilterPtr;
84 
85 } /* namespace cx */
86 #endif /* CXTUBESEGMENTATIONFILTERSERVICE_H_ */
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
boost::shared_ptr< class Data > DataPtr
vtkSmartPointer< class vtkPolyData > vtkPolyDataPtr
boost::shared_ptr< class AirwaysFilter > AirwaysFilterPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
boost::shared_ptr< class BoolProperty > BoolPropertyPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Namespace for all CustusX production code.