16 #include "itksys/SystemTools.hxx" 24 "Default writer for the example data structure")
46 MITK_INFO <<
"Writing ExampleDataStructure";
50 MITK_ERROR <<
"Sorry, input to ExampleDataStructureWriterService is nullptr!";
55 MITK_ERROR <<
"Sorry, filename has not been set!";
59 std::string ext = itksys::SystemTools::GetFilenameLastExtension(this->
GetOutputLocation());
60 ext = itksys::SystemTools::LowerCase(ext);
75 file << input->GetData();
82 MITK_INFO <<
"Example Data Structure has been written";
91 MITK_ERROR <<
"Unknown error occurred while trying to write file.";
ExampleDataStructureWriterService()
void Write() override
Write the base data to the specified location or output stream.
DataCollection - Class to facilitate loading/accessing structured data.
~ExampleDataStructureWriterService() override
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
const BaseData * GetInput() const override
Get the input data set via SetInput().
void SetOutputLocation(const std::string &location) override
Set the output location.
mitk::ExampleDataStructureWriterService * Clone() const override
us::ServiceRegistration< IFileWriter > RegisterService(us::ModuleContext *context=us::GetModuleContext())
std::string GetOutputLocation() const override
Get the current output location.
Base class for writing mitk::BaseData objects to files or streams.