Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkFileReaderSelector.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 mitkFileReaderSelector_h
14 #define mitkFileReaderSelector_h
15 
16 #include <mitkIFileReader.h>
17 
18 #include <mitkMimeType.h>
19 
20 #include <usServiceReference.h>
21 
22 #include <string>
23 #include <vector>
24 
25 namespace mitk
26 {
27  class BaseData;
28 
30  {
31  public:
33  {
34  public:
35  Item(const Item &other);
36  ~Item();
37 
38  Item &operator=(const Item &other);
39 
40  IFileReader *GetReader() const;
41  std::string GetDescription() const;
42  IFileReader::ConfidenceLevel GetConfidenceLevel() const;
43  MimeType GetMimeType() const;
44  us::ServiceReference<IFileReader> GetReference() const;
45  long GetServiceId() const;
46 
47  bool operator<(const Item &other) const;
48 
49  private:
50  friend class FileReaderSelector;
51 
52  Item();
53 
54  struct Impl;
56  };
57 
59  FileReaderSelector(const std::string &path);
60 
62 
63  FileReaderSelector &operator=(const FileReaderSelector &other);
64 
65  bool IsEmpty() const;
66 
67  std::vector<MimeType> GetMimeTypes() const;
68 
83  std::vector<Item> Get() const;
84 
85  Item Get(long id) const;
86 
87  Item GetDefault() const;
88  long GetDefaultId() const;
89 
90  Item GetSelected() const;
91  long GetSelectedId() const;
92 
93  bool Select(const Item &item);
94  bool Select(long id);
95 
96  void Swap(FileReaderSelector &fws);
97 
98  private:
99  struct Impl;
101  };
102 
103  void swap(FileReaderSelector &fws1, FileReaderSelector &fws2);
104 }
105 
106 #endif
mitk::swap
void swap(CustomMimeType &l, CustomMimeType &r)
mitk::modelFit::operator<
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list's first item is lower than the second one's...
Definition: mitkModelFitStaticParameterMap.h:139
us::ExplicitlySharedDataPointer< Impl >
mitkMimeType.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IFileReader
The common interface for all MITK file readers.
Definition: mitkIFileReader.h:61
us::ServiceReference
Definition: usModule.h:40
mitk::FileReaderSelector
Definition: mitkFileReaderSelector.h:29
mitk::FileReaderSelector::Item
Definition: mitkFileReaderSelector.h:32
mitkIFileReader.h
usServiceReference.h
mitk::MitkMultilabelIOMimeTypes::Get
MITKMULTILABELIO_EXPORT std::vector< CustomMimeType * > Get()
mitk::IFileIO::ConfidenceLevel
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data.
Definition: mitkIFileIO.h:45
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
us::SharedDataPointer< Impl >
mitk::MimeType
The MimeType class represents a registered mime-type. It is an immutable wrapper for mitk::CustomMime...
Definition: mitkMimeType.h:36