SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
tiffstructure.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#include "slideio/converter/converter_def.hpp"
6#include <opencv2/core/types.hpp>
7
8namespace slideio
9{
10 class CVScene;
11
12 namespace converter
13 {
14 class ConverterParameters;
15
16 class TiffDirectoryStructure
17 {
18 public:
19 TiffDirectoryStructure() = default;
20
21 TiffDirectoryStructure(const TiffDirectoryStructure& other) = default;
22
23 TiffDirectoryStructure& operator=(const TiffDirectoryStructure& other) = default;
24
25 cv::Range getChannelRange() const {
26 return m_channelRange;
27 }
28
29 cv::Range getZSliceRange() const {
30 return m_zSliceRange;
31 }
32
33 cv::Range getTFrameRange() const {
34 return m_tFrameRange;
35 }
36
37 cv::Range getZoomLevelRange() const {
38 return m_zoomLevelRange;
39 }
40
41 void setChannelRange(cv::Range range) {
42 m_channelRange = range;
43 }
44
45 void setZSliceRange(cv::Range range) {
46 m_zSliceRange = range;
47 }
48
49 void setTFrameRange(cv::Range range) {
50 m_tFrameRange = range;
51 }
52
53 void setZoomLevelRange(cv::Range range) {
54 m_zoomLevelRange = range;
55 }
56
57 void setDescription(const std::string& string) {
58 m_description = string;
59 }
60
61 const std::string& getDescription() const {
62 return m_description;
63 }
64
65 void setPlaneCount(int count) {
66 m_planeCount = count;
67 }
68
69 int getPlaneCount() const {
70 return m_planeCount;
71 }
72
73 private:
74 cv::Range m_channelRange;
75 cv::Range m_zSliceRange;
76 cv::Range m_tFrameRange;
77 cv::Range m_zoomLevelRange;
78 int m_planeCount = 1;
79 std::string m_description;
80 };
81
82 class SLIDEIO_CONVERTER_EXPORTS TiffPageStructure : public TiffDirectoryStructure
83 {
84 public:
85 int getNumSubDirectories() const {
86 return static_cast<int>(m_subDirectories.size());
87 }
88
89 const TiffDirectoryStructure& getSubDirectory(int index) const;
90
91 TiffDirectoryStructure& getSubDirectory(int index);
92
93 TiffDirectoryStructure& appendSubDirectory() {
94 return m_subDirectories.emplace_back();
95 }
96
97 private:
98 std::vector<TiffDirectoryStructure> m_subDirectories;
99 };
100 }
101}
Definition: exceptions.hpp:15