Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitkUSDeviceReaderXML.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef mitkUSDeviceReaderXML_h
15 #define mitkUSDeviceReaderXML_h
16 
17 #include <MitkUSExports.h>
18 
19 #include <mitkAbstractFileReader.h>
20 #include <mitkUSProbe.h>
21 
22 namespace tinyxml2 {
23  class XMLElement;
24 }
25 
26 namespace mitk {
27 
28  class MITKUS_EXPORT USDeviceReaderXML : public AbstractFileReader
29  {
30  public:
32  ~USDeviceReaderXML() override;
33 
35 
36  bool ReadUltrasoundDeviceConfiguration();
37 
38  void SetFilename(std::string filename);
39 
40  typedef struct USDeviceConfigData_
41  {
42  double fileversion;
43  std::string deviceType;
44  std::string deviceName;
45  std::string manufacturer;
46  std::string model;
47  std::string comment;
48  std::string host;
49  int port;
50  bool server;
52 
57  int sourceID;
58  std::string filepathVideoSource;
60 
61  std::vector <mitk::USProbe::Pointer> probes;
62 
64  : fileversion(0), deviceType("Unknown"), deviceName("Unknown"),
65  manufacturer("Unknown"), comment(""), host("localhost"),
66  port(18944), server(false), numberOfImageStreams(1),
67  useGreyscale(true), useResolutionOverride(true),
68  resolutionWidth(640), resolutionHeight(480), sourceID(0),
69  filepathVideoSource(""), opencvPort(0)
70  { };
71 
72  }USDeviceConfigData;
73 
74  USDeviceConfigData &GetUSDeviceConfigData();
75 
76  protected:
77  std::vector<itk::SmartPointer<BaseData>> DoRead() override;
78 
80  mitk::USDeviceReaderXML* Clone() const override;
81 
85  void ExtractAttributeInformationOfUltrasoundDeviceTag(const tinyxml2::XMLElement *element);
86 
90  void ExtractAttributeInformationOfGeneralSettingsTag(const tinyxml2::XMLElement *element);
91 
95  void ExtractProbe(const tinyxml2::XMLElement *element);
96 
97  private:
98  std::string m_Filename;
99  USDeviceConfigData m_DeviceConfig;
100  };
101 
102 } // namespace mitk
103 
104 #endif
mitk::USDeviceReaderXML::USDeviceConfigData_::comment
std::string comment
Definition: mitkUSDeviceReaderXML.h:47
mitk::USDeviceReaderXML::USDeviceConfigData_::deviceName
std::string deviceName
Definition: mitkUSDeviceReaderXML.h:44
mitk::USDeviceReaderXML::USDeviceConfigData_
Definition: mitkUSDeviceReaderXML.h:40
mitk::USDeviceReaderXML::USDeviceConfigData_::server
bool server
Definition: mitkUSDeviceReaderXML.h:50
mitk::USDeviceReaderXML::USDeviceConfigData_::port
int port
Definition: mitkUSDeviceReaderXML.h:49
mitk::USDeviceReaderXML::USDeviceConfigData_::resolutionWidth
int resolutionWidth
Definition: mitkUSDeviceReaderXML.h:55
mitk::USDeviceReaderXML::USDeviceConfigData_::model
std::string model
Definition: mitkUSDeviceReaderXML.h:46
mitk::USDeviceReaderXML::USDeviceConfigData_::sourceID
int sourceID
Definition: mitkUSDeviceReaderXML.h:57
mitk::AbstractFileReader
Base class for creating mitk::BaseData objects from files or streams.
Definition: mitkAbstractFileReader.h:42
mitk::USDeviceReaderXML::USDeviceConfigData_::manufacturer
std::string manufacturer
Definition: mitkUSDeviceReaderXML.h:45
mitk::USDeviceReaderXML::USDeviceConfigData_::resolutionHeight
int resolutionHeight
Definition: mitkUSDeviceReaderXML.h:56
mitk::USDeviceReaderXML::USDeviceConfigData_::fileversion
double fileversion
Definition: mitkUSDeviceReaderXML.h:42
mitkUSProbe.h
mitk::USDeviceReaderXML::USDeviceConfigData_::probes
std::vector< mitk::USProbe::Pointer > probes
Definition: mitkUSDeviceReaderXML.h:61
mitk::USDeviceReaderXML::USDeviceConfigData_::useGreyscale
bool useGreyscale
Definition: mitkUSDeviceReaderXML.h:53
mitk::USDeviceReaderXML::USDeviceConfigData_::filepathVideoSource
std::string filepathVideoSource
Definition: mitkUSDeviceReaderXML.h:58
mitk::USDeviceReaderXML::USDeviceConfigData_::numberOfImageStreams
int numberOfImageStreams
Definition: mitkUSDeviceReaderXML.h:51
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::USDeviceReaderXML
Definition: mitkUSDeviceReaderXML.h:28
mitk::USDeviceReaderXML::USDeviceConfigData_::deviceType
std::string deviceType
Definition: mitkUSDeviceReaderXML.h:43
mitkAbstractFileReader.h
mitk::USDeviceReaderXML::USDeviceConfigData_::host
std::string host
Definition: mitkUSDeviceReaderXML.h:48
mitk::USDeviceReaderXML::USDeviceConfigData_::useResolutionOverride
bool useResolutionOverride
Definition: mitkUSDeviceReaderXML.h:54
tinyxml2
Definition: mitkXMLSerializable.h:20
mitk::AbstractFileReader::Read
std::vector< itk::SmartPointer< BaseData > > Read() override
Reads a path or stream and creates a list of BaseData objects.
mitk::USDeviceReaderXML::USDeviceConfigData_::USDeviceConfigData_
USDeviceConfigData_()
Definition: mitkUSDeviceReaderXML.h:63
mitk::USDeviceReaderXML::USDeviceConfigData_::opencvPort
int opencvPort
Definition: mitkUSDeviceReaderXML.h:59