Medical Imaging Interaction Toolkit  2025.12.02
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 {
62  {
63  ~IFileReader() override;
64 
69  virtual void SetInput(const std::string &location) = 0;
70 
80  virtual void SetInput(const std::string &location, std::istream *is) = 0;
81 
86  virtual std::string GetInputLocation() const = 0;
87 
92  virtual std::istream *GetInputStream() const = 0;
93 
105  virtual std::vector<itk::SmartPointer<BaseData>> Read() = 0;
106 
120  virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds) = 0;
121 
125  virtual std::vector< std::string > GetReadFiles() = 0;
126 
143  virtual void SetProperties(const PropertyList* properties) = 0;
144 
145  protected:
146 
149  virtual const PropertyList* GetProperties() const = 0;
150  };
151 
152 } // namespace mitk
153 
154 MITK_DECLARE_SERVICE_INTERFACE(mitk::IFileReader, "org.mitk.IFileReader")
155 
156 #endif
#define MITKCORE_EXPORT
Data management class that handles 'was created by' relations.
Key-value list holding instances of BaseProperty.
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Find image slices visible on a given plane.
Common interface for all MITK file reader and writer.
Definition: mitkIFileIO.h:36
The common interface for all MITK file readers.
virtual void SetInput(const std::string &location)=0
Set the input location.
virtual std::string GetInputLocation() const =0
Get the current input location.
virtual std::vector< std::string > GetReadFiles()=0
virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds)=0
Reads the specified file or input stream, loading its contents into the provided DataStorage.
virtual std::vector< itk::SmartPointer< BaseData > > Read()=0
Reads the specified file or input stream and returns 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
virtual void SetInput(const std::string &location, std::istream *is)=0
Set an input stream to read from.