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