NorMIT-nav  22.09
An IGT application
cxDataManagerImpl.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 CXDATAMANAGERIMPL_H_
14 #define CXDATAMANAGERIMPL_H_
15 
16 #include "org_custusx_core_patientmodel_Export.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include <map>
20 #include <set>
21 #include <string>
22 #include <QMutex>
23 #include <vector>
24 #include "cxImage.h"
25 #include "cxMesh.h"
26 #include "cxDataManager.h"
27 #include <QFileInfo>
28 #include "boost/scoped_ptr.hpp"
29 #include "cxPatientModelService.h"
30 
31 class QDomElement;
32 
33 namespace cx
34 {
35 
36 typedef boost::shared_ptr<class DataManager> DataServicePtr;
37 typedef boost::shared_ptr<class DataManagerImpl> DataManagerImplPtr;
38 
47 class org_custusx_core_patientmodel_EXPORT DataManagerImpl: public DataManager
48 {
49 Q_OBJECT
50 public:
51  static DataManagerImplPtr create(ActiveDataPtr activeData);
52  virtual ~DataManagerImpl();
53  void setServices(SpaceProviderPtr spaceProvider, FileManagerServicePtr filemanager);
54  void setDataFactory(DataFactoryPtr dataFactory);
55 
56  // streams
57  virtual VideoSourcePtr getStream(const QString& uid) const;
58  virtual StreamMap getStreams() const;
59  virtual void loadStream(VideoSourcePtr stream);
60 
61  // images
62  virtual std::map<QString, ImagePtr> getImages() const;
63 
64  void loadData(DataPtr data, bool overWrite = false);
65  DataPtr loadData(const QString& uid, const QString& path);
66  std::map<QString, DataPtr> getData() const;
67  DataPtr getData(const QString& uid) const;
68  virtual SpaceProviderPtr getSpaceProvider();
69  virtual DataFactoryPtr getDataFactory();
70 
71  // meshes
72  virtual std::map<QString, MeshPtr> getMeshes() const;
73 
74  // global data (move to separate class if list grows)
75  virtual Vector3D getCenter() const;
76  virtual void setCenter(const Vector3D& center);
77  void setOperatingTable(const OperatingTable &ot);
78  OperatingTable getOperatingTable() const;
79 
80  virtual QString addLandmark();
81  virtual void deleteLandmarks();
82  virtual void setLandmarkNames(std::vector<QString> names);
83  virtual void setLandmarkName(QString uid, QString name);
84  virtual void setLandmarkActive(QString uid, bool active);
85  virtual std::map<QString, LandmarkProperty> getLandmarkProperties() const;
86  virtual void clear();
87  virtual void removeData(const QString& uid, QString basePath);
88 
89  //Interface for saving/loading
90  virtual void addXml(QDomNode& parentNode);
91  virtual void parseXml(QDomNode& datamangerNode, QString absolutePath = QString());
92 
93  virtual CLINICAL_VIEW getClinicalApplication() const;
94  virtual void setClinicalApplication(CLINICAL_VIEW application);
95 
96  virtual Transform3D get_rMpr() const;
97  virtual void set_rMpr(const Transform3D& val);
98  virtual RegistrationHistoryPtr get_rMpr_History() const;
99 
100  virtual LandmarksPtr getPatientLandmarks();
101  virtual PresetTransferFunctions3DPtr getPresetTransferFunctions3D() const;
102 
103  virtual void generateUidAndName(QString* _uid, QString* _name);
104 protected:
105  DataManagerImpl(ActiveDataPtr activeData);
106 
107 protected:
108  std::map<QString, VideoSourcePtr> mStreams;
109  DataMap mData;
112  CLINICAL_VIEW mClinicalApplication;
113  void deleteFiles(DataPtr data, QString basePath);
114 
115  DataPtr loadData(QDomElement node, QString rootPath);
116  int findUniqueUidNumber(QString uidBase) const;
117 
118  void readClinicalView();
119 
124 
129 
130 private:
131  QDir findRelativePath(QDomElement node, QString rootPath);
132  QString findPath(QDomElement node);
133  QString findAbsolutePath(QDir relativePath, QString rootPath);
134 private slots:
135  void settingsChangedSlot(QString key);
136 };
137 
138 } // namespace cx
139 
140 #endif /* CXDATAMANAGERIMPL_H_ */
cx::DataManagerImpl::mData
DataMap mData
Definition: cxDataManagerImpl.h:109
cx::DataManagerImpl::mCenter
Vector3D mCenter
Definition: cxDataManagerImpl.h:110
cx::DataManagerImpl::mDataFactory
DataFactoryPtr mDataFactory
Definition: cxDataManagerImpl.h:127
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxPrecompiledHeader.h
cx::DataManagerImpl::mSpaceProvider
SpaceProviderPtr mSpaceProvider
Definition: cxDataManagerImpl.h:125
cx::DataManagerImpl::mActiveData
ActiveDataPtr mActiveData
Definition: cxDataManagerImpl.h:128
cx::DataManagerImplPtr
boost::shared_ptr< class DataManagerImpl > DataManagerImplPtr
Definition: cxDataManagerImpl.h:37
cx::DataManagerImpl::mFileManagerService
FileManagerServicePtr mFileManagerService
Definition: cxDataManagerImpl.h:126
cxImage.h
cx::DataManagerImpl
Definition: cxDataManagerImpl.h:47
cx::FileManagerServicePtr
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
Definition: cxLogicManager.h:31
cx::LandmarkPropertyMap
std::map< QString, LandmarkProperty > LandmarkPropertyMap
Definition: cxLandmark.h:108
cx::VideoSourcePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
Definition: cxForwardDeclarations.h:109
cx::DataFactoryPtr
boost::shared_ptr< class DataFactory > DataFactoryPtr
Definition: cxDataManager.h:39
cx::DataManagerImpl::mOperatingTable
OperatingTable mOperatingTable
Definition: cxDataManagerImpl.h:111
cx::DataManagerImpl::m_rMpr_History
RegistrationHistoryPtr m_rMpr_History
transform from the patient reference to the reference, along with historical data.
Definition: cxDataManagerImpl.h:121
cx::DataManagerImpl::mPresetTransferFunctions3D
PresetTransferFunctions3DPtr mPresetTransferFunctions3D
Definition: cxDataManagerImpl.h:123
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::DataManager::StreamMap
std::map< QString, VideoSourcePtr > StreamMap
Definition: cxDataManager.h:55
cx::DataManagerImpl::mPatientLandmarks
LandmarksPtr mPatientLandmarks
in space patient reference.
Definition: cxDataManagerImpl.h:122
cx::RegistrationHistoryPtr
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:37
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
cx::PresetTransferFunctions3DPtr
boost::shared_ptr< class TransferFunctions3DPresets > PresetTransferFunctions3DPtr
Definition: cxDataManager.h:36
cxPatientModelService.h
cxDataManager.h
cx::LandmarksPtr
boost::shared_ptr< class Landmarks > LandmarksPtr
Definition: cxData.h:41
cx::DataManagerImpl::mLandmarkProperties
LandmarkPropertyMap mLandmarkProperties
uid and name
Definition: cxDataManagerImpl.h:120
cx::OperatingTable
The OperatingTable class.
Definition: cxPatientModelService.h:54
cx::DataServicePtr
boost::shared_ptr< class DataManager > DataServicePtr
Definition: cxDataManagerImpl.h:36
cx::ActiveDataPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
cxMesh.h
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::SpaceProviderPtr
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
Definition: cxLogicManager.h:23
cx::DataManagerImpl::mClinicalApplication
CLINICAL_VIEW mClinicalApplication
Definition: cxDataManagerImpl.h:112
cx::DataManager
Definition: cxDataManager.h:48
cx::DataManagerImpl::mStreams
std::map< QString, VideoSourcePtr > mStreams
Definition: cxDataManagerImpl.h:108