|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
The common interface of all MITK file writers. More...
#include <mitkIFileWriter.h>


Public Member Functions | |
| ~IFileWriter () override | |
| virtual void | SetInput (const BaseData *data)=0 |
| Set the input data for writing. More... | |
| virtual const BaseData * | GetInput () const =0 |
| Get the input data set via SetInput(). More... | |
| virtual void | SetOutputLocation (const std::string &location)=0 |
| Set the output location. More... | |
| virtual std::string | GetOutputLocation () const =0 |
| Get the current output location. More... | |
| virtual void | SetOutputStream (const std::string &location, std::ostream *os)=0 |
| Set an output stream for writing. More... | |
| virtual std::ostream * | GetOutputStream () const =0 |
| Get the output stream. More... | |
| virtual void | Write ()=0 |
| Write the input data to the output location or stream. More... | |
Public Member Functions inherited from mitk::IFileIO | |
| virtual | ~IFileIO () |
| virtual ConfidenceLevel | GetConfidenceLevel () const =0 |
| Get the confidence level of this reader or writer for the current input. More... | |
| virtual Options | GetOptions () const =0 |
| Get the current options map. More... | |
| virtual us::Any | GetOption (const std::string &name) const =0 |
| Get the value of a specific option. More... | |
| virtual void | SetOptions (const Options &options)=0 |
| Set multiple options at once. More... | |
| virtual void | SetOption (const std::string &name, const us::Any &value)=0 |
| Set the value of a specific option. More... | |
| virtual void | AddProgressCallback (const ProgressCallback &callback)=0 |
| Register a progress callback. More... | |
| virtual void | RemoveProgressCallback (const ProgressCallback &callback)=0 |
| Remove a previously registered progress callback. More... | |
Static Public Member Functions | |
| static std::string | PROP_BASEDATA_TYPE () |
| Service property name for the supported mitk::BaseData sub-class. More... | |
Static Public Member Functions inherited from mitk::IFileIO | |
| static std::string | PROP_DESCRIPTION () |
| Service property name for a human-readable description. More... | |
| static std::string | PROP_MIMETYPE () |
| Service property name for the mime-type associated with this reader or writer. More... | |
Additional Inherited Members | |
Public Types inherited from mitk::IFileIO | |
| enum | ConfidenceLevel { Unsupported , PartiallySupported , Supported } |
| A confidence level describing the reader's or writer's ability to handle the given data or file format. More... | |
| typedef std::map< std::string, us::Any > | Options |
| Options for reading or writing data. More... | |
| typedef mitk::MessageAbstractDelegate1< float > | ProgressCallback |
| Callback delegate type for progress reporting. More... | |
The common interface of all MITK file writers.
Implementations of this interface must be registered as a service to make themselves available via the service registry. If the implementation is stateful, the service should be registered using a PrototypeServiceFactory.
The file writer implementation is associated with a mime-type, specified in the service property PROP_MIMETYPE(), and a mitk::BaseData sub-class as specified in the PROP_BASEDATA_TYPE() service property. The specified mime-type should have a corresponding CustomMimeType service object, registered by the writer or some other party.
It is recommended to derive new implementations from AbstractFileWriter or AbstractFileIO (if both reader and writer are implemented), which provide correct service registration semantics.
A more in-depth explanation is available on the concepts pages in the developer manual.
Definition at line 56 of file mitkIFileWriter.h.
|
override |
|
pure virtual |
Get the input data set via SetInput().
nullptr if none was set. Implemented in mitk::AbstractFileWriter.
|
pure virtual |
Get the current output location.
If no stream is set (i.e. GetOutputStream() returns nullptr), the returned location string is required to represent a file-system path.
Implemented in mitk::AbstractFileWriter.
|
pure virtual |
Get the output stream.
nullptr if no stream was set. Implemented in mitk::AbstractFileWriter.
|
static |
Service property name for the supported mitk::BaseData sub-class.
The property value must be of type std::string and should correspond to the class name returned by BaseData::GetNameOfClass().
|
pure virtual |
Set the input data for writing.
| [in] | data | Pointer to the BaseData object to be written. |
Implemented in mitk::AbstractFileWriter.
|
pure virtual |
Set the output location.
| [in] | location | A file-system path where data shall be written. |
The location argument specifies a file-system path where the input data must be written. This method must remove any previously set output stream.
Implemented in mitk::AbstractFileWriter.
|
pure virtual |
Set an output stream for writing.
| [in] | location | A custom label for the output stream, or a file-system path. |
| [in] | os | The output stream, or nullptr to clear the stream. |
If os is nullptr, this clears the current output stream and location is interpreted as a file-system path. Otherwise, location is a custom label describing the output stream os.
Implemented in mitk::AbstractFileWriter.
|
pure virtual |
Write the input data to the output location or stream.
If GetOutputStream() returns a non-null value, this method must use the returned stream object to write the data set via SetInput(). If no output stream was set, the data must be written to the path returned by GetOutputLocation().
| mitk::Exception | if the data could not be written. |
Implemented in mitk::PlyFileWriterService, mitk::PointSetWriterService, mitk::GeometryDataWriterService, mitk::AbstractFileWriter, mitk::ContourModelWriter, mitk::ContourModelSetWriter, mitk::ExampleDataStructureWriterService, mitk::SegmentationTaskListIO, mitk::ROIIO, mitk::PlanarFigureIO, mitk::MultiLabelSegmentationStackWriterBase, mitk::MultiLabelSegmentationIO, mitk::DICOMSegmentationIO, mitk::MAPRegistrationWrapperIO, mitk::PlyFileWriterService, mitk::DICOMPMIO, mitk::SurfaceVtkXmlIO, mitk::SurfaceVtkLegacyIO, mitk::SurfaceStlIO, mitk::PointSetWriterService, mitk::ImageVtkXmlIO, mitk::ImageVtkLegacyIO, mitk::ItkImageIO, mitk::GeometryDataWriterService, mitk::ContourModelWriter, mitk::ContourModelSetWriter, and mitk::ExampleDataStructureWriterService.