SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
etsfile.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 <string>
7#include <vector>
8
9#include "slideio/drivers/vsi/vsi_api_def.hpp"
10#include "slideio/drivers/vsi/etsfilescene.hpp"
11#include "slideio/drivers/vsi/volume.hpp"
12#include "slideio/drivers/vsi/vsistruct.hpp"
13#include "slideio/base/slideio_enums.hpp"
14#include "slideio/drivers/vsi/vsistream.hpp"
15#include "slideio/drivers/vsi/pyramid.hpp"
16
17#if defined(_MSC_VER)
18#pragma warning(push)
19#pragma warning(disable : 4251)
20#endif
21
22namespace slideio
23{
24 namespace vsi
25 {
26 class SLIDEIO_VSI_EXPORTS EtsFile
27 {
28 public:
29 EtsFile(const std::string& filePath);
30
31 std::string getFilePath() const {
32 return m_filePath;
33 }
34
35 DataType getDataType() const {
36 return m_dataType;
37 }
38
39 int getNumChannels() const {
40 return m_numChannels;
41 }
42
43 slideio::Compression getCompression() const {
44 return m_compression;
45 }
46
47 void read(std::list<std::shared_ptr<Volume>>& volumes);
48 void readTilePart(const vsi::TileInfo& tileInfo, cv::OutputArray tileRaster);
49
50 void assignVolume(const std::shared_ptr<Volume>& volume) {
51 m_volume = volume;
52 }
53
54 std::shared_ptr<Volume> getVolume() const {
55 return m_volume;
56 }
57
58 const cv::Size& getSize() const {
59 return m_size;
60 }
61
62 const cv::Size& getTileSize() const {
63 return m_tileSize;
64 }
65
66 int getNumZSlices() const {
67 return m_numZSlices;
68 }
69
70 int getNumTFrames() const {
71 return m_numTFrames;
72 }
73
74 int getNumLambdas() const {
75 return m_numLambdas;
76 }
77
78 int getNumPyramidLevels() const {
79 return m_pyramid.getNumLevels();
80 }
81
82 const PyramidLevel& getPyramidLevel(int index) const {
83 return m_pyramid.getLevel(index);
84 }
85 void readTile(int levelIndex, int tileIndex, const std::vector<int>& channelIndices, int zSlice, int tFrame, cv::OutputArray output);
86 private:
87 std::string m_filePath;
88 DataType m_dataType = DataType::DT_Unknown;
89 int m_numChannels = 1;
90 ColorSpace m_colorSpace = ColorSpace::Unknown;
92 int m_compressionQuality = 0;
93 cv::Size m_size;
94 cv::Size m_sizeWithCompleteTiles;
95 cv::Size m_tileSize;
96 int m_numZSlices = 1;
97 int m_numTFrames = 1;
98 int m_numLambdas = 1;
99 uint32_t m_pixelInfoHints[17] = {0};
100 uint32_t m_backgroundColor[10] = {0};
101 bool m_usePyramid = false;
102 int m_numDimensions;
103 std::shared_ptr<Volume> m_volume;
104 Pyramid m_pyramid;
105 std::unique_ptr<VSIStream> m_etsStream;
106 std::vector<uint8_t> m_buffer;
107 };
108 }
109}
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12
@ Unknown
Unknown compression.