Fraxinus  17.12-rc4
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 
34 #ifndef CXDATAMANAGER_H_
35 #define CXDATAMANAGER_H_
36 
37 #include "org_custusx_core_patientmodel_Export.h"
38 #include "cxPrecompiledHeader.h"
39 
40 #include <map>
41 #include <string>
42 #include <vector>
43 #include <boost/shared_ptr.hpp>
44 #include <QObject>
45 #include "cxPatientModelService.h"
46 
47 #include "vtkForwardDeclarations.h"
48 #include "cxVector3D.h"
49 #include "cxLandmark.h"
50 #include "cxDefinitions.h"
51 #include "cxForwardDeclarations.h"
52 #include "cxTransform3D.h"
53 
54 namespace cx
55 {
56 // forward declarations
57 typedef boost::shared_ptr<class TransferFunctions3DPresets> PresetTransferFunctions3DPtr;
58 typedef boost::shared_ptr<class RegistrationHistory> RegistrationHistoryPtr;
59 typedef boost::shared_ptr<class SpaceProvider> SpaceProviderPtr;
60 typedef boost::shared_ptr<class DataFactory> DataFactoryPtr;
61 
69 class org_custusx_core_patientmodel_EXPORT DataManager: public QObject
70 {
71 Q_OBJECT
72 public:
73  typedef std::map<QString, DataPtr> DataMap;
74  typedef std::map<QString, ImagePtr> ImagesMap;
75  typedef std::map<QString, MeshPtr> MeshMap;
76  typedef std::map<QString, VideoSourcePtr> StreamMap;
77 
78  // streams
79  virtual VideoSourcePtr getStream(const QString& uid) const = 0;
80  virtual StreamMap getStreams() const = 0;
81  virtual void loadStream(VideoSourcePtr stream) = 0;
82 
83  // images
84  virtual std::map<QString, ImagePtr> getImages() const = 0;
85 
86  // meshes
87  virtual std::map<QString, MeshPtr> getMeshes() const = 0;
88 
89  // data
90  virtual void loadData(DataPtr data) = 0;
91  virtual DataPtr loadData(const QString& uid, const QString& path) = 0;
92  virtual std::map<QString, DataPtr> getData() const = 0;
93  virtual DataPtr getData(const QString& uid) const = 0;
94  virtual SpaceProviderPtr getSpaceProvider() = 0;
95  virtual DataFactoryPtr getDataFactory() = 0;
96 
97  // global data (move to separate class if list grows)
98  virtual Vector3D getCenter() const = 0;
99  virtual void setCenter(const Vector3D& center) = 0;
100  virtual void setOperatingTable(const OperatingTable &ot) = 0;
101  virtual OperatingTable getOperatingTable() const = 0;
102 
103  virtual PresetTransferFunctions3DPtr getPresetTransferFunctions3D() const;
104 
105  virtual QString addLandmark() = 0;
106  virtual void deleteLandmarks() = 0;
107  virtual void setLandmarkNames(std::vector<QString> names) = 0;
108  virtual void setLandmarkName(QString uid, QString name) = 0;
109  virtual void setLandmarkActive(QString uid, bool active) = 0;
110  virtual LandmarkPropertyMap getLandmarkProperties() const = 0;
111  virtual CLINICAL_VIEW getClinicalApplication() const = 0;
112  virtual void setClinicalApplication(CLINICAL_VIEW application) = 0;
113  virtual void clear() = 0;
114  virtual void removeData(const QString& uid, QString basePath) = 0;
115 
116  virtual void addXml(QDomNode& parentNode) = 0;
117  virtual void parseXml(QDomNode& datamangerNode, QString absolutePath = QString()) = 0;
118 
119  virtual Transform3D get_rMpr() const = 0;
120  virtual void set_rMpr(const Transform3D& val) = 0;
121  virtual RegistrationHistoryPtr get_rMpr_History() const = 0;
122  virtual LandmarksPtr getPatientLandmarks() = 0;
123  virtual void generateUidAndName(QString* _uid, QString* _name) = 0;
124 
125  //
126  virtual ImagePtr getImage(const QString& uid) const;
127  virtual MeshPtr getMesh(const QString& uid) const;
128  virtual TrackedStreamPtr getTrackedStream(const QString& uid) const;
129 
130 signals:
131  void centerChanged();
132  void operatingTableChanged();
133  void dataAddedOrRemoved();
134  void landmarkPropertiesChanged();
135  void clinicalApplicationChanged();
136  void streamLoaded();
137  void rMprChanged();
138 
139 protected:
140  DataManager();
141  virtual ~DataManager();
142 };
143 
144 } // namespace cx
145 
146 #endif /*CXDATAMANAGER_H_*/
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:58
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:57
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:48
std::map< QString, MeshPtr > MeshMap
Definition: cxDataManager.h:75
boost::shared_ptr< class Landmarks > LandmarksPtr
Definition: cxData.h:61
boost::shared_ptr< class Data > DataPtr
std::map< QString, ImagePtr > ImagesMap
Definition: cxDataManager.h:74
boost::shared_ptr< class VideoSource > VideoSourcePtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
std::map< QString, LandmarkProperty > LandmarkPropertyMap
Definition: cxLandmark.h:129
The OperatingTable class.
boost::shared_ptr< class DataFactory > DataFactoryPtr
Definition: cxDataManager.h:60
boost::shared_ptr< class Mesh > MeshPtr
std::map< QString, DataPtr > DataMap
Definition: cxDataManager.h:73
Namespace for all CustusX production code.
std::map< QString, VideoSourcePtr > StreamMap
Definition: cxDataManager.h:76