Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
Medical Imaging Interaction Toolkit
mitkContourModelWriter.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_CONTOURMODEL_WRITER__H_
14 #define _MITK_CONTOURMODEL_WRITER__H_
15 
16 #include <mitkAbstractFileWriter.h>
17 #include <mitkContourModel.h>
18 
19 // DEPRECATED
20 #include <mitkTimeGeometry.h>
21 
22 namespace mitk
23 {
55  {
56  public:
57  explicit ContourModelWriter(bool writeXMLHeader = true);
58  ~ContourModelWriter() override;
59 
61  void Write() override;
62 
63  protected:
65 
66  mitk::ContourModelWriter *Clone() const override;
67 
75  template <typename T>
76  std::string ConvertToString(T value);
77 
84  void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out);
85 
92  void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out);
93 
98  void WriteXMLHeader(std::ostream &file);
99 
101  void WriteStartElement(const char *const tag, std::ostream &file);
102 
103  void WriteStartElementWithAttribut(const char *const tag,
104  std::vector<std::string> attributes,
105  std::vector<std::string> values,
106  std::ostream &file);
107 
112  void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent = true);
113 
115  void WriteCharacterData(const char *const data, std::ostream &file);
116 
118  void WriteStartElement(std::string &tag, std::ostream &file);
119 
121  void WriteEndElement(std::string &tag, std::ostream &file, const bool &indent = true);
122 
124  void WriteCharacterData(std::string &data, std::ostream &file);
125 
127  void WriteIndent(std::ostream &file);
128 
130 
131  unsigned int m_IndentDepth;
132 
133  unsigned int m_Indent;
134 
135  public:
136  static const char *XML_CONTOURMODEL;
137 
138  static const char *XML_HEAD;
139 
140  static const char *XML_GEOMETRY_INFO;
141 
142  static const char *XML_DATA;
143 
144  static const char *XML_TIME_STEP;
145 
146  static const char *XML_CONTROL_POINTS;
147 
148  static const char *XML_POINT;
149 
150  static const char *XML_X;
151 
152  static const char *XML_Y;
153 
154  static const char *XML_Z;
155  };
156 }
157 
158 #endif
static const char * XML_CONTOURMODEL
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
void WriteIndent(std::ostream &file)
static const char * XML_TIME_STEP
void Write() override=0
Write the base data to the specified location or output stream.
void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out)
void WriteStartElementWithAttribut(const char *const tag, std::vector< std::string > attributes, std::vector< std::string > values, std::ostream &file)
DataCollection - Class to facilitate loading/accessing structured data.
ContourModelWriter(bool writeXMLHeader=true)
void WriteXMLHeader(std::ostream &file)
mitk::ContourModelWriter * Clone() const override
void WriteStartElement(const char *const tag, std::ostream &file)
void Write() override
Write the base data to the specified location or output stream.
XML-based writer for mitk::ContourModels.
void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent=true)
static const char * XML_CONTROL_POINTS
void WriteCharacterData(const char *const data, std::ostream &file)
~ContourModelWriter() override
std::string ConvertToString(T value)
static const char * XML_GEOMETRY_INFO
void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out)
Base class for writing mitk::BaseData objects to files or streams.