Medical Imaging Interaction Toolkit  2024.06.99-5f7b36e7
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 mitkContourModelWriter_h
14 #define mitkContourModelWriter_h
15 
16 #include <mitkAbstractFileWriter.h>
17 #include <mitkContourModel.h>
18 
19 // DEPRECATED
20 #include <mitkTimeGeometry.h>
21 
22 namespace mitk
23 {
57  {
58  public:
59  explicit ContourModelWriter(bool writeXMLHeader = true);
60  ~ContourModelWriter() override;
61 
63  void Write() override;
64 
65  protected:
67 
68  mitk::ContourModelWriter *Clone() const override;
69 
77  template <typename T>
78  std::string ConvertToString(T value);
79 
86  void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out);
87 
94  void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out);
95 
100  void WriteXMLHeader(std::ostream &file);
101 
103  void WriteStartElement(const char *const tag, std::ostream &file);
104 
105  void WriteStartElementWithAttribut(const char *const tag,
106  std::vector<std::string> attributes,
107  std::vector<std::string> values,
108  std::ostream &file);
109 
114  void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent = true);
115 
117  void WriteCharacterData(const char *const data, std::ostream &file);
118 
120  void WriteStartElement(std::string &tag, std::ostream &file);
121 
123  void WriteEndElement(std::string &tag, std::ostream &file, const bool &indent = true);
124 
126  void WriteCharacterData(std::string &data, std::ostream &file);
127 
129  void WriteIndent(std::ostream &file);
130 
132 
133  unsigned int m_IndentDepth;
134 
135  unsigned int m_Indent;
136 
137  public:
138  static const char *XML_CONTOURMODEL;
139 
140  static const char *XML_HEAD;
141 
142  static const char *XML_GEOMETRY_INFO;
143 
144  static const char *XML_DATA;
145 
146  static const char *XML_TIME_STEP;
147 
148  static const char *XML_CONTROL_POINTS;
149 
150  static const char *XML_POINT;
151 
152  static const char *XML_X;
153 
154  static const char *XML_Y;
155 
156  static const char *XML_Z;
157  };
158 }
159 
160 #endif
mitk::ContourModelWriter::XML_X
static const char * XML_X
Definition: mitkContourModelWriter.h:152
mitk::ContourModelWriter::WriteStartElementWithAttribut
void WriteStartElementWithAttribut(const char *const tag, std::vector< std::string > attributes, std::vector< std::string > values, std::ostream &file)
mitk::TimeGeometry
Definition: mitkTimeGeometry.h:45
mitk::ContourModelWriter::WriteIndent
void WriteIndent(std::ostream &file)
mitk::ContourModelWriter::WriteGeometryInformation
void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out)
mitk::ContourModelWriter::XML_Y
static const char * XML_Y
Definition: mitkContourModelWriter.h:154
mitk::ContourModelWriter
XML-based writer for mitk::ContourModels.
Definition: mitkContourModelWriter.h:56
mitkAbstractFileWriter.h
mitk::ContourModelWriter::m_IndentDepth
unsigned int m_IndentDepth
Definition: mitkContourModelWriter.h:133
mitk::ContourModelWriter::WriteStartElement
void WriteStartElement(const char *const tag, std::ostream &file)
mitk::ContourModelWriter::XML_DATA
static const char * XML_DATA
Definition: mitkContourModelWriter.h:144
mitk::ContourModelWriter::m_Indent
unsigned int m_Indent
Definition: mitkContourModelWriter.h:135
mitk::AbstractFileWriter::Write
void Write() override=0
Write the base data to the specified location or output stream.
mitkTimeGeometry.h
mitk::AbstractFileWriter
Base class for writing mitk::BaseData objects to files or streams.
Definition: mitkAbstractFileWriter.h:50
mitk::ContourModelWriter::XML_Z
static const char * XML_Z
Definition: mitkContourModelWriter.h:156
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitkContourModel.h
mitk::ContourModelWriter::ConvertToString
std::string ConvertToString(T value)
mitk::ContourModelWriter::XML_CONTOURMODEL
static const char * XML_CONTOURMODEL
Definition: mitkContourModelWriter.h:138
mitk::ContourModelWriter::XML_TIME_STEP
static const char * XML_TIME_STEP
Definition: mitkContourModelWriter.h:146
mitk::ContourModelWriter::XML_HEAD
static const char * XML_HEAD
Definition: mitkContourModelWriter.h:140
mitk::ContourModelWriter::WriteCharacterData
void WriteCharacterData(const char *const data, std::ostream &file)
mitk::ContourModelWriter::ContourModelWriter
ContourModelWriter(bool writeXMLHeader=true)
mitk::ContourModelWriter::WriteXML
void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out)
mitk::ContourModelWriter::Clone
mitk::ContourModelWriter * Clone() const override
mitk::ContourModel
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Definition: mitkContourModel.h:47
mitk::ContourModelWriter::XML_CONTROL_POINTS
static const char * XML_CONTROL_POINTS
Definition: mitkContourModelWriter.h:148
mitk::ContourModelWriter::XML_POINT
static const char * XML_POINT
Definition: mitkContourModelWriter.h:150
mitk::ContourModelWriter::Write
void Write() override
Write the base data to the specified location or output stream.
mitk::ContourModelWriter::m_WriteXMLHeader
bool m_WriteXMLHeader
Definition: mitkContourModelWriter.h:131
mitk::ContourModelWriter::WriteEndElement
void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent=true)
mitk::ContourModelWriter::~ContourModelWriter
~ContourModelWriter() override
mitk::ContourModelWriter::XML_GEOMETRY_INFO
static const char * XML_GEOMETRY_INFO
Definition: mitkContourModelWriter.h:142
mitk::ContourModelWriter::WriteXMLHeader
void WriteXMLHeader(std::ostream &file)