Medical Imaging Interaction Toolkit  2026.06.00
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 
38 
39  // -------------- AbstractFileReader -------------
40 
42 
45 
46  // -------------- AbstractFileWriter -------------
47 
49  void Write() override;
50 
53 
54  protected:
60  std::vector<itk::SmartPointer<BaseData>> DoRead() override;
61 
62  using DoubleList = std::list<double>;
71  DoubleList GetDoubleAttributeListFromXMLNode(const tinyxml2::XMLElement* e, const char* attributeNameBase, unsigned int count);
72 
78  static mitk::Vector3D GetVectorFromXMLNode(const tinyxml2::XMLElement* e);
79 
85  static mitk::Point3D GetPointFromXMLNode(const tinyxml2::XMLElement* e);
86 
95  static tinyxml2::XMLElement* CreateXMLVectorElement(tinyxml2::XMLDocument& doc, const char* name, itk::FixedArray<mitk::ScalarType, 3> v);
96 
97  private:
98  PlanarFigureIO *IOClone() const override;
99  };
100 } // end of namespace mitk
101 
102 #endif
Abstract base class for implementing a combined file reader and writer.
std::vector< itk::SmartPointer< BaseData > > Read() override
Read data and create a list of BaseData objects.
Read and write mitk::PlanarFigure objects to/from XML files.
PlanarFigureIO()
Default constructor. Registers reader/writer for the PlanarFigure MIME type.
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
Return the confidence level for reading the given file as a PlanarFigure.
std::list< double > DoubleList
std::vector< itk::SmartPointer< BaseData > > DoRead() override
Read PlanarFigure objects 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 PlanarFigure to an XML file.
ConfidenceLevel GetWriterConfidenceLevel() const override
Return the confidence level for writing the given data as a PlanarFigure.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.
ConfidenceLevel
A confidence level describing the reader's or writer's ability to handle the given data or file forma...
Definition: mitkIFileIO.h:57