NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
ProbeXmlConfigParser.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 PROBEXMLCONFIGPARSER_H_
13 #define PROBEXMLCONFIGPARSER_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include <math.h>
18 #include <vector>
19 #include <boost/shared_ptr.hpp>
20 #include <QDomDocument>
21 #include "cxXmlOptionItem.h"
22 
31 class cxResource_EXPORT ProbeXmlConfigParser
32 {
33 public:
34  typedef std::pair<double,double> ColRowPair;
35  struct Configuration
36  {
37  QString mUsScanner;
38  QString mUsProbe;
39  QString mRtSource;
40  QString mConfigId;
41  QString mName;
44  double mWidthDeg;
45  double mDepth;
46  double mOffset;
47  double mOriginCol;
48  double mOriginRow;
49  int mNCorners;
50  std::vector<ColRowPair> mCorners;
51  int mLeftEdge;
52  int mRightEdge;
53  int mTopEdge;
55  double mPixelWidth;
56  double mPixelHeight;
58  QString mNotes;
60 // int mColumns; ///< X dim
61 // int mRows; ///< Y dim
62 
63  bool mEmpty;
64 
66  mConfigId(""),
67  mImageWidth(0),
68  mImageHeight(0),
69  mWidthDeg(0),
70  mDepth(0),
71  mOffset(0),
72  mOriginCol(0),
73  mOriginRow(0),
74  mNCorners(0),
75  mLeftEdge(0),
76  mRightEdge(0),
77  mTopEdge(0),
78  mBottomEdge(0),
79  mPixelWidth(0),
80  mPixelHeight(0),
81  mHorizontalOffset(0),
82  mTemporalCalibration(0),
83  mEmpty(true)
84  {};
85  bool isEmpty(){return mEmpty;};
86  };
87 
88  //ProbeXmlConfigParser(QString& pathToXml) {}; ///< opens the file and reads it onto the QDomDocument
89  //~ProbeXmlConfigParser() {};
90  virtual QString getFileName() = 0;
91  virtual void removeConfig(QString scanner, QString probe, QString rtsource, QString configId) = 0;
92  virtual void saveCurrentConfig(Configuration config) = 0;
93  virtual QStringList getScannerList() = 0;
94  virtual QStringList getProbeList(QString scanner) = 0;
95  virtual QStringList getRtSourceList(QString scanner, QString probe) = 0;
96  virtual QStringList getConfigIdList(QString scanner, QString probe, QString rtSource) = 0;
97  virtual Configuration getConfiguration(QString scanner, QString probe, QString rtsource, QString configId) = 0;
98 
99 };
100 typedef boost::shared_ptr<ProbeXmlConfigParser> ProbeXmlConfigParserPtr;
101 
102 #endif /* PROBEXMLCONFIGPARSER_H_ */
ProbeXmlConfigParser::Configuration::mDepth
double mDepth
depth
Definition: ProbeXmlConfigParser.h:45
ProbeXmlConfigParser::Configuration::mUsScanner
QString mUsScanner
scanner
Definition: ProbeXmlConfigParser.h:37
ProbeXmlConfigParser::Configuration::mLeftEdge
int mLeftEdge
LeftEdge.
Definition: ProbeXmlConfigParser.h:51
ProbeXmlConfigParserPtr
boost::shared_ptr< ProbeXmlConfigParser > ProbeXmlConfigParserPtr
Definition: ProbeXmlConfigParser.h:100
ProbeXmlConfigParser::Configuration::isEmpty
bool isEmpty()
Definition: ProbeXmlConfigParser.h:85
ProbeXmlConfigParser::Configuration::mImageHeight
int mImageHeight
Height of the used image format (y dim)
Definition: ProbeXmlConfigParser.h:43
ProbeXmlConfigParser::Configuration::mName
QString mName
Name of config set.
Definition: ProbeXmlConfigParser.h:41
ProbeXmlConfigParser::Configuration::mEmpty
bool mEmpty
Definition: ProbeXmlConfigParser.h:63
ProbeXmlConfigParser::Configuration::mRightEdge
int mRightEdge
RightEdge.
Definition: ProbeXmlConfigParser.h:52
cxXmlOptionItem.h
ProbeXmlConfigParser::Configuration::mNotes
QString mNotes
useful information
Definition: ProbeXmlConfigParser.h:58
ProbeXmlConfigParser::Configuration::mWidthDeg
double mWidthDeg
width in degrees
Definition: ProbeXmlConfigParser.h:44
ProbeXmlConfigParser::Configuration::mOffset
double mOffset
Offset.
Definition: ProbeXmlConfigParser.h:46
ProbeXmlConfigParser::Configuration::mCorners
std::vector< ColRowPair > mCorners
corners <col,row>
Definition: ProbeXmlConfigParser.h:50
ProbeXmlConfigParser::Configuration::mImageWidth
int mImageWidth
Width of the used image format (x dim)
Definition: ProbeXmlConfigParser.h:42
ProbeXmlConfigParser::Configuration::mUsProbe
QString mUsProbe
probe
Definition: ProbeXmlConfigParser.h:38
ProbeXmlConfigParser::Configuration::mNCorners
int mNCorners
number of corners
Definition: ProbeXmlConfigParser.h:49
ProbeXmlConfigParser::Configuration::mTemporalCalibration
double mTemporalCalibration
delay in timestamping in grabber source relative to master clock.
Definition: ProbeXmlConfigParser.h:59
ProbeXmlConfigParser
Class that works as a interface to a ProbeCalibConfigs.xml.
Definition: ProbeXmlConfigParser.h:31
ProbeXmlConfigParser::Configuration::mPixelWidth
double mPixelWidth
Pixel width.
Definition: ProbeXmlConfigParser.h:55
ProbeXmlConfigParser::Configuration::mHorizontalOffset
int mHorizontalOffset
parameter for the grabber
Definition: ProbeXmlConfigParser.h:57
ProbeXmlConfigParser::Configuration::mRtSource
QString mRtSource
realtime source
Definition: ProbeXmlConfigParser.h:39
ProbeXmlConfigParser::Configuration
< a easy-to-work-with struct for a specific xml configuration
Definition: ProbeXmlConfigParser.h:35
ProbeXmlConfigParser::ColRowPair
std::pair< double, double > ColRowPair
Definition: ProbeXmlConfigParser.h:34
ProbeXmlConfigParser::Configuration::mPixelHeight
double mPixelHeight
Pixel height.
Definition: ProbeXmlConfigParser.h:56
ProbeXmlConfigParser::Configuration::mConfigId
QString mConfigId
config id
Definition: ProbeXmlConfigParser.h:40
ProbeXmlConfigParser::Configuration::Configuration
Configuration()
Definition: ProbeXmlConfigParser.h:65
ProbeXmlConfigParser::Configuration::mTopEdge
int mTopEdge
TopEdge.
Definition: ProbeXmlConfigParser.h:53
ProbeXmlConfigParser::Configuration::mBottomEdge
int mBottomEdge
BottomEdge.
Definition: ProbeXmlConfigParser.h:54
ProbeXmlConfigParser::Configuration::mOriginCol
double mOriginCol
Origin.Col.
Definition: ProbeXmlConfigParser.h:47
ProbeXmlConfigParser::Configuration::mOriginRow
double mOriginRow
Origin.Row.
Definition: ProbeXmlConfigParser.h:48