Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 class TiXmlElement;
23 class TiXmlNode;
24 
25 namespace mitk {
26 
28  {
29  public:
31  ~USDeviceReaderXML() override;
32 
34  std::vector<itk::SmartPointer<BaseData>> Read() override;
35  bool ReadUltrasoundDeviceConfiguration();
36 
37  void SetFilename(std::string filename);
38 
39  typedef struct USDeviceConfigData_
40  {
41  double fileversion;
42  std::string deviceType;
43  std::string deviceName;
44  std::string manufacturer;
45  std::string model;
46  std::string comment;
47  std::string host;
48  int port;
49  bool server;
51 
56  int sourceID;
57  std::string filepathVideoSource;
59 
60  std::vector <mitk::USProbe::Pointer> probes;
61 
63  : fileversion(0), deviceType("Unknown"), deviceName("Unknown"),
64  manufacturer("Unknown"), comment(""), host("localhost"),
65  port(18944), server(false), numberOfImageStreams(1),
66  useGreyscale(true), useResolutionOverride(true),
67  resolutionWidth(640), resolutionHeight(480), sourceID(0),
68  filepathVideoSource(""), opencvPort(0)
69  { };
70 
72 
73  USDeviceConfigData &GetUSDeviceConfigData();
74 
75  protected:
77  mitk::USDeviceReaderXML* Clone() const override;
78 
82  void ExtractAttributeInformationOfUltrasoundDeviceTag(TiXmlElement *element);
83 
87  void ExtractAttributeInformationOfGeneralSettingsTag(TiXmlElement *element);
88 
92  void ExtractProbe(TiXmlElement *element);
93 
94  private:
95  std::string m_Filename;
96  USDeviceConfigData m_DeviceConfig;
97  };
98 
99 } // namespace mitk
100 
101 #endif // mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< itk::SmartPointer< BaseData > > Read() override=0
Reads a path or stream and creates a list of BaseData objects.
std::vector< mitk::USProbe::Pointer > probes
Base class for creating mitk::BaseData objects from files or streams.
#define MITKUS_EXPORT
Definition: MitkUSExports.h:15
static mitk::PlanarFigure::Pointer Clone(mitk::PlanarFigure::Pointer original)