SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
pketiledscene.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/drivers/pke/pkescene.hpp"
7#include "slideio/imagetools/tifftools.hpp"
8#include "slideio/core/tools/tilecomposer.hpp"
9
10#if defined(_MSC_VER)
11#pragma warning( push )
12#pragma warning(disable: 4251)
13#endif
14
15namespace slideio
16{
17 class SLIDEIO_PKE_EXPORTS PKETiledScene : public PKEScene, public Tiler
18 {
19 public:
20 PKETiledScene(const std::string& filePath,
21 const std::string& name,
22 const std::vector<slideio::TiffDirectory>& dirs);
23 PKETiledScene(const std::string& filePath,
24 libtiff::TIFF* hFile,
25 const std::string& name,
26 const std::vector<slideio::TiffDirectory>& dirs);
27 int getNumChannels() const override;
28 cv::Rect getRect() const override;
29 void readResampledBlockChannels(const cv::Rect& blockRect, const cv::Size& blockSize, const std::vector<int>& channelIndices,
30 cv::OutputArray output) override;
31 int findZoomLevel(double zoom) const;
32 // Tiler methods
33 int getTileCount(void* userData) override;
34 bool getTileRect(int tileIndex, cv::Rect& tileRect, void* userData) override;
35 bool readTile(int tileIndex, const std::vector<int>& channelIndices, cv::OutputArray tileRaster,
36 void* userData) override;
37 void initializeBlock(const cv::Size& blockSize, const std::vector<int>& channelIndices, cv::OutputArray output) override;
38 std::string getChannelName(int channel) const override;
39 bool isBrightField() const;
40 private:
41 void initialize();
42 void initializeChannelNames();
43 bool readTiffTile(int tileIndex, const TiffDirectory& dir, const std::vector<int>& channelIndices, cv::OutputArray tileRaster);
44 bool readTiffDirectory(const TiffDirectory& dir, const std::vector<int>& channelIndices, cv::OutputArray tileRaster);
45 private:
46 std::vector<slideio::TiffDirectory> m_directories;
47 bool m_isUnmixed = false;
48 std::vector<int> m_zoomDirectoryIndices;
49 int m_numChannels = 0;
50 std::vector<std::string> m_channelNames;
51 };
52}
53
54#if defined(_MSC_VER)
55#pragma warning( pop )
56#endif
Definition: exceptions.hpp:12