Fraxinus  22.04-rc5
An IGT application
cxProbeImpl.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  * \brief
14  *
15  * \date Feb 3, 2011
16  * \author Christian Askeland, SINTEF
17  * \author Ole Vegard Solberg, SINTEF
18  */
19 
20 #ifndef CXPROBEIMPL_H_
21 #define CXPROBEIMPL_H_
22 
23 #include "cxResourceExport.h"
24 
25 #include "cxProbe.h"
26 #include <map>
28 
29 namespace cx
30 {
37 typedef boost::shared_ptr<class ProbeImpl> ProbeImplPtr;
38 
42 class cxResource_EXPORT ProbeImpl: public Probe
43 {
44 Q_OBJECT
45 public:
46  static ProbeImplPtr New(QString instrumentUid, QString scannerUid, ProbeXmlConfigParserPtr xml = ProbeXmlConfigParserPtr());
47  virtual ~ProbeImpl(){}
48  virtual bool isValid() const;
49 
50  virtual QStringList getAvailableVideoSources();
51  virtual VideoSourcePtr getRTSource(QString uid = "active") const;
52  virtual ProbeDefinition getProbeDefinition(QString uid = "active") const;
53  virtual ProbeSectorPtr getSector(QString uid = "active");
54 
55  virtual void addXml(QDomNode& dataNode);
56  virtual void parseXml(QDomNode& dataNode);
57 
58  virtual QStringList getConfigIdList() const;
59  virtual QString getConfigName(QString uid);
60  virtual QString getConfigId() const;
61  virtual QString getConfigurationPath() const;
62 
63  virtual void applyNewConfigurationWithId(QString uid);
64  virtual void setTemporalCalibration(double val);
65  virtual void setSoundSpeedCompensationFactor(double val);
66  virtual void setProbeDefinition(ProbeDefinition probeDefinition);
67  virtual void setRTSource(VideoSourcePtr source);
68  virtual void removeRTSource(VideoSourcePtr source);
69 
70  virtual void setActiveStream(QString uid);
71  virtual QString getActiveStream() const;
72 
73  ProbeXmlConfigParser::Configuration getConfiguration();
74  virtual void removeCurrentConfig();
75  virtual void saveCurrentConfig(QString uid, QString name);
76 
77  QString getRtSourceName(QString configurationId = "") const;
78 
79 private:
80  ProbeImpl(QString instrumentUid, QString scannerUid);
81  void initProbeXmlConfigParser(ProbeXmlConfigParserPtr xml);
82  void initConfigId();
83  ProbeXmlConfigParser::Configuration getConfiguration(QString uid) const;
84  QString getInstrumentId() const;
85  QString getInstrumentScannerId() const;
86  bool hasRtSource() const;
87 
88  void setConfigId(QString uid);
89  void updateProbeSector();
90  bool isValidConfigId();
91  ProbeDefinition createProbeSector();
92  void updateTemporalCalibration();
93  void applyConfig();
94 
95  QString mActiveUid;
96  std::map<QString, ProbeDefinition> mProbeDefinition;
97  std::map<QString, VideoSourcePtr> mSource;
98  ProbeWeakPtr mSelf;
99 
100  QString mInstrumentUid;
101  QString mScannerUid;
102  double mSoundSpeedCompensationFactor;
103  bool mOverrideTemporalCalibration;
104  double mTemporalCalibration;
105 
107  QString mConfigurationId;
108 
110  QString findRtSource(QString configId) const;
111 };
112 
116 } // namespace cx
117 
118 #endif /* CXPROBEIMPL_H_ */
119 
< a easy-to-work-with struct for a specific xml configuration
US Probe interface.
Definition: cxProbe.h:32
boost::weak_ptr< Probe > ProbeWeakPtr
Definition: cxProbe.h:73
boost::shared_ptr< class VideoSource > VideoSourcePtr
boost::shared_ptr< ProbeXmlConfigParser > ProbeXmlConfigParserPtr
boost::shared_ptr< class ProbeSector > ProbeSectorPtr
Definition of characteristics for an Ultrasound Probe Sector.
boost::shared_ptr< class ProbeImpl > ProbeImplPtr
virtual ~ProbeImpl()
Definition: cxProbeImpl.h:47
Namespace for all CustusX production code.