Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkNavigationDataReaderXML.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 MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
15 #define MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
16 
17 #include <MitkIGTIOExports.h>
18 
19 #include <mitkAbstractFileReader.h>
20 #include <mitkNavigationDataSet.h>
21 // includes for exceptions
22 #include <mitkIGTException.h>
23 #include <mitkIGTIOException.h>
24 
25 class TiXmlElement;
26 class TiXmlNode;
27 
28 namespace mitk {
29 
31  {
32  public:
34  ~NavigationDataReaderXML() override;
35 
37  std::vector<itk::SmartPointer<BaseData>> Read() override;
38 
39  protected:
40 
42  mitk::NavigationDataReaderXML* Clone() const override;
43 
44  NavigationDataSet::Pointer ReadNavigationDataSet();
45 
51  mitk::NavigationData::Pointer ReadVersion1();
52  mitk::NavigationData::Pointer ReadNavigationData(TiXmlElement* elem);
53 
54  std::string m_FileName;
55 
56  TiXmlElement* m_parentElement;
57  TiXmlNode* m_currentNode;
58 
61 
62  // -- deprecated | begin
63  //std::istream* m_Stream; ///< stores a pointer to the input stream
64  bool m_StreamEnd;
66  std::string m_ErrorMessage;
67 
75  //void CreateStreamFromFilename();
76 
82  unsigned int GetFileVersion(std::istream* stream);
83 
89  unsigned int GetNumberOfNavigationDatas(std::istream* stream);
90 
97  void StreamInvalid(std::string message);
98  // -- deprecated | end
99  private:
100  NavigationDataSet::Pointer Read(std::istream* stream);
101  NavigationDataSet::Pointer Read(std::string fileName);
102  };
103 
104 } // namespace mitk
105 
106 #endif // MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
DataCollection - Class to facilitate loading/accessing structured data.
int m_FileVersion
indicates which XML encoding is used
std::vector< itk::SmartPointer< BaseData > > Read() override=0
Reads a path or stream and creates a list of BaseData objects.
#define MITKIGTIO_EXPORT
bool m_StreamValid
stores if the input stream is valid or not
std::string m_ErrorMessage
stores the error message if the stream is invalid
Base class for creating mitk::BaseData objects from files or streams.
int m_NumberOfOutputs
stores the number of outputs known from the XML document
bool m_StreamEnd
stores if the input stream arrived at end
static mitk::PlanarFigure::Pointer Clone(mitk::PlanarFigure::Pointer original)