Fraxinus  18.10
An IGT application
cxMetricManager.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 CXMETRICMANAGER_H
13 #define CXMETRICMANAGER_H
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxForwardDeclarations.h"
18 #include "cxDataMetric.h"
19 #include "cxDefinitions.h"
21 
22 class QDomElement;
23 
24 namespace cx
25 {
26 typedef boost::shared_ptr<class MetricReferenceArgumentList> MetricReferenceArgumentListPtr;
27 typedef boost::shared_ptr<class MetricManager> MetricManagerPtr;
28 
36 class cxGui_EXPORT MetricManager : public QObject
37 {
38  Q_OBJECT
39 public:
40  MetricManager(ViewServicePtr viewService, PatientModelServicePtr patientModelService, TrackingServicePtr trackingService, SpaceProviderPtr spaceProvider);
41 
42  DataMetricPtr getMetric(QString uid);
43  int getNumberOfMetrics() const;
44  void moveToMetric(QString uid);
45  void setSelection(std::set<QString> selection);
46  void setActiveUid(QString uid);
47  QString getActiveUid() const { return mActiveLandmark; }
48  void exportMetricsToXMLFile(QString& filename);
49  void importMetricsFromXMLFile(QString& filename);
50  void importMetricsFromMNITagFile(QString& filename, bool testmode=false);
51  PointMetricPtr addPoint(Vector3D point, CoordinateSystem space=CoordinateSystem(csREF), QString uid="point%1", QColor color = QColor(240, 170, 255, 255));
52  DistanceMetricPtr addDistance(QString uid = "distance%1");
53 
54 signals:
55  void activeMetricChanged();
56  void metricsChanged();
57 
58 public slots:
59  void loadReferencePointsSlot();
60  void addPointButtonClickedSlot();
61  void addFrameButtonClickedSlot();
62  void addToolButtonClickedSlot();
63  void addPlaneButtonClickedSlot();
64  void addAngleButtonClickedSlot();
65  void addDistanceButtonClickedSlot();
66  void addSphereButtonClickedSlot();
67  void addDonutButtonClickedSlot();
68  void addCustomButtonClickedSlot();
69  void addROIButtonClickedSlot();
70 
71 protected:
73  std::vector<QString> imageRefs;
74  PATIENT_COORDINATE_SYSTEM coordSys;
75  };
77 
78 private:
79  void setManualToolPosition(Vector3D p_r);
80  std::vector<DataPtr> refinePointArguments(std::vector<DataPtr> args, unsigned argNo);
81  std::vector<DataPtr> getSpecifiedNumberOfValidArguments(MetricReferenceArgumentListPtr arguments, int numberOfRequiredArguments=-1);
82  void installNewMetric(DataMetricPtr metric);
83  PointMetricPtr addPointInDefaultPosition();
84  std::vector<DataMetricPtr> getAllMetrics() const;
85  DataPtr loadDataFromXMLNode(QDomElement node);
86  DataPtr createData(QString type, QString uid, QString name);
87 
88  QString mActiveLandmark;
89  std::set<QString> mSelection;
90  PatientModelServicePtr mPatientModelService;
91  ViewServicePtr mViewService;
92  TrackingServicePtr mTrackingService;
93  SpaceProviderPtr mSpaceProvider;
94  QColor getRandomColor();
95  ImportMNIuserSettings dialogForSelectingVolumesForImportedMNITagFile(int number_of_volumes, QString description);
96  void resolveUnknownParentSpacesForPointMetrics(QDomNode dataNode, std::map<QString, QString> mapping_of_unknown_to_known_spaces, DataPtr data);
97 };
98 
99 
100 } // namespace cx
101 
102 #endif // CXMETRICMANAGER_H
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class DistanceMetric > DistanceMetricPtr
boost::shared_ptr< DataMetric > DataMetricPtr
Definition: cxDataMetric.h:73
boost::shared_ptr< class TrackingService > TrackingServicePtr
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
Definition: cxDefinitions.h:88
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class MetricManager > MetricManagerPtr
ImportMNIuserSettings mUserSettings
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class MetricReferenceArgumentList > MetricReferenceArgumentListPtr
Identification of a Coordinate system.
QString getActiveUid() const
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Namespace for all CustusX production code.
boost::shared_ptr< class PointMetric > PointMetricPtr