CustusX  20.03-rc1
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_ */
< a easy-to-work-with struct for a specific xml configuration
Class that works as a interface to a ProbeCalibConfigs.xml.
int mHorizontalOffset
parameter for the grabber
std::vector< ColRowPair > mCorners
corners <col,row>
boost::shared_ptr< ProbeXmlConfigParser > ProbeXmlConfigParserPtr
std::pair< double, double > ColRowPair
int mImageWidth
Width of the used image format (x dim)
int mImageHeight
Height of the used image format (y dim)
double mTemporalCalibration
delay in timestamping in grabber source relative to master clock.
QString mName
Name of config set.