4#ifndef OPENCV_slideio_scene_HPP
5#define OPENCV_slideio_scene_HPP
7#include "slideio/core/slideio_core_def.hpp"
8#include "slideio/core/cvstructs.hpp"
9#include "slideio/base/slideio_enums.hpp"
10#include "opencv2/core.hpp"
14#include "refcounter.hpp"
17#include "levelinfo.hpp"
20#pragma warning( push )
21#pragma warning(disable: 4251)
36 class SLIDEIO_CORE_EXPORTS
CVScene :
public RefCounter
71 virtual std::string getChannelName(
int channel)
const;
93 virtual void readBlock(
const cv::Rect& blockRect, cv::OutputArray output);
103 virtual void readBlockChannels(
const cv::Rect& blockRect,
const std::vector<int>& channelIndices, cv::OutputArray output);
114 virtual void readResampledBlock(
const cv::Rect& blockRect,
const cv::Size& blockSize, cv::OutputArray output);
126 virtual void readResampledBlockChannels(
const cv::Rect& blockRect,
const cv::Size& blockSize,
const std::vector<int>& channelIndices, cv::OutputArray output);
138 virtual void read4DBlock(
const cv::Rect& blockRect,
const cv::Range& zSliceRange,
const cv::Range& timeFrameRange, cv::OutputArray output);
151 virtual void read4DBlockChannels(
const cv::Rect& blockRect,
const std::vector<int>& channelIndices,
const cv::Range& zSliceRange,
const cv::Range& timeFrameRange, cv::OutputArray output);
164 virtual void readResampled4DBlock(
const cv::Rect& blockRect,
const cv::Size& blockSize,
const cv::Range& zSliceRange,
const cv::Range& timeFrameRange, cv::OutputArray output);
178 virtual void readResampled4DBlockChannels(
const cv::Rect& blockRect,
const cv::Size& blockSize,
const std::vector<int>& channelIndices,
const cv::Range& zSliceRange,
const cv::Range& timeFrameRange, cv::OutputArray output);
185 return static_cast<int>(m_auxNames.size());
190 virtual std::shared_ptr<CVScene> getAuxImage(
const std::string& imageName)
const;
193 virtual void readResampledBlockChannelsEx(
const cv::Rect& blockRect,
const cv::Size& blockSize,
194 const std::vector<int>& componentIndices,
int zSliceIndex,
int tFrameIndex, cv::OutputArray output);
195 virtual int getNumZoomLevels()
const;
196 virtual const LevelInfo* getZoomLevelInfo(
int level)
const;
197 std::string toString()
const;
199 std::vector<int> getValidChannelIndices(
const std::vector<int>& channelIndices);
200 void initializeSceneBlock(
const cv::Size& blockSize,
const std::vector<int>& channelIndices,
201 cv::OutputArray output)
const;
204 std::list<std::string> m_auxNames;
205 std::vector<LevelInfo> m_levels;
209#define CVScenePtr std::shared_ptr<slideio::CVScene>
212#pragma warning( pop )
class CVScene represents a base class for opencv based representations of raster images contained in ...
Definition: cvscene.hpp:37
virtual Compression getCompression() const =0
returns compression of the raster data
virtual slideio::DataType getChannelDataType(int channel) const =0
returns channel data type.
virtual const std::list< std::string > & getAuxImageNames() const
returns list of auxiliary image names.
Definition: cvscene.hpp:180
virtual double getMagnification() const =0
returns slide magnification extracted from the slide metadata.
virtual std::string getName() const =0
returns scene name
virtual int getNumChannels() const =0
returns number of image channels.
virtual int getNumTFrames() const
returns number of time frames in the image.
Definition: cvscene.hpp:60
virtual cv::Rect getRect() const =0
returns image rectangle.
virtual std::string getRawMetadata() const
returns string of serialized metadata. Content of the string depends on image format.
Definition: cvscene.hpp:192
virtual std::string getFilePath() const =0
returns path of the slide
virtual ~CVScene()=default
default constructor
virtual int getNumAuxImages() const
returns number of auxiliary images in the scene object.
Definition: cvscene.hpp:184
virtual Resolution getResolution() const =0
returns image resolution in x and y direction.
virtual double getZSliceResolution() const
returns thickness of a Z slice in meters for 3D images.
Definition: cvscene.hpp:78
virtual double getTFrameResolution() const
returns time between 2 time frames in seconds for images with time frames.
Definition: cvscene.hpp:80
virtual int getNumZSlices() const
returns number of z-slices in the images.
Definition: cvscene.hpp:55
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12