SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
ndpiscene.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 "ndpitifftools.hpp"
7#include "slideio/drivers/ndpi/ndpi_api_def.hpp"
8#include "slideio/core/cvscene.hpp"
9#include "slideio/core/tools/tilecomposer.hpp"
10
11#if defined(_MSC_VER)
12#pragma warning( push )
13#pragma warning(disable: 4251)
14#endif
15
16namespace slideio
17{
18 class NDPIFile;
19}
20
21namespace slideio
22{
23 class SLIDEIO_NDPI_EXPORTS NDPIScene : public CVScene, public Tiler
24 {
25 friend class NDPISlide;
26 protected:
27 NDPIScene();
28 public:
29 virtual ~NDPIScene();
30 void init(const std::string& name, int sceneIndex, const std::string& driverId, NDPIFile* file, int32_t startDirIndex, int32_t endDirIndex);
31 int getNumChannels() const override;
32 cv::Rect getRect() const override;
33 std::string getFilePath() const override;
34 const std::string& getDriverId() const override {
35 return m_driverId;
36 }
37 int getSceneIndex() const override {
38 return m_sceneIndex;
39 }
40 std::string getName() const override {
41 return m_sceneName;
42 }
43 slideio::DataType getChannelDataType(int channel) const override;
44 Resolution getResolution() const override;
45 double getMagnification() const override;
46 Compression getCompression() const override;
47 void readResampledBlockChannelsEx(const cv::Rect& blockRect, const cv::Size& blockSize,
48 const std::vector<int>& componentIndices, int zSliceIndex, int tFrameIndex, cv::OutputArray output) override;
49 const NDPITiffDirectory& findZoomDirectory(const cv::Rect& imageBlockRect, const cv::Size& requiredBlockSize) const;
50 void scaleBlockToDirectory(const cv::Rect& imageBlockRect, const slideio::NDPITiffDirectory& dir, cv::Rect& dirBlockRect) const;
51 int getTileCount(void* userData) override;
52 bool getTileRect(int tileIndex, cv::Rect& tileRect, void* userData) override;
53 bool readTile(int tileIndex, const std::vector<int>& channelIndices, cv::OutputArray tileRaster,
54 void* userData) override;
55 void initializeBlock(const cv::Size& blockSize, const std::vector<int>& channelIndices, cv::OutputArray output) override;
56 private:
57 void makeSureValidDirectoryType(NDPITiffDirectory::Type directoryType);
58 protected:
59 NDPIFile* m_pfile;
60 int m_startDir;
61 int m_endDir;
62 std::string m_sceneName;
63 cv::Rect m_rect;
64 int m_sceneIndex;
65 std::string m_driverId;
66 };
67
68}
69
70#if defined(_MSC_VER)
71#pragma warning( pop )
72#endif
Definition: exceptions.hpp:15
Compression
raster data compression enum
Definition: slideio_enums.hpp:12