SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
wsiscene.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/dcm/dcm_api_def.hpp"
7#include "slideio/core/cvscene.hpp"
8#include "slideio/core/tools/tilecomposer.hpp"
9#include "slideio/drivers/dcm/dcmfile.hpp"
10
11#if defined(_MSC_VER)
12#pragma warning( push )
13#pragma warning(disable: 4251)
14#endif
15
16namespace slideio
17{
18 class DCMScene;
19 class DCMSlide;
20 class SLIDEIO_DCM_EXPORTS WSIScene : public CVScene, public Tiler
21 {
22 public:
23 struct TilerData
24 {
25 int zoomLevelIndex = 0;
26 int zSliceIndex = 0;
27 int tFrameIndex = 0;
28 double relativeZoom = 1.;
29 };
30 public:
31 WSIScene();
32 void addFile(std::shared_ptr<DCMFile>& file);
33 void init();
34 std::string getFilePath() const override;
35 std::string getName() const override;
36 cv::Rect getRect() const override;
37 int getNumChannels() const override;
38 slideio::DataType getChannelDataType(int channel) const override;
39 Resolution getResolution() const override;
40 double getMagnification() const override;
41 Compression getCompression() const override;
42 private:
43 std::shared_ptr<DCMFile> getBaseFile() const;
44
45 public:
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,
51 cv::OutputArray output) override;
52 void readResampledBlockChannelsEx(const cv::Rect& blockRect, const cv::Size& blockSize,
53 const std::vector<int>& componentIndices, int zSliceIndex, int tFrameIndex,
54 cv::OutputArray output) override;
55 std::shared_ptr<CVScene> getAuxImage(const std::string& imageName) const override;
56
57 private:
58 std::vector<std::shared_ptr<DCMFile>> m_files;
59 cv::Rect m_rect = { 0, 0, 0, 0 };
60 std::string m_name;
61 int m_numSlices = 1;
62 int m_numFrames = 1;
63 int m_numChannels = 0;
64 std::string m_filePath;
65 DataType m_dataType = DataType::DT_Unknown;
66 Compression m_compression = Compression::Unknown;
67 double m_magnification = 0;
68 Resolution m_resolution = { 0, 0 };
69 std::map<std::string, std::shared_ptr<DCMScene>> m_auxImages;
70 };
71};
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12