Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkIFileReader.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkIFileReader_h
14 #define mitkIFileReader_h
15 
16 #include <mitkDataStorage.h>
17 #include <mitkIFileIO.h>
18 
19 #include <mitkServiceInterface.h>
20 
21 namespace mitk
22 {
23  class BaseData;
24  class PropertyList;
25 }
26 
27 namespace itk
28 {
29  template <class T>
30  class SmartPointer;
31 }
32 
33 namespace mitk
34 {
63  {
64  ~IFileReader() override;
65 
73  virtual void SetInput(const std::string &location) = 0;
74 
84  virtual void SetInput(const std::string &location, std::istream *is) = 0;
85 
90  virtual std::string GetInputLocation() const = 0;
91 
96  virtual std::istream *GetInputStream() const = 0;
97 
109  virtual std::vector<itk::SmartPointer<BaseData>> Read() = 0;
110 
124  virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds) = 0;
125 
131  virtual std::vector< std::string > GetReadFiles() = 0;
132 
151  virtual void SetProperties(const PropertyList* properties) = 0;
152 
153  protected:
154 
160  virtual const PropertyList* GetProperties() const = 0;
161  };
162 
163 } // namespace mitk
164 
165 MITK_DECLARE_SERVICE_INTERFACE(mitk::IFileReader, "org.mitk.IFileReader")
166 
167 #endif
#define MITKCORE_EXPORT
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Key-value list holding instances of BaseProperty.
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Declare a C++ interface for use with CppMicroServices (Qt not available).
Find image slices visible on a given plane.
Common interface for all MITK file readers and writers.
Definition: mitkIFileIO.h:44
The common interface for all MITK file readers.
virtual void SetInput(const std::string &location)=0
Set the input file path.
virtual std::string GetInputLocation() const =0
Get the current input location.
virtual std::vector< std::string > GetReadFiles()=0
Get the list of files that were loaded during the last Read() call.
virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds)=0
Read the specified file or input stream, loading its contents into the provided DataStorage.
virtual std::vector< itk::SmartPointer< BaseData > > Read()=0
Read the specified file or input stream and return its contents.
virtual void SetProperties(const PropertyList *properties)=0
Optionally provide base data properties as a source of meta data.
~IFileReader() override
virtual std::istream * GetInputStream() const =0
Get the input stream.
virtual const PropertyList * GetProperties() const =0
Get the properties set via SetProperties().
virtual void SetInput(const std::string &location, std::istream *is)=0
Set an input stream to read from.