Medical Imaging Interaction Toolkit  2021.10.00
Medical Imaging Interaction Toolkit
mitkItkImageIO.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 MITKITKFILEIO_H
14 #define MITKITKFILEIO_H
15 
16 #include "mitkAbstractFileIO.h"
17 
18 #include <itkImageIOBase.h>
19 
20 namespace mitk
21 {
34  {
35  public:
36  ItkImageIO(itk::ImageIOBase::Pointer imageIO);
37  ItkImageIO(const CustomMimeType &mimeType, itk::ImageIOBase::Pointer imageIO, int rank);
38 
39  // -------------- AbstractFileReader -------------
40 
42 
43  ConfidenceLevel GetReaderConfidenceLevel() const override;
44 
45  // -------------- AbstractFileWriter -------------
46 
47  void Write() override;
48  ConfidenceLevel GetWriterConfidenceLevel() const override;
49 
50  protected:
51  virtual std::vector<std::string> FixUpImageIOExtensions(const std::string &imageIOName);
52  virtual void FixUpCustomMimeTypeName(const std::string &imageIOName, CustomMimeType &customMimeType);
53 
54  // Fills the m_DefaultMetaDataKeys vector with default values
55  virtual void InitializeDefaultMetaDataKeys();
56 
57  // -------------- AbstractFileReader -------------
58  std::vector<itk::SmartPointer<BaseData>> DoRead() override;
59 
60  private:
61  ItkImageIO(const ItkImageIO &other);
62 
63  ItkImageIO *IOClone() const override;
64 
65  itk::ImageIOBase::Pointer m_ImageIO;
66 
67  std::vector<std::string> m_DefaultMetaDataKeys;
68  };
69 
72  MITKCORE_EXPORT std::vector<TimePointType> ConvertMetaDataObjectToTimePointList(const itk::MetaDataObjectBase* data);
73 
74 
78  MITKCORE_EXPORT itk::MetaDataObjectBase::Pointer ConvertTimePointListToMetaDataObject(const mitk::TimeGeometry* timeGeometry);
79 
80 } // namespace mitk
81 
82 #endif /* MITKITKFILEIO_H */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data...
Definition: mitkIFileIO.h:45
std::vector< itk::SmartPointer< BaseData > > Read() override
Reads a path or stream and creates a list of BaseData objects.
MITKCORE_EXPORT itk::MetaDataObjectBase::Pointer ConvertTimePointListToMetaDataObject(const mitk::TimeGeometry *timeGeometry)
MITKCORE_EXPORT std::vector< TimePointType > ConvertMetaDataObjectToTimePointList(const itk::MetaDataObjectBase *data)
Abstract class for implementing a reader and writer.