Medical Imaging Interaction Toolkit  2021.10.99-fd647480
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_HEADER_INCLUDED_
15 #define mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
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 
29  {
30  public:
32  ~USDeviceReaderXML() override;
33 
34  using AbstractFileReader::Read;
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 
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 // mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< mitk::USProbe::Pointer > probes
Base class for creating mitk::BaseData objects from files or streams.
#define MITKUS_EXPORT
Definition: MitkUSExports.h:15