Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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
mitk::PlanarFigureIO::CreateXMLVectorElement
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
mitk::PlanarFigureIO::GetVectorFromXMLNode
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
mitk::PlanarFigureIO::GetReaderConfidenceLevel
ConfidenceLevel GetReaderConfidenceLevel() const override
mitk::PlanarFigure
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Definition: mitkPlanarFigure.h:50
mitk::PlanarFigureIO::GetDoubleAttributeListFromXMLNode
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...
mitk::PlanarFigureIO::PlanarFigureIO
PlanarFigureIO()
mitkPlanarFigure.h
mitk::PlanarFigureIO::GetWriterConfidenceLevel
ConfidenceLevel GetWriterConfidenceLevel() const override
mitk::PlanarFigureIO::GetPointFromXMLNode
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
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlanarFigureIO
Definition: mitkPlanarFigureIO.h:31
mitk::PlanarFigureIO::Write
void Write() override
Write the base data to the specified location or output stream.
mitk::Vector< ScalarType, 3 >
mitk::Point< ScalarType, 3 >
mitkAbstractFileIO.h
mitk::PlanarFigureIO::DoRead
std::vector< itk::SmartPointer< BaseData > > DoRead() override
Reads a number of mitk::PlanarFigures from the file system.
mitk::PlanarFigureIO::InputType
mitk::PlanarFigure InputType
Definition: mitkPlanarFigureIO.h:34
tinyxml2
Definition: mitkContourModelReader.h:25
mitk::IFileIO::ConfidenceLevel
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data.
Definition: mitkIFileIO.h:45
mitk::PlanarFigureIO::DoubleList
std::list< double > DoubleList
Definition: mitkPlanarFigureIO.h:57
mitk::AbstractFileIO
Abstract class for implementing a reader and writer.
Definition: mitkAbstractFileIO.h:69
mitk::AbstractFileReader::Read
std::vector< itk::SmartPointer< BaseData > > Read() override
Reads a path or stream and creates a list of BaseData objects.