|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
The common interface for all MITK file readers. More...
#include <mitkIFileReader.h>


Public Member Functions | |
| ~IFileReader () override | |
| virtual void | SetInput (const std::string &location)=0 |
| Set the input file path. More... | |
| virtual void | SetInput (const std::string &location, std::istream *is)=0 |
| Set an input stream to read from. More... | |
| virtual std::string | GetInputLocation () const =0 |
| Get the current input location. More... | |
| virtual std::istream * | GetInputStream () const =0 |
| Get the input stream. More... | |
| virtual std::vector< itk::SmartPointer< BaseData > > | Read ()=0 |
| Read the specified file or input stream and return its contents. More... | |
| virtual DataStorage::SetOfObjects::Pointer | Read (mitk::DataStorage &ds)=0 |
| Read the specified file or input stream, loading its contents into the provided DataStorage. More... | |
| virtual std::vector< std::string > | GetReadFiles ()=0 |
| Get the list of files that were loaded during the last Read() call. More... | |
| virtual void | SetProperties (const PropertyList *properties)=0 |
| Optionally provide base data properties as a source of meta data. More... | |
| virtual | ~IFileReader () |
| virtual void | SetInput (const std::string &location)=0 |
| Set the input location. More... | |
| virtual void | SetInput (const std::string &location, std::istream *is)=0 |
| Set an input stream to read from. More... | |
| virtual std::string | GetInputLocation () const =0 |
| Get the current input location. More... | |
| virtual std::istream * | GetInputStream () const =0 |
| Get the input stream. More... | |
| virtual std::vector< itk::SmartPointer< BaseData > > | Read ()=0 |
| Reads the specified file or input stream and returns its contents. More... | |
| virtual DataStorage::SetOfObjects::Pointer | Read (mitk::DataStorage &ds)=0 |
| Reads the specified file or input stream, loading its contents into the provided DataStorage. 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... | |
Protected Member Functions | |
| virtual const PropertyList * | GetProperties () const =0 |
| Get the properties set via SetProperties(). 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... | |
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... | |
The common interface for all MITK file readers.
The common interface for all providers of models for fitting in mitk.
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 reader implementation is associated with a mime-type, specified in the service property PROP_MIMETYPE(). The specified mime-type should have a corresponding CustomMimeType service object, registered by the reader or some other party.
It is recommended to derive new implementations from AbstractFileReader or from AbstractFileIO (if both reader and writer are implemented), which provide correct service registration semantics.
Implementations of this interface must be registered as a service to make themselves available via the service registry. If the implementation is state-full, the service should be registered using a PrototypeServiceFactory.
It is recommended to derive new implementations from ModelFitProviderBase, which provide correct service registration semantics.
Definition at line 62 of file mitkIFileReader.h.
|
override |
|
virtual |
|
pure virtual |
Get the current input location.
Implemented in mitk::AbstractFileReader.
|
pure virtual |
|
pure virtual |
Get the input stream.
nullptr if no stream was set. Implemented in mitk::AbstractFileReader.
|
pure virtual |
Get the input stream.
Implemented in mitk::AbstractFileReader.
|
protectedpure virtual |
Get the properties set via SetProperties().
nullptr if none was set. Implemented in mitk::AbstractFileReader.
|
pure virtual |
Get the list of files that were loaded during the last Read() call.
Implemented in mitk::AbstractFileReader.
|
pure virtual |
Read the specified file or input stream and return its contents.
If GetInputStream() returns a non-null value, this method must use the returned stream object to read the data from. If no input stream was set, the data must be read from the path returned by GetInputLocation().
| mitk::Exception | if the data could not be read. |
Implemented in mitk::SegmentationTaskListIO, mitk::SceneJsonFileReader, mitk::SceneFileReader, mitk::RTStructureSetReaderService, mitk::RTPlanReaderService, mitk::RTDoseReaderService, mitk::ROIIO, mitk::PlanarFigureIO, mitk::MultiLabelSegmentationIO, mitk::LegacyLabelSetImageIO, mitk::DICOMSegmentationIO, mitk::MAPRegistrationWrapperIO, mitk::PlyFileReaderService, mitk::ObjFileReaderService, mitk::DICOMPMIO, mitk::BaseDICOMReaderService, mitk::SurfaceVtkXmlIO, mitk::SurfaceVtkLegacyIO, mitk::SurfaceStlIO, mitk::PointSetReaderService, mitk::ImageVtkXmlIO, mitk::ImageVtkLegacyIO, mitk::ItkImageIO, mitk::GeometryDataReaderService, mitk::ContourModelSetReader, mitk::ContourModelReader, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMReaderService, mitk::ExampleDataStructureReaderService, mitk::SegmentationTaskListIO, mitk::SceneJsonFileReader, mitk::SceneFileReader, mitk::RTStructureSetReaderService, mitk::RTPlanReaderService, mitk::RTDoseReaderService, mitk::ROIIO, mitk::PlanarFigureIO, mitk::MultiLabelSegmentationIO, mitk::LegacyLabelSetImageIO, mitk::DICOMSegmentationIO, mitk::MAPRegistrationWrapperIO, mitk::PlyFileReaderService, mitk::ObjFileReaderService, mitk::DICOMPMIO, mitk::BaseDICOMReaderService, mitk::SurfaceVtkXmlIO, mitk::SurfaceVtkLegacyIO, mitk::SurfaceStlIO, mitk::PointSetReaderService, mitk::ImageVtkXmlIO, mitk::ImageVtkLegacyIO, mitk::ItkImageIO, mitk::GeometryDataReaderService, mitk::AbstractFileReader, mitk::ContourModelSetReader, mitk::ContourModelReader, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMReaderService, mitk::CESTDICOMReaderService, and mitk::ExampleDataStructureReaderService.
|
pure virtual |
Reads the specified file or input stream and returns its contents.
If GetInputStream() returns a non-null value, this method must use the returned stream object to read the data from. If no input stream was set, the data must be read from the path returned by GetInputLocation().
| mitk::Exception |
Implemented in mitk::SegmentationTaskListIO, mitk::SceneJsonFileReader, mitk::SceneFileReader, mitk::RTStructureSetReaderService, mitk::RTPlanReaderService, mitk::RTDoseReaderService, mitk::ROIIO, mitk::PlanarFigureIO, mitk::MultiLabelSegmentationIO, mitk::LegacyLabelSetImageIO, mitk::DICOMSegmentationIO, mitk::MAPRegistrationWrapperIO, mitk::PlyFileReaderService, mitk::ObjFileReaderService, mitk::DICOMPMIO, mitk::BaseDICOMReaderService, mitk::SurfaceVtkXmlIO, mitk::SurfaceVtkLegacyIO, mitk::SurfaceStlIO, mitk::PointSetReaderService, mitk::ImageVtkXmlIO, mitk::ImageVtkLegacyIO, mitk::ItkImageIO, mitk::GeometryDataReaderService, mitk::ContourModelSetReader, mitk::ContourModelReader, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMReaderService, mitk::ExampleDataStructureReaderService, mitk::SegmentationTaskListIO, mitk::SceneJsonFileReader, mitk::SceneFileReader, mitk::RTStructureSetReaderService, mitk::RTPlanReaderService, mitk::RTDoseReaderService, mitk::ROIIO, mitk::PlanarFigureIO, mitk::MultiLabelSegmentationIO, mitk::LegacyLabelSetImageIO, mitk::DICOMSegmentationIO, mitk::MAPRegistrationWrapperIO, mitk::PlyFileReaderService, mitk::ObjFileReaderService, mitk::DICOMPMIO, mitk::BaseDICOMReaderService, mitk::SurfaceVtkXmlIO, mitk::SurfaceVtkLegacyIO, mitk::SurfaceStlIO, mitk::PointSetReaderService, mitk::ImageVtkXmlIO, mitk::ImageVtkLegacyIO, mitk::ItkImageIO, mitk::GeometryDataReaderService, mitk::AbstractFileReader, mitk::ContourModelSetReader, mitk::ContourModelReader, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMManualReaderService, mitk::CESTDICOMReaderService, mitk::CESTDICOMReaderService, and mitk::ExampleDataStructureReaderService.
|
pure virtual |
Read the specified file or input stream, loading its contents into the provided DataStorage.
| [in,out] | ds | The DataStorage to which the data is added. |
ds.This method may be overridden by implementations to create or reconstruct a hierarchy of mitk::DataNode instances in the provided mitk::DataStorage.
| mitk::Exception | if the data could not be read. |
Implemented in mitk::AbstractFileReader, mitk::SceneJsonFileReader, and mitk::SceneFileReader.
|
pure virtual |
Reads the specified file or input stream, loading its contents into the provided DataStorage.
| ds | The DataStorage to which the data is added. |
ds.This method may be overridden by implementations to create or reconstructed a hierarchy of mitk::DataNode instances in the provided mitk::DataStorage.
| mitk::Exception |
Implemented in mitk::AbstractFileReader, mitk::SceneJsonFileReader, and mitk::SceneFileReader.
|
pure virtual |
Set the input file path.
| [in] | location | The absolute file-system path to read from. |
This clears any previously set input stream. The given location is used as the file-system path for reading.
Implemented in mitk::AbstractFileReader.
|
pure virtual |
Set the input location.
| location | The file name to read from. |
Implemented in mitk::AbstractFileReader.
|
pure virtual |
Set an input stream to read from.
| [in] | location | A custom label for the input stream, or a file-system path. |
| [in] | is | The input stream, or nullptr to clear the stream. |
If is is nullptr, this clears the current input stream and location is interpreted as a file-system path. Otherwise, location is a custom label describing the input stream is.
Implemented in mitk::AbstractFileReader.
|
pure virtual |
Set an input stream to read from.
| location | A custom label for the input stream. |
| is | The input stream. |
If is is NULL, this clears the current input stream and location is interpreted as a file-system path. Otherwise, location is a custom label describing the input stream is.
Implemented in mitk::AbstractFileReader.
|
pure virtual |
Optionally provide base data properties as a source of meta data.
| [in] | properties | A PropertyList containing meta data from a previous read operation, or nullptr to clear. |
The purpose of this method is not to preset the base data property list of the read data but to provide access to meta data of previous read operations that may be beneficial for the new read operation.
A typical use case occurs when reading files from an MITK scene file in which case base data properties are already provided in addition to the actual data file. If such a data file references other files relative to its original location on the filesystem, the original location can be retrieved from the base data properties. In this scenario, GetInputLocation() would return a path within a temporary directory in which the scene file has been extracted. This is not the intended base path for searching referenced external data files.
Implemented in mitk::AbstractFileReader.