SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
scene.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#pragma once
5
6#include "slideio/slideio/slideio_def.hpp"
7#include "slideio/base/slideio_enums.hpp"
8#include "slideio/core/metadata.hpp"
9#include <string>
10#include <vector>
11#include <memory>
12#include <list>
13
14#if defined(_MSC_VER)
15#pragma warning( push )
16#pragma warning(disable: 4251)
17#endif
18
19namespace slideio
20{
21 class LevelInfo;
22 class CVScene;
28 class SLIDEIO_EXPORTS Scene
29 {
30 friend class Slide;
31 public:
32 Scene(std::shared_ptr<CVScene> scene);
33 virtual ~Scene(){
34 }
36 std::string getFilePath() const;
38 std::string getName() const;
46 std::tuple<int,int,int,int> getRect() const;
48 int getNumChannels() const;
52 int getNumZSlices() const;
56 int getNumTFrames() const;
58 Compression getCompression() const;
62 slideio::DataType getChannelDataType(int channel) const;
65 std::string getChannelName(int channel) const;
70 std::tuple<double,double> getResolution() const;
72 double getZSliceResolution() const;
74 double getTFrameResolution() const;
76 double getMagnification() const;
86 int getBlockSize(const std::tuple<int,int>& blockSize, int refChannel, int numChannels, int numSlices, int numFrames) const;
117 void readBlock(const std::tuple<int,int,int,int>& blockRect, void* buffer, size_t bufferSize);
132 void readBlockChannels(const std::tuple<int,int,int,int>& blockRect, const std::vector<int>& channelIndices, void* buffer, size_t bufferSize);
148 void readResampledBlock(const std::tuple<int,int,int,int>& blockRect, const std::tuple<int,int>& blockSize, void* buffer, size_t bufferSize);
165 void readResampledBlockChannels(const std::tuple<int,int,int,int>& blockRect, const std::tuple<int,int>& blockSize, const std::vector<int>& channelIndices, void* buffer, size_t bufferSize);
205 void read4DBlock(const std::tuple<int,int,int,int>& blockRect, const std::tuple<int,int>& zSliceRange, const std::tuple<int,int>& timeFrameRange, void* buffer, size_t bufferSize);
223 void read4DBlockChannels(const std::tuple<int,int,int,int>& blockRect, const std::vector<int>& channelIndices, const std::tuple<int,int>& zSliceRange, const std::tuple<int,int>& timeFrameRange, void* buffer, size_t bufferSize);
241 void readResampled4DBlock(const std::tuple<int,int,int,int>& blockRect, const std::tuple<int,int>& blockSize, const std::tuple<int,int>& zSliceRange, const std::tuple<int,int>& timeFrameRange, void* buffer, size_t bufferSize);
260 void readResampled4DBlockChannels(const std::tuple<int,int,int,int>& blockRect, const std::tuple<int,int>& blockSize, const std::vector<int>& channelIndices, const std::tuple<int,int>& zSliceRange, const std::tuple<int,int>& timeFrameRange, void* buffer, size_t bufferSize);
262 virtual const std::list<std::string>& getAuxImageNames() const;
264 virtual int getNumAuxImages() const;
266 std::string getRawMetadata() const;
268 MetadataFormat getMetadataFormat() const;
270 const Metadata& getMetadata() const;
274 virtual std::shared_ptr<Scene> getAuxImage(const std::string& imageName) const;
275 std::shared_ptr<CVScene> getCVScene() { return m_scene; }
276 int getNumZoomLevels() const;
277 const LevelInfo* getLevelInfo(int level) const;
278 std::string toString() const;
284 const Metadata& getChannelAttributes() const;
285 private:
286 std::shared_ptr<CVScene> m_scene;
287 };
288}
289
290#define ScenePtr std::shared_ptr<slideio::Scene>
291
292#if defined(_MSC_VER)
293#pragma warning( pop )
294#endif
Read-only tree view over slide/scene metadata.
Definition: metadata.hpp:26
Scene class represents a raster image contained in a slide.
Definition: scene.hpp:29
Slide class is an interface for accessing the information on a medical slide.
Definition: slide.hpp:30
Definition: exceptions.hpp:15
Compression
raster data compression enum
Definition: slideio_enums.hpp:12