SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
cvslide.hpp
1// This file is part of slideio project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://slideio.com/license.html.
4#ifndef OPENCV_slideio_slide_HPP
5#define OPENCV_slideio_slide_HPP
6
7#include "slideio/core/slideio_core_def.hpp"
8#include "slideio/core/cvscene.hpp"
9#include <string>
10
11#if defined(_MSC_VER)
12#pragma warning( push )
13#pragma warning(disable: 4251)
14#endif
15
16namespace slideio
17{
27 class SLIDEIO_CORE_EXPORTS CVSlide
28 {
29 friend class ImageDriver;
30 protected:
31 virtual ~CVSlide() = default;
32 public:
34 virtual int getNumScenes() const = 0;
36 virtual std::string getFilePath() const = 0;
41 virtual const std::string& getRawMetadata() const {return m_rawMetadata;}
43 virtual std::shared_ptr<CVScene> getScene(int index) const = 0;
45 virtual std::shared_ptr<CVScene> getSceneByName(const std::string& name);
49 virtual const std::list<std::string>& getAuxImageNames() const {
50 return m_auxNames;
51 }
53 virtual int getNumAuxImages() const {
54 return static_cast<int>(m_auxNames.size());
55 }
60 virtual std::shared_ptr<CVScene> getAuxImage(const std::string& sceneName) const;
65 virtual MetadataFormat getMetadataFormat() const { return m_metadataFormat; }
67 void setDriverId(const std::string& driverId) {
68 m_driverId = driverId;
69 }
71 const std::string& getDriverId() const {
72 return m_driverId;
73 }
75 static MetadataFormat recognizeMetadataFormat(const std::string& metadata);
77 std::string toString() const;
78 protected:
79 std::string m_rawMetadata;
80 MetadataFormat m_metadataFormat = MetadataFormat::None;
81 std::list<std::string> m_auxNames;
82 std::string m_driverId;
83 };
84}
85
86#define CVSlidePtr std::shared_ptr<slideio::CVSlide>
87
88#if defined(_MSC_VER)
89#pragma warning( pop )
90#endif
91
92#endif
CVSlide is an base class for representation of medical slide.
Definition: cvslide.hpp:28
virtual std::string getFilePath() const =0
The method returns a string which represents file path of the slide.
virtual int getNumAuxImages() const
The method returns number of auxiliary images contained in the slide.
Definition: cvslide.hpp:53
virtual const std::list< std::string > & getAuxImageNames() const
The method returns list of names of auxiliary images contained in the slide.
Definition: cvslide.hpp:49
virtual int getNumScenes() const =0
The method returns number of Scene objects contained in the slide.
virtual std::shared_ptr< CVScene > getScene(int index) const =0
The method returns a CVScene object by the scene index.
virtual MetadataFormat getMetadataFormat() const
The method returns a string containing serialized metadata of the slide.
Definition: cvslide.hpp:65
void setDriverId(const std::string &driverId)
The method sets driver id of the slide.
Definition: cvslide.hpp:67
virtual const std::string & getRawMetadata() const
The method returns a string containing serialized metadata of the slide.
Definition: cvslide.hpp:41
const std::string & getDriverId() const
The method returns driver id of the slide.
Definition: cvslide.hpp:71
Definition: exceptions.hpp:15