Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkFileReaderWriterBase.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 mitkFileReaderWriterBase_h
14 #define mitkFileReaderWriterBase_h
15 
16 #include <mitkCustomMimeType.h>
17 #include <mitkMessage.h>
18 
19 #include <usAny.h>
20 #include <usModuleContext.h>
21 #include <usServiceRegistration.h>
22 
23 #include <memory>
24 
25 namespace mitk
26 {
28  {
29  public:
30  typedef std::map<std::string, us::Any> Options;
32 
34  virtual ~FileReaderWriterBase();
35 
36  Options GetOptions() const;
37  us::Any GetOption(const std::string &name) const;
38 
39  void SetOptions(const Options &options);
40  void SetOption(const std::string &name, const us::Any &value);
41 
42  void SetDefaultOptions(const Options &defaultOptions);
43  Options GetDefaultOptions() const;
44 
55  void SetRanking(int ranking);
56  int GetRanking() const;
57 
58  void SetMimeType(const CustomMimeType &mimeType);
59  const CustomMimeType *GetMimeType() const;
61 
63 
64  void SetMimeTypePrefix(const std::string &prefix);
65  std::string GetMimeTypePrefix() const;
66 
67  void SetDescription(const std::string &description);
68  std::string GetDescription() const;
69 
70  void AddProgressCallback(const ProgressCallback &callback);
71  void RemoveProgressCallback(const ProgressCallback &callback);
72 
74  void UnregisterMimeType();
75 
76  protected:
78 
79  std::string m_Description;
80  int m_Ranking;
81 
82  std::string m_MimeTypePrefix;
83 
90 
92 
93  // us::PrototypeServiceFactory* m_PrototypeFactory;
94 
96 
97  std::unique_ptr<CustomMimeType> m_CustomMimeType;
99 
100  private:
101  // purposely not implemented
102  FileReaderWriterBase &operator=(const FileReaderWriterBase &other);
103  };
104 }
105 
106 #endif
mitk::FileReaderWriterBase::SetOption
void SetOption(const std::string &name, const us::Any &value)
mitk::FileReaderWriterBase::m_MimeTypeReg
us::ServiceRegistration< CustomMimeType > m_MimeTypeReg
Definition: mitkFileReaderWriterBase.h:98
mitk::FileReaderWriterBase
Definition: mitkFileReaderWriterBase.h:27
mitk::FileReaderWriterBase::m_MimeTypePrefix
std::string m_MimeTypePrefix
Definition: mitkFileReaderWriterBase.h:82
mitk::FileReaderWriterBase::GetRegisteredMimeType
MimeType GetRegisteredMimeType() const
usAny.h
mitk::FileReaderWriterBase::SetOptions
void SetOptions(const Options &options)
mitk::Message1< float >
mitk::FileReaderWriterBase::m_Ranking
int m_Ranking
Definition: mitkFileReaderWriterBase.h:80
mitk::FileReaderWriterBase::SetMimeType
void SetMimeType(const CustomMimeType &mimeType)
mitk::CustomMimeType
The CustomMimeType class represents a custom mime-type which may be registered as a service object....
Definition: mitkCustomMimeType.h:44
mitk::FileReaderWriterBase::SetDefaultOptions
void SetDefaultOptions(const Options &defaultOptions)
mitkCustomMimeType.h
mitk::FileReaderWriterBase::ProgressCallback
mitk::MessageAbstractDelegate1< float > ProgressCallback
Definition: mitkFileReaderWriterBase.h:31
mitk::FileReaderWriterBase::RegisterMimeType
us::ServiceRegistration< CustomMimeType > RegisterMimeType(us::ModuleContext *context)
mitk::FileReaderWriterBase::GetDefaultOptions
Options GetDefaultOptions() const
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::FileReaderWriterBase::Options
std::map< std::string, us::Any > Options
Definition: mitkFileReaderWriterBase.h:30
mitk::FileReaderWriterBase::m_Description
std::string m_Description
Definition: mitkFileReaderWriterBase.h:79
us::Any
Definition: usAny.h:163
mitk::FileReaderWriterBase::m_Options
Options m_Options
Options supported by this reader. Set sensible default values!
Definition: mitkFileReaderWriterBase.h:89
mitkMessage.h
mitk::FileReaderWriterBase::m_CustomMimeType
std::unique_ptr< CustomMimeType > m_CustomMimeType
Definition: mitkFileReaderWriterBase.h:97
mitk::MessageAbstractDelegate1
Definition: mitkMessage.h:93
mitk::FileReaderWriterBase::AddProgressCallback
void AddProgressCallback(const ProgressCallback &callback)
mitk::FileReaderWriterBase::GetOption
us::Any GetOption(const std::string &name) const
mitk::FileReaderWriterBase::FileReaderWriterBase
FileReaderWriterBase()
mitk::FileReaderWriterBase::GetDescription
std::string GetDescription() const
usServiceRegistration.h
mitk::FileReaderWriterBase::SetDescription
void SetDescription(const std::string &description)
mitk::FileReaderWriterBase::SetMimeTypePrefix
void SetMimeTypePrefix(const std::string &prefix)
usModuleContext.h
mitk::FileReaderWriterBase::RemoveProgressCallback
void RemoveProgressCallback(const ProgressCallback &callback)
mitk::FileReaderWriterBase::GetRanking
int GetRanking() const
mitk::FileReaderWriterBase::GetOptions
Options GetOptions() const
mitk::FileReaderWriterBase::SetRanking
void SetRanking(int ranking)
Set the service ranking for this file reader.
us::ServiceRegistration
Definition: usServiceRegistration.h:48
mitk::FileReaderWriterBase::GetMimeType
const CustomMimeType * GetMimeType() const
mitk::FileReaderWriterBase::~FileReaderWriterBase
virtual ~FileReaderWriterBase()
mitk::FileReaderWriterBase::GetMimeTypePrefix
std::string GetMimeTypePrefix() const
mitk::FileReaderWriterBase::m_DefaultOptions
Options m_DefaultOptions
Definition: mitkFileReaderWriterBase.h:91
mitk::FileReaderWriterBase::m_ProgressMessage
Message1< float > m_ProgressMessage
Definition: mitkFileReaderWriterBase.h:95
mitk::FileReaderWriterBase::UnregisterMimeType
void UnregisterMimeType()
mitk::MimeType
The MimeType class represents a registered mime-type. It is an immutable wrapper for mitk::CustomMime...
Definition: mitkMimeType.h:36