Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::IFileIO Struct Referenceabstract

Common interface for all MITK file readers and writers. More...

#include <mitkIFileIO.h>

Inheritance diagram for mitk::IFileIO:

Public Types

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...
 

Public Member Functions

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_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...
 

Detailed Description

Common interface for all MITK file readers and writers.

This interface defines the shared API for file I/O operations in MITK, including confidence levels for format support, user-configurable options, and progress reporting. It is not meant to be implemented directly. It is inherited from IFileWriter and IFileReader, and a default implementation is provided in AbstractFileIO via AbstractFileWriter and AbstractFileReader.

See also
IFileReader
IFileWriter
AbstractFileIO
AbstractFileReader
AbstractFileWriter

Definition at line 43 of file mitkIFileIO.h.

Member Typedef Documentation

◆ Options

typedef std::map<std::string, us::Any> mitk::IFileIO::Options

Options for reading or writing data.

Options are key-value pairs used in reader or writer implementations to customize certain aspects of the reading/writing process. Options may be supplied by users calling the SetOption() method or they may be presented as an input mask in the context of a graphical user interface.

The keys are human-readable labels and the type of the option value specifies the user interface representation. If a key contains multiple segments (sub-strings separated by a '.' character), only the last segment is displayed. If the last segment is equal to the string "enum", the option is treated as a finite enumeration of values where the values are contained in a corresponding std::vector<std::string> value. The same option key without the "enum" segment is considered to hold the current selection from the enumeration.

Definition at line 80 of file mitkIFileIO.h.

◆ ProgressCallback

Callback delegate type for progress reporting.

The delegate receives a float value between 0.0 and 1.0 indicating the current progress of a read or write operation.

Definition at line 88 of file mitkIFileIO.h.

Member Enumeration Documentation

◆ ConfidenceLevel

A confidence level describing the reader's or writer's ability to handle the given data or file format.

Higher values indicate stronger confidence. The level is used to rank multiple competing reader or writer implementations so that the most suitable one is selected automatically.

Enumerator
Unsupported 

The reader/writer cannot handle the data.

PartiallySupported 

The reader/writer can handle the data with limitations.

Supported 

The reader/writer fully supports the data.

Definition at line 56 of file mitkIFileIO.h.

Constructor & Destructor Documentation

◆ ~IFileIO()

virtual mitk::IFileIO::~IFileIO ( )
virtual

Member Function Documentation

◆ AddProgressCallback()

virtual void mitk::IFileIO::AddProgressCallback ( const ProgressCallback &  callback)
pure virtual

Register a progress callback.

Parameters
[in]callbackThe callback delegate to add.

The callback will be invoked during read or write operations to report progress.

Implemented in mitk::AbstractFileWriter, and mitk::AbstractFileReader.

◆ GetConfidenceLevel()

virtual ConfidenceLevel mitk::IFileIO::GetConfidenceLevel ( ) const
pure virtual

Get the confidence level of this reader or writer for the current input.

Returns
The confidence level indicating how well this implementation can handle the current data or file format.

The level is used to rank multiple competing implementations. A higher confidence level results in the reader or writer being preferred.

Implemented in mitk::MultiLabelSegmentationStackWriterBase, mitk::MultiLabelSegmentationStackReader, mitk::LegacyLabelSetImageIO, mitk::BaseDICOMReaderService, mitk::AbstractFileWriter, mitk::AbstractFileReader, mitk::AbstractFileIOWriter, and mitk::AbstractFileIOReader.

◆ GetOption()

virtual us::Any mitk::IFileIO::GetOption ( const std::string &  name) const
pure virtual

Get the value of a specific option.

Parameters
[in]nameThe name of the option.
Returns
The current value of the option.

Implemented in mitk::AbstractFileWriter, mitk::AbstractFileReader, and mitk::CESTDICOMManualReaderService.

◆ GetOptions()

virtual Options mitk::IFileIO::GetOptions ( ) const
pure virtual

Get the current options map.

Returns
A map of option names to their current values.

The returned map contains both default and user-set options.

Implemented in mitk::AbstractFileWriter, mitk::AbstractFileReader, and mitk::CESTDICOMManualReaderService.

◆ PROP_DESCRIPTION()

static std::string mitk::IFileIO::PROP_DESCRIPTION ( )
static

Service property name for a human-readable description.

The property value must be of type std::string.

Returns
The property name string.

◆ PROP_MIMETYPE()

static std::string mitk::IFileIO::PROP_MIMETYPE ( )
static

Service property name for the mime-type associated with this reader or writer.

The property value must be of type std::string and must correspond to a registered CustomMimeType name.

Returns
The property name string.
See also
CustomMimeType

◆ RemoveProgressCallback()

virtual void mitk::IFileIO::RemoveProgressCallback ( const ProgressCallback &  callback)
pure virtual

Remove a previously registered progress callback.

Parameters
[in]callbackThe callback delegate to remove.

Implemented in mitk::AbstractFileWriter, and mitk::AbstractFileReader.

◆ SetOption()

virtual void mitk::IFileIO::SetOption ( const std::string &  name,
const us::Any &  value 
)
pure virtual

Set the value of a specific option.

Parameters
[in]nameThe name of the option.
[in]valueThe new value for the option.

Implemented in mitk::AbstractFileWriter, and mitk::AbstractFileReader.

◆ SetOptions()

virtual void mitk::IFileIO::SetOptions ( const Options &  options)
pure virtual

Set multiple options at once.

Parameters
[in]optionsA map of option names to their new values.

Implemented in mitk::AbstractFileWriter, and mitk::AbstractFileReader.


The documentation for this struct was generated from the following file: