SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
dcmscene.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_dcmscene_HPP
5#define OPENCV_slideio_dcmscene_HPP
6
7#include "slideio/drivers/dcm/dcm_api_def.hpp"
8#include "slideio/core/cvscene.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 DCMSlide;
19 class SLIDEIO_DCM_EXPORTS DCMScene : public CVScene
20 {
21 public:
22 DCMScene();
23 std::string getFilePath() const override;
24 cv::Rect getRect() const override;
25 int getNumChannels() const override;
26 int getNumZSlices() const override;
27 int getNumTFrames() const override;
28 double getZSliceResolution() const override;
29 double getTFrameResolution() const override;
30 DataType getChannelDataType(int channel) const override;
31 std::string getChannelName(int channel) const override;
32 Resolution getResolution() const override;
33 double getMagnification() const override;
34 void readResampledBlockChannelsEx(const cv::Rect& blockRect, const cv::Size& blockSize,
35 const std::vector<int>& componentIndices, int zSliceIndex, int tFrameIndex, cv::OutputArray output) override;
36 std::string getName() const override;
37 Compression getCompression() const override;
38 void addFile(std::shared_ptr<DCMFile>& file);
39 void init();
40 std::string getRawMetadata() const override;
41 protected:
42 void prepareSliceIndices();
43 void checkScene();
44 void extractSliceRaster(const cv::Mat& frame,
45 const cv::Rect& blockRect,
46 const cv::Size& blockSize,
47 const std::vector<int>& componentIndices,
48 cv::OutputArray output);
49 std::pair<int, int> findFileIndex(int zSliceIndex);
50 private:
51 std::vector<std::shared_ptr<DCMFile>> m_files;
52 std::map<int, int> m_sliceMap;
53 cv::Rect m_rect = { 0, 0, 0, 0 };
54 std::string m_name;
55 int m_numSlices = 1;
56 int m_numFrames = 1;
57 int m_numChannels = 0;
58 std::string m_filePath;
59 DataType m_dataType = DataType::DT_Unknown;
60 Compression m_compression = Compression::Unknown;
61 };
62}
63
64
65#if defined(_MSC_VER)
66#pragma warning( pop )
67#endif
68
69#endif
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12