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