CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxToolConfigurationParser.cpp
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 
34 
35 #include <QFile>
36 #include <QDir>
37 #include <QFileInfo>
38 #include <QTextStream>
39 #include "cxLogger.h"
40 #include "cxTypeConversions.h"
41 #include "cxEnumConverter.h"
42 #include "cxDataLocations.h"
43 #include "cxProfile.h"
44 #include "cxFrame3D.h"
45 #include "cxTransformFile.h"
46 
47 namespace cx
48 {
49 
50 ConfigurationFileParser::ConfigurationFileParser(QString absoluteConfigFilePath, QString loggingFolder) :
51  mConfigurationFilePath(absoluteConfigFilePath), mLoggingFolder(loggingFolder), mConfigTag(
52  "configuration"), mConfigTrackerTag("tracker"), mConfigTrackerToolFile("toolfile"), mTypeAttribute(
53  "type"), mClinicalAppAttribute("clinical_app"), mReferenceAttribute("reference")
54 {
55  this->setConfigDocument(mConfigurationFilePath);
56 }
57 
59 {
60 }
61 
63 {
64  if (!this->isConfigFileValid())
65  return "";
66 
67  QDomNode configNode = mConfigureDoc.elementsByTagName(mConfigTag).at(0);
68  QString retval = configNode.toElement().attribute(mClinicalAppAttribute);
69  return retval;
70 }
71 
72 std::vector<IgstkTracker::InternalStructure> ConfigurationFileParser::getTrackers()
73 {
74  std::vector<IgstkTracker::InternalStructure> retval;
75 
76  if (!this->isConfigFileValid())
77  return retval;
78 
79  QDomNodeList trackerNodes = mConfigureDoc.elementsByTagName(mConfigTrackerTag);
80  for (int i = 0; i < trackerNodes.count(); ++i)
81  {
82  IgstkTracker::InternalStructure internalStructure;
83  QString trackerType = trackerNodes.at(i).toElement().attribute(mTypeAttribute);
84  internalStructure.mType = string2enum<TRACKING_SYSTEM>(trackerType);
85  internalStructure.mLoggingFolderName = mLoggingFolder;
86 
87  retval.push_back(internalStructure);
88  }
89 
90  if (retval.size() > 1)
92  "Config file " + mConfigurationFilePath
93  + " has a invalid number of tracking systems, we only support 1 tracking system atm!");
94 
95  return retval;
96 }
97 
99 {
100  std::vector<QString> retval;
101 
102  if (!this->isConfigFileValid())
103  return retval;
104 
105  QDomNodeList toolFileNodes = mConfigureDoc.elementsByTagName(mConfigTrackerToolFile);
106  for (int i = 0; i < toolFileNodes.count(); ++i)
107  {
108  QString absoluteToolFilePath = this->getAbsoluteToolFilePath(toolFileNodes.at(i).toElement());
109  if (absoluteToolFilePath.isEmpty())
110  continue;
111 
112  retval.push_back(absoluteToolFilePath);
113  }
114 
115  return retval;
116 }
117 
119 {
120  QString retval;
121 
122  if (!this->isConfigFileValid())
123  return retval;
124 
125 // QFile configFile(mConfigurationFilePath);
126 // QString configFolderAbsolutePath = QFileInfo(configFile).dir().absolutePath()+"/";
127 // std::cout << "configFolderAbsolutePath " << configFolderAbsolutePath << std::endl;
128 
129  QDomNodeList toolFileNodes = mConfigureDoc.elementsByTagName(mConfigTrackerToolFile);
130  for (int i = 0; i < toolFileNodes.count(); ++i)
131  {
132  QString reference = toolFileNodes.at(i).toElement().attribute(mReferenceAttribute);
133  if (reference.contains("yes", Qt::CaseInsensitive))
134  {
135 // std::cout << "Found yes..." << std::endl;
136  retval = this->getAbsoluteToolFilePath(toolFileNodes.at(i).toElement());
137  }
138  }
139  return retval;
140 }
141 
143 {
144  QString retval = DataLocations::getRootConfigPath() + "/tool/TEMPLATE_configuration.xml";
145  return retval;
146 }
147 
148 QString ConfigurationFileParser::convertToRelativeToolFilePath(QString configFilename, QString absoluteToolFilePath)
149 {
150  foreach (QString root, profile()->getAllRootConfigPaths())
151  {
152  QString configPath = getToolPathFromRoot(root);
153  if (!absoluteToolFilePath.contains(configPath))
154  continue;
155  absoluteToolFilePath.replace(configPath, "");
156  if (absoluteToolFilePath.startsWith("/"))
157  absoluteToolFilePath.remove(0, 1);
158  return absoluteToolFilePath;
159  }
160 
161  // file not in any of the standard locations: return absolute
162  return absoluteToolFilePath;
163 }
164 
165 QString ConfigurationFileParser::getToolPathFromRoot(QString root)
166 {
167  return root + "/tool/Tools/";
168 }
169 
171 {
172  QDomDocument doc;
173  doc.appendChild(doc.createProcessingInstruction("xml version =", "\"1.0\""));
174 
175  QDomElement configNode = doc.createElement("configuration");
176  configNode.setAttribute("clinical_app", config.mClinical_app);
177 
178  TrackersAndToolsMap::iterator it1 = config.mTrackersAndTools.begin();
179  for (; it1 != config.mTrackersAndTools.end(); ++it1)
180  {
181  QString trackerType = enum2string(it1->first);
182  QDomElement trackerTagNode = doc.createElement("tracker");
183  trackerTagNode.setAttribute("type", trackerType);
184 
185  ToolFilesAndReferenceVector::iterator it2 = it1->second.begin();
186  for (; it2 != it1->second.end(); ++it2)
187  {
188  QString absoluteToolFilePath = it2->first;
189  QString relativeToolFilePath = convertToRelativeToolFilePath(config.mFileName, absoluteToolFilePath);
190 
191  ToolFileParser toolparser(absoluteToolFilePath);
192  QString toolTrackerType = enum2string(toolparser.getTool().mTrackerType);
193  if (!trackerType.contains(enum2string(toolparser.getTool().mTrackerType), Qt::CaseInsensitive))
194  {
195  reportWarning("When saving configuration, skipping tool " + relativeToolFilePath + " of type "
196  + toolTrackerType + " because tracker is set to " + trackerType);
197  continue;
198  }
199 
200  QDomElement toolFileNode = doc.createElement("toolfile");
201  toolFileNode.appendChild(doc.createTextNode(relativeToolFilePath));
202  toolFileNode.setAttribute("reference", (it2->second ? "yes" : "no"));
203  trackerTagNode.appendChild(toolFileNode);
204  }
205  configNode.appendChild(trackerTagNode);
206  }
207 
208  doc.appendChild(configNode);
209 
210  //write to file
211  QFile file(config.mFileName);
212  QDir().mkpath(QFileInfo(config.mFileName).absolutePath());
213 
214  if (!file.open(QIODevice::WriteOnly))
215  {
216  reportWarning("Could not open file " + file.fileName() + ", aborting writing of config.");
217  return;
218  }
219  QTextStream stream(&file);
220  doc.save(stream, 4);
221  reportSuccess("Configuration file " + file.fileName() + " is written.");
222 }
223 
224 void ConfigurationFileParser::setConfigDocument(QString configAbsoluteFilePath)
225 {
226  QFile configFile(configAbsoluteFilePath);
227  if (!configFile.exists())
228  {
229 // reportDebug("Configfile "+configAbsoluteFilePath+" does not exist.");
230  return;
231  }
232 
233  if (!mConfigureDoc.setContent(&configFile))
234  {
235  reportError("Could not set the xml content of the config file " + configAbsoluteFilePath);
236  return;
237  }
238 }
239 
240 bool ConfigurationFileParser::isConfigFileValid()
241 {
242  //there can only be one config defined in every config.xml-file, that's why we say ...item(0)
243  QDomNode configNode = mConfigureDoc.elementsByTagName(mConfigTag).item(0);
244  if (configNode.isNull())
245  {
246  //reportDebug("Configuration file \""+mConfigurationFilePath+"\" does not contain the tag <"+mConfigTag+">.");
247  return false;
248  }
249  return true;
250 }
251 
252 QString ConfigurationFileParser::findXmlFileWithDirNameInPath(QString path)
253 {
254  QDir dir(path);
255  QStringList filter;
256  filter << dir.dirName() + ".xml";
257  QStringList filepaths = dir.entryList(filter);
258  if (!filepaths.isEmpty())
259  return dir.absoluteFilePath(filter[0]);
260  return "";
261 }
262 
263 QString ConfigurationFileParser::searchForExistingToolFilePath(QString relativeToolFilePath)
264 {
265  // remove old-style paths (<= v3.7.0)
266  relativeToolFilePath.replace("../Tools/", "");
267 
268  foreach (QString root, profile()->getAllRootConfigPaths())
269  {
270  QString configPath = this->getToolPathFromRoot(root);
271  QFileInfo guess(configPath + "/" + relativeToolFilePath);
272  if (guess.exists())
273  return guess.canonicalFilePath();
274  }
275  return "";
276 }
277 
278 QString ConfigurationFileParser::getAbsoluteToolFilePath(QDomElement toolfileelement)
279 {
280  QString relativeToolFilePath = toolfileelement.text();
281  if (relativeToolFilePath.isEmpty())
282  return "";
283 
284  QString absoluteToolFilePath = this->searchForExistingToolFilePath(relativeToolFilePath);
285 
286  QFileInfo info(absoluteToolFilePath);
287  if (!info.exists())
288  reportError(QString("Tool file %1 in configuration %2 not found. Skipping.")
289  .arg(relativeToolFilePath)
290  .arg(mConfigurationFilePath));
291 
292  if (info.isDir())
293  absoluteToolFilePath = this->findXmlFileWithDirNameInPath(absoluteToolFilePath);
294  return absoluteToolFilePath;
295 }
296 //----------------------------------------------------------------------------------------------------------------------
297 
298 ToolFileParser::ToolFileParser(QString absoluteToolFilePath, QString loggingFolder) :
299  mToolFilePath(absoluteToolFilePath), mLoggingFolder(loggingFolder), mToolTag("tool"), mToolTypeTag(
300  "type"), mToolIdTag("id"), mToolNameTag("name"), mToolDescriptionTag("description"), mToolManufacturerTag(
301  "manufacturer"), mToolClinicalAppTag("clinical_app"), mToolGeoFileTag("geo_file"), mToolPicFileTag(
302  "pic_file"), mToolDocFileTag("doc_file"), mToolInstrumentTag("instrument"), mToolInstrumentTypeTag(
303  "type"), mToolInstrumentIdTag("id"), mToolInstrumentNameTag("name"), mToolInstrumentManufacturerTag(
304  "manufacturer"), mToolInstrumentScannerIdTag("scannerid"), mToolInstrumentDescriptionTag(
305  "description"), mToolSensorTag("sensor"), mToolSensorTypeTag("type"), mToolSensorIdTag(
306  "id"), mToolSensorNameTag("name"), mToolSensorWirelessTag("wireless"), mToolSensorDOFTag(
307  "DOF"), mToolSensorPortnumberTag("portnumber"), mToolSensorChannelnumberTag(
308  "channelnumber"), mToolSensorReferencePointTag("reference_point"), mToolSensorManufacturerTag(
309  "manufacturer"), mToolSensorDescriptionTag("description"), mToolSensorRomFileTag(
310  "rom_file"), mToolCalibrationTag("calibration"), mToolCalibrationFileTag("cal_file")
311 {
312 }
313 
315 {
316 }
317 
319 {
321 
322  QFile toolFile(mToolFilePath);
323  QString toolFolderAbsolutePath = QFileInfo(toolFile).dir().absolutePath() + "/";
324  QDomNode toolNode = this->getToolNode(mToolFilePath);
325  IgstkTool::InternalStructure internalStructure;
326  if (toolNode.isNull())
327  {
328  report(
329  "Could not read the <tool> tag of file: " + mToolFilePath
330  + ", this is not a tool file, skipping.");
331  return retval;
332  }
333 
334  QDomElement toolTypeElement = toolNode.firstChildElement(mToolTypeTag);
335  QString toolTypeText = toolTypeElement.text();
336 
337  internalStructure.mIsReference = toolTypeText.contains("reference", Qt::CaseInsensitive);
338  internalStructure.mIsPointer = toolTypeText.contains("pointer", Qt::CaseInsensitive);
339  internalStructure.mIsProbe = toolTypeText.contains("usprobe", Qt::CaseInsensitive);
340 
341 // if (toolTypeText.contains("reference", Qt::CaseInsensitive))
342 // {
343 // internalStructure.mType = Tool::TOOL_REFERENCE;
344 // } else if (toolTypeText.contains("pointer", Qt::CaseInsensitive))
345 // {
346 // internalStructure.mType = Tool::TOOL_POINTER;
347 // } else if (toolTypeText.contains("usprobe", Qt::CaseInsensitive))
348 // {
349 // internalStructure.mType = Tool::TOOL_US_PROBE;
350 // } else
351 // {
352 // internalStructure.mType = Tool::TOOL_NONE;
353 // }
354 
355  QDomElement toolIdElement = toolNode.firstChildElement(mToolIdTag);
356  QString toolIdText = toolIdElement.text();
357  internalStructure.mUid = toolIdText;
358 
359  QDomElement toolNameElement = toolNode.firstChildElement(mToolNameTag);
360  QString toolNameText = toolNameElement.text();
361  internalStructure.mName = toolNameText;
362 
363  QDomElement toolClinicalAppElement = toolNode.firstChildElement(mToolClinicalAppTag);
364  QString toolClinicalAppText = toolClinicalAppElement.text();
365  QStringList applicationList = toolClinicalAppText.split(" ");
366  foreach(QString string, applicationList)
367  {
368  if (string.isEmpty())
369  continue;
370  string = string.toLower();
371  internalStructure.mClinicalApplications.push_back(string);
372  }
373 
374  QDomElement toolGeofileElement = toolNode.firstChildElement(mToolGeoFileTag);
375  QString toolGeofileText = toolGeofileElement.text();
376  if (!toolGeofileText.isEmpty())
377  toolGeofileText = toolFolderAbsolutePath + toolGeofileText;
378  internalStructure.mGraphicsFileName = toolGeofileText;
379 
380  QDomElement toolPicfileElement = toolNode.firstChildElement(mToolPicFileTag);
381  QString toolPicfileText = toolPicfileElement.text();
382  if (!toolPicfileText.isEmpty())
383  toolPicfileText = toolFolderAbsolutePath + toolPicfileText;
384  internalStructure.mPictureFileName = toolPicfileText;
385 
386  QDomElement toolInstrumentElement = toolNode.firstChildElement(mToolInstrumentTag);
387  if (toolInstrumentElement.isNull())
388  {
389  reportError(
390  "Could not find the <instrument> tag under the <tool> tag. Aborting this tool.");
391  return retval;
392  }
393  QDomElement toolInstrumentIdElement = toolInstrumentElement.firstChildElement(mToolInstrumentIdTag);
394  QString toolInstrumentIdText = toolInstrumentIdElement.text();
395  internalStructure.mInstrumentId = toolInstrumentIdText;
396 
397  QDomElement toolInstrumentScannerIdElement = toolInstrumentElement.firstChildElement(mToolInstrumentScannerIdTag);
398  QString toolInstrumentScannerIdText = toolInstrumentScannerIdElement.text();
399  internalStructure.mInstrumentScannerId = toolInstrumentScannerIdText;
400 
401  QDomElement toolSensorElement = toolNode.firstChildElement(mToolSensorTag);
402  if (toolSensorElement.isNull())
403  {
404  reportError("Could not find the <sensor> tag under the <tool> tag. Aborting this tool.");
405  return retval;
406  }
407  QDomElement toolSensorTypeElement = toolSensorElement.firstChildElement(mToolSensorTypeTag);
408  QString toolSensorTypeText = toolSensorTypeElement.text();
409  internalStructure.mTrackerType = string2enum<TRACKING_SYSTEM>(toolSensorTypeText);
410 
411  QDomElement toolSensorWirelessElement = toolSensorElement.firstChildElement(mToolSensorWirelessTag);
412  QString toolSensorWirelessText = toolSensorWirelessElement.text();
413  if (toolSensorWirelessText.contains("yes", Qt::CaseInsensitive))
414  internalStructure.mWireless = true;
415  else if (toolSensorWirelessText.contains("no", Qt::CaseInsensitive))
416  internalStructure.mWireless = false;
417 
418  QDomElement toolSensorDOFElement = toolSensorElement.firstChildElement(mToolSensorDOFTag);
419  QString toolSensorDOFText = toolSensorDOFElement.text();
420  if (toolSensorDOFText.contains("5", Qt::CaseInsensitive))
421  internalStructure.m5DOF = true;
422  else if (toolSensorDOFText.contains("6", Qt::CaseInsensitive))
423  internalStructure.m5DOF = false;
424 
425  QDomElement toolSensorPortnumberElement = toolSensorElement.firstChildElement(mToolSensorPortnumberTag);
426  QString toolSensorPortnumberText = toolSensorPortnumberElement.text();
427  internalStructure.mPortNumber = toolSensorPortnumberText.toInt();
428 
429  QDomElement toolSensorChannelnumberElement = toolSensorElement.firstChildElement(mToolSensorChannelnumberTag);
430  QString toolSensorChannelnumberText = toolSensorChannelnumberElement.text();
431  internalStructure.mChannelNumber = toolSensorChannelnumberText.toInt();
432 
433  QDomNodeList toolSensorReferencePointList = toolSensorElement.elementsByTagName(mToolSensorReferencePointTag);
434  for (int j = 0; j < toolSensorReferencePointList.count(); j++)
435  {
436  QDomNode node = toolSensorReferencePointList.item(j);
437  if (!node.hasAttributes())
438  {
439  reportWarning("Found reference point without id attribute. Skipping.");
440  continue;
441  }
442  bool ok;
443  int id = node.toElement().attribute("id").toInt(&ok);
444  if (!ok)
445  {
446  reportWarning("Attribute id of a reference point was not an int. Skipping.");
447  continue;
448  }
449  QString toolSensorReferencePointText = node.toElement().text();
450  Vector3D vector = Vector3D::fromString(toolSensorReferencePointText);
451  internalStructure.mReferencePoints[id] = vector;
452  }
453 
454  QDomElement toolSensorRomFileElement = toolSensorElement.firstChildElement(mToolSensorRomFileTag);
455  QString toolSensorRomFileText = toolSensorRomFileElement.text();
456  if (!toolSensorRomFileText.isEmpty())
457  toolSensorRomFileText = toolFolderAbsolutePath + toolSensorRomFileText;
458  internalStructure.mSROMFilename = toolSensorRomFileText;
459 
460  QDomElement toolCalibrationElement = toolNode.firstChildElement(mToolCalibrationTag);
461  if (toolCalibrationElement.isNull())
462  {
463  reportError(
464  "Could not find the <calibration> tag under the <tool> tag. Aborting this tool.");
465  return retval;
466  }
467  QDomElement toolCalibrationFileElement = toolCalibrationElement.firstChildElement(mToolCalibrationFileTag);
468  QString toolCalibrationFileText = toolCalibrationFileElement.text();
469  if (!toolCalibrationFileText.isEmpty())
470  toolCalibrationFileText = toolFolderAbsolutePath + toolCalibrationFileText;
471  internalStructure.mCalibrationFilename = toolCalibrationFileText;
472  internalStructure.mCalibration = this->readCalibrationFile(internalStructure.mCalibrationFilename);
473 
474  internalStructure.mTransformSaveFileName = mLoggingFolder;
475  internalStructure.mLoggingFolderName = mLoggingFolder;
476  retval = internalStructure;
477 
478  return retval;
479 }
480 
481 QDomNode ToolFileParser::getToolNode(QString toolAbsoluteFilePath)
482 {
483  QDomNode retval;
484  QFile toolFile(toolAbsoluteFilePath);
485  if (!mToolDoc.setContent(&toolFile))
486  {
487  reportError("Could not set the xml content of the tool file " + toolAbsoluteFilePath);
488  return retval;
489  }
490  //there can only be one tool defined in every tool.xml-file, that's why we say ...item(0)
491  retval = mToolDoc.elementsByTagName(mToolTag).item(0);
492  return retval;
493 }
494 
496 {
497  QString retval = DataLocations::getRootConfigPath() + "/tool/TEMPLATE_tool.xml";
498  return retval;
499 }
500 
501 igstk::Transform ToolFileParser::readCalibrationFile(QString absoluteFilePath)
502 {
503  igstk::Transform retval;
504 
505  bool ok = true;
506  TransformFile file(absoluteFilePath);
507  Transform3D M = file.read(&ok);
508 
509  if (ok)
510  {
511  M = Frame3D::create(M).transform(); // clean rotational parts, transform should now be pure rotation+translation
512  retval.ImportTransform(*M.getVtkMatrix());
513  }
514 
515  return retval;
516 }
517 
518 //----------------------------------------------------------------------------------------------------------------------
519 
520 }//namespace cx
TrackersAndToolsMap mTrackersAndTools
the trackers and tools (relative path) that should be used in the config
cxResource_EXPORT ProfilePtr profile()
Definition: cxProfile.cpp:169
ToolFileParser(QString absoluteToolFilePath, QString loggingFolder="")
void reportError(QString msg)
Definition: cxLogger.cpp:92
File format for storing a 4x4 matrix.The read/write methods emit error messages if you dont use the o...
QString mUid
the tools unique id
Definition: cxIgstkTool.h:92
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
QString mTransformSaveFileName
path to where transforms should be saved
Definition: cxIgstkTool.h:105
QString mSROMFilename
path to the tools SROM file
Definition: cxIgstkTool.h:95
Transform3D transform() const
Definition: cxFrame3D.cpp:161
unsigned int mChannelNumber
the channel the tool is connected to
Definition: cxIgstkTool.h:97
static QString getTemplatesAbsoluteFilePath()
QString mLoggingFolderName
path to where log should be saved
Definition: cxIgstkTool.h:106
QString mFileName
absolute path and filename for the new config file
ConfigurationFileParser(QString absoluteConfigFilePath, QString loggingFolder="")
QString mLoggingFolderName
path to where log should be saved
QString mName
the tools name
Definition: cxIgstkTool.h:91
static void saveConfiguration(Configuration &config)
bool m5DOF
whether or not the tool have 5 DOF
Definition: cxIgstkTool.h:100
QString mInstrumentId
The instruments id.
Definition: cxIgstkTool.h:107
std::map< int, Vector3D > mReferencePoints
optional point on the frame, specifying a known reference point, 0,0,0 is default, in sensor space
Definition: cxIgstkTool.h:98
igstk::Transform mCalibration
transform read from mCalibrationFilename
Definition: cxIgstkTool.h:101
std::vector< QString > mClinicalApplications
the tools clinical application applications
Definition: cxIgstkTool.h:93
void reportWarning(QString msg)
Definition: cxLogger.cpp:91
static Frame3D create(const Transform3D &transform)
Definition: cxFrame3D.cpp:149
std::vector< IgstkTracker::InternalStructure > getTrackers()
QString mGraphicsFileName
path to this tools graphics file
Definition: cxIgstkTool.h:103
QString mPictureFileName
path to picture of the tool
Definition: cxIgstkTool.h:104
TRACKING_SYSTEM mTrackerType
what product the tool belongs to
Definition: cxIgstkTool.h:94
A tools internal structure.
Definition: cxIgstkTool.h:80
void reportSuccess(QString msg)
Definition: cxLogger.cpp:93
unsigned int mPortNumber
the port number the tool is connected to
Definition: cxIgstkTool.h:96
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
static QString getRootConfigPath()
return path to root config folder. May be replaced with getExistingConfigPath()
QString mInstrumentScannerId
The id of the ultrasound scanner if the instrument is a probe.
Definition: cxIgstkTool.h:108
void report(QString msg)
Definition: cxLogger.cpp:90
bool mWireless
whether or not the tool is wireless
Definition: cxIgstkTool.h:99
std::vector< QString > getAbsoluteToolFilePaths()
IgstkTool::InternalStructure getTool()
TRACKING_SYSTEM mType
the trackers type
QString mClinical_app
the clinical application this config is made for
Class for reading the files defining a CustusX tool.
QString enum2string(const ENUM &val)
QString mCalibrationFilename
path to the tools calibration file
Definition: cxIgstkTool.h:102