diff --git a/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.cpp b/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.cpp index 9a05adcc3c..bd4deff624 100644 --- a/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.cpp +++ b/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.cpp @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkMultiLabelSegmentationSerializer.h" #include "mitkLabelSetImage.h" #include #include -MITK_REGISTER_SERIALIZER(MultiLabelSegmentationSerializer) +MITK_REGISTER_SERIALIZER(LabelSetImageSerializer) -mitk::MultiLabelSegmentationSerializer::MultiLabelSegmentationSerializer() +mitk::LabelSetImageSerializer::LabelSetImageSerializer() { } -mitk::MultiLabelSegmentationSerializer::~MultiLabelSegmentationSerializer() +mitk::LabelSetImageSerializer::~LabelSetImageSerializer() { } -std::string mitk::MultiLabelSegmentationSerializer::Serialize() +std::string mitk::LabelSetImageSerializer::Serialize() { const auto *image = dynamic_cast(m_Data.GetPointer()); if (image == nullptr) { MITK_ERROR << " Object at " << (const void *)this->m_Data << " is not an mitk::LabelSetImage. Cannot serialize as LabelSetImage."; return ""; } std::string filename(this->GetUniqueFilenameInWorkingDirectory()); filename += "_"; filename += m_FilenameHint; filename += ".nrrd"; std::string fullname(m_WorkingDirectory); fullname += "/"; fullname += itksys::SystemTools::ConvertToOutputPath(filename.c_str()); try { mitk::IOUtil::Save(image, fullname); // LabelSetImageWriter::Pointer writer = LabelSetImageWriter::New(); // writer->SetFileName(fullname); // writer->SetInput(const_cast(image)); // writer->Write(); } catch (std::exception &e) { MITK_ERROR << " Error serializing object at " << (const void *)this->m_Data << " to " << fullname << ": " << e.what(); return ""; } return filename; } diff --git a/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.h b/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.h index 5c6fdab21d..0e424e696c 100644 --- a/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.h +++ b/Modules/Multilabel/autoload/IO/mitkMultiLabelSegmentationSerializer.h @@ -1,37 +1,37 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkMultiLabelSegmentationSerializer_h #define mitkMultiLabelSegmentationSerializer_h #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::LabelSetImage for mitk::SceneIO */ - class MultiLabelSegmentationSerializer : public BaseDataSerializer + class LabelSetImageSerializer : public BaseDataSerializer { public: - mitkClassMacro(MultiLabelSegmentationSerializer, BaseDataSerializer); + mitkClassMacro(LabelSetImageSerializer, BaseDataSerializer); itkFactorylessNewMacro(Self); itkCloneMacro(Self); std::string Serialize() override; protected: - MultiLabelSegmentationSerializer(); - ~MultiLabelSegmentationSerializer() override; + LabelSetImageSerializer(); + ~LabelSetImageSerializer() override; }; } // namespace #endif