20 #include <itksys/SystemTools.hxx>
37 MITK_ERROR <<
" Object at " << (
const void *)this->m_Data
38 <<
" is not an mitk::ContourModelSet. Cannot serialize as contour model set.";
42 std::string
filename(this->GetUniqueFilenameInWorkingDirectory());
44 filename += m_FilenameHint;
45 filename +=
".cnt_set";
47 std::string fullname(m_WorkingDirectory);
49 fullname += itksys::SystemTools::ConvertToOutputPath(filename.c_str());
55 writer.
SetInput(const_cast<ContourModelSet *>(contourSet));
58 catch (std::exception &e)
60 MITK_ERROR <<
" Error serializing object at " << (
const void *)this->m_Data <<
" to " << fullname <<
": "
#define MITK_REGISTER_SERIALIZER(classname)
virtual void SetInput(const BaseData *data) override
Set the input data for writing.
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string filename
virtual void SetOutputLocation(const std::string &location) override
Set the output location.
virtual void Write() override
Write the base data to the specified location or output stream.
virtual std::string Serialize() override
Serializes given BaseData object.
XML-based writer for mitk::ContourModelSet.
virtual ~ContourModelSetSerializer()