Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxDataManager.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 
13 #ifndef CXDATAMANAGER_H_
14 #define CXDATAMANAGER_H_
15 
16 #include "org_custusx_core_patientmodel_Export.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include <map>
20 #include <string>
21 #include <vector>
22 #include <boost/shared_ptr.hpp>
23 #include <QObject>
24 #include "cxPatientModelService.h"
25 
26 #include "vtkForwardDeclarations.h"
27 #include "cxVector3D.h"
28 #include "cxLandmark.h"
29 #include "cxDefinitions.h"
30 #include "cxForwardDeclarations.h"
31 #include "cxTransform3D.h"
32 
33 namespace cx
34 {
35 // forward declarations
36 typedef boost::shared_ptr<class TransferFunctions3DPresets> PresetTransferFunctions3DPtr;
37 typedef boost::shared_ptr<class RegistrationHistory> RegistrationHistoryPtr;
38 typedef boost::shared_ptr<class SpaceProvider> SpaceProviderPtr;
39 typedef boost::shared_ptr<class DataFactory> DataFactoryPtr;
40 
48 class org_custusx_core_patientmodel_EXPORT DataManager: public QObject
49 {
50 Q_OBJECT
51 public:
52  typedef std::map<QString, DataPtr> DataMap;
53  typedef std::map<QString, ImagePtr> ImagesMap;
54  typedef std::map<QString, MeshPtr> MeshMap;
55  typedef std::map<QString, VideoSourcePtr> StreamMap;
56 
57  // streams
58  virtual VideoSourcePtr getStream(const QString& uid) const = 0;
59  virtual StreamMap getStreams() const = 0;
60  virtual void loadStream(VideoSourcePtr stream) = 0;
61 
62  // images
63  virtual std::map<QString, ImagePtr> getImages() const = 0;
64 
65  // meshes
66  virtual std::map<QString, MeshPtr> getMeshes() const = 0;
67 
68  // data
69  virtual void loadData(DataPtr data, bool overWrite = false) = 0;
70  virtual DataPtr loadData(const QString& uid, const QString& path) = 0;
71  virtual std::map<QString, DataPtr> getData() const = 0;
72  virtual DataPtr getData(const QString& uid) const = 0;
73  virtual SpaceProviderPtr getSpaceProvider() = 0;
74  virtual DataFactoryPtr getDataFactory() = 0;
75 
76  // global data (move to separate class if list grows)
77  virtual Vector3D getCenter() const = 0;
78  virtual void setCenter(const Vector3D& center) = 0;
79  virtual void setOperatingTable(const OperatingTable &ot) = 0;
80  virtual OperatingTable getOperatingTable() const = 0;
81 
82  virtual PresetTransferFunctions3DPtr getPresetTransferFunctions3D() const;
83 
84  virtual QString addLandmark() = 0;
85  virtual void deleteLandmarks() = 0;
86  virtual void setLandmarkNames(std::vector<QString> names) = 0;
87  virtual void setLandmarkName(QString uid, QString name) = 0;
88  virtual void setLandmarkActive(QString uid, bool active) = 0;
89  virtual LandmarkPropertyMap getLandmarkProperties() const = 0;
90  virtual CLINICAL_VIEW getClinicalApplication() const = 0;
91  virtual void setClinicalApplication(CLINICAL_VIEW application) = 0;
92  virtual void clear() = 0;
93  virtual void removeData(const QString& uid, QString basePath) = 0;
94 
95  virtual void addXml(QDomNode& parentNode) = 0;
96  virtual void parseXml(QDomNode& datamangerNode, QString absolutePath = QString()) = 0;
97 
98  virtual Transform3D get_rMpr() const = 0;
99  virtual void set_rMpr(const Transform3D& val) = 0;
100  virtual RegistrationHistoryPtr get_rMpr_History() const = 0;
101  virtual LandmarksPtr getPatientLandmarks() = 0;
102  virtual void generateUidAndName(QString* _uid, QString* _name) = 0;
103 
104  //
105  virtual ImagePtr getImage(const QString& uid) const;
106  virtual MeshPtr getMesh(const QString& uid) const;
107  virtual TrackedStreamPtr getTrackedStream(const QString& uid) const;
108 
109 signals:
110  void centerChanged();
111  void operatingTableChanged();
112  void dataAddedOrRemoved();
113  void landmarkPropertiesChanged();
114  void clinicalApplicationChanged();
115  void streamLoaded();
116  void rMprChanged();
117 
118 protected:
119  DataManager();
120  virtual ~DataManager();
121 };
122 
123 } // namespace cx
124 
125 #endif /*CXDATAMANAGER_H_*/
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:37
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class TransferFunctions3DPresets > PresetTransferFunctions3DPtr
Definition: cxDataManager.h:36
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
std::map< QString, MeshPtr > MeshMap
Definition: cxDataManager.h:54
boost::shared_ptr< class Landmarks > LandmarksPtr
Definition: cxData.h:41
boost::shared_ptr< class Data > DataPtr
std::map< QString, ImagePtr > ImagesMap
Definition: cxDataManager.h:53
boost::shared_ptr< class VideoSource > VideoSourcePtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
std::map< QString, LandmarkProperty > LandmarkPropertyMap
Definition: cxLandmark.h:108
The OperatingTable class.
boost::shared_ptr< class DataFactory > DataFactoryPtr
Definition: cxDataManager.h:39
boost::shared_ptr< class Mesh > MeshPtr
std::map< QString, DataPtr > DataMap
Definition: cxDataManager.h:52
Namespace for all CustusX production code.
std::map< QString, VideoSourcePtr > StreamMap
Definition: cxDataManager.h:55