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