Medical Imaging Interaction Toolkit  2025.12.02
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 mitkPlanarFigureIO_h
14 #define mitkPlanarFigureIO_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 
41 
43 
44  // -------------- AbstractFileWriter -------------
45 
46  void Write() 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
Abstract class for implementing a reader and writer.
std::vector< itk::SmartPointer< BaseData > > Read() override
Reads a path or stream and creates a list of BaseData objects.
static mitk::Vector3D GetVectorFromXMLNode(const tinyxml2::XMLElement *e)
parses the element for the attributes x,y,z and returns a mitk::Vector3D filled with these values
static tinyxml2::XMLElement * CreateXMLVectorElement(tinyxml2::XMLDocument &doc, const char *name, itk::FixedArray< mitk::ScalarType, 3 > v)
creates a TinyXML element that contains x, y, and z values
ConfidenceLevel GetReaderConfidenceLevel() const override
std::list< double > DoubleList
std::vector< itk::SmartPointer< BaseData > > DoRead() override
Reads a number of mitk::PlanarFigures from the file system.
mitk::PlanarFigure InputType
DoubleList GetDoubleAttributeListFromXMLNode(const tinyxml2::XMLElement *e, const char *attributeNameBase, unsigned int count)
parses the element for the attributes name0 to nameN, where "name" and the number of attributes to re...
static mitk::Point3D GetPointFromXMLNode(const tinyxml2::XMLElement *e)
parses the element for the attributes x,y,z and returns a mitk::Point3D filled with these values
void Write() override
Write the base data to the specified location or output stream.
ConfidenceLevel GetWriterConfidenceLevel() const override
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
int count(void)
Find image slices visible on a given plane.
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data.
Definition: mitkIFileIO.h:46