Medical Imaging Interaction Toolkit  2022.04.99-685cdc74
Medical Imaging Interaction Toolkit
mitkPlanarFigureIO.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 #ifndef MITK_PLANAR_FIGURE_IO_H
14 #define MITK_PLANAR_FIGURE_IO_H
15 
16 #include <mitkAbstractFileIO.h>
17 #include <mitkPlanarFigure.h>
18 
19 namespace tinyxml2
20 {
21  class XMLDocument;
22  class XMLElement;
23 }
24 
25 namespace mitk
26 {
32  {
33  public:
35 
37 
38  // -------------- AbstractFileReader -------------
39 
40  using AbstractFileReader::Read;
41 
42  ConfidenceLevel GetReaderConfidenceLevel() const override;
43 
44  // -------------- AbstractFileWriter -------------
45 
46  void Write() override;
47  ConfidenceLevel GetWriterConfidenceLevel() const override;
48 
49  protected:
55  std::vector<itk::SmartPointer<BaseData>> DoRead() override;
56 
57  using DoubleList = std::list<double>;
66  DoubleList GetDoubleAttributeListFromXMLNode(const tinyxml2::XMLElement* e, const char* attributeNameBase, unsigned int count);
67 
73  static mitk::Vector3D GetVectorFromXMLNode(const tinyxml2::XMLElement* e);
74 
80  static mitk::Point3D GetPointFromXMLNode(const tinyxml2::XMLElement* e);
81 
90  static tinyxml2::XMLElement* CreateXMLVectorElement(tinyxml2::XMLDocument& doc, const char* name, itk::FixedArray<mitk::ScalarType, 3> v);
91 
92  private:
93  PlanarFigureIO *IOClone() const override;
94  };
95 } // end of namespace mitk
96 
97 #endif // MITK_PLANAR_FIGURE_IO_H
DataCollection - Class to facilitate loading/accessing structured data.
std::list< double > DoubleList
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data...
Definition: mitkIFileIO.h:45
mitk::PlanarFigure InputType
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
Abstract class for implementing a reader and writer.