SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
vsistruct.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/drivers/vsi/vsi_api_def.hpp"
6
7namespace slideio
8{
9 namespace vsi
10 {
11 #pragma pack(push,1)
12 struct ImageFileHeader
13 {
14 uint8_t magic[2];
15 uint16_t i42;
16 uint32_t offsetFirstIFD;
17 };
18 struct ImageFileDirectory
19 {
20 uint16_t entryCount;
21 };
22 struct FieldEntry
23 {
24 uint16_t tag;
25 uint16_t type;
26 uint32_t numberOfValues;
27 uint32_t offset;
28 };
29 struct VolumeHeader
30 {
31 uint16_t headerSize;
32 uint16_t magicNumber;
33 uint32_t volumeVersion;
34 int64_t offsetFirstDataField;
35 uint32_t flags;
36 uint32_t unused;
37 };
38 struct DataField
39 {
40 uint32_t type;
41 uint32_t tag;
42 uint32_t offsetNextField;
43 uint32_t dataSize;
44 };
45 struct TagHeader
46 {
47 int32_t fieldType;
48 int32_t tag;
49 int32_t nextField;
50 uint32_t dataSize;
51 };
52
53 struct EtsVolumeHeader {
54 char magic[4]; // Magic ID 'S', 'I', 'S', '\0'
55 uint32_t headerSize; // Size of the header : 64
56 uint32_t versionNumber; // Version number of the header
57 uint32_t numDimensions; // Number of dimensions of the multidimensional indices
58 uint64_t additionalHeaderPos; // 64bit index to the file position of the additional header
59 uint32_t additionalHeaderSize; // Size of the additional header
60 uint32_t unused1;
61 uint64_t usedChunksPos; // 64 bit index to the file position of used chunks
62 uint32_t numUsedChunks; // Number of used chunks
63 uint32_t unused2;
64 uint64_t freeChunksPos; // 64 bit index to the file position of free chunks
65 uint32_t numFreeChunks; // Number of free chunks
66 uint32_t unused3;
67 };
68 struct ETSAdditionalHeader
69 {
70 char magic[4]; // Header identification ( 0x00535445 )
71 uint32_t version; // Header version info
72 uint32_t componentType; // Component type
73 uint32_t componentCount; // Component count
74 uint32_t colorSpace; // Component color space
75 uint32_t format; // Compression format
76 uint32_t quality; // Compression quality
77 uint32_t sizeX; // Tile x size
78 uint32_t sizeY; // Tile y size
79 uint32_t sizeZ; // Tile z size
80 uint32_t pixInfoHints[17]; // Pixel info hints
81 uint32_t background[10]; // Background color
82 uint32_t componentOrder; // Component order
83 uint32_t usePyramid; // Use pyramid
84 uint32_t unused[18]; // For future use
85
86 };
87 struct ETSBlock
88 {
89 int64_t filePos;
90 uint32_t size;
91 uint32_t unused;
92 };
93
94#pragma pack(pop)
95 constexpr uint32_t EXTENDED_FIELD_TYPE_MASK = 0x1000000;
96 constexpr uint32_t VOLUME_DATA_BLOCK_TYPE_MASK = 0x10000000;
97 constexpr uint32_t VOLUME_TAG_COUNT_MASK = 0xFFFFFFF;
98
99 enum class ExtendedType
100 {
101 UNSET = -1,
102 NEW_VOLUME_HEADER = 0,
103 PROPERTY_SET_VOLUME = 1,
104 NEW_MDIM_VOLUME_HEADER = 2,
105 TIFF_ID = 0xA,
106 VECTOR_DATA = 0xB
107
108 };
109
110 enum class ValueType
111 {
112 UNSET = 0,
113 CHAR = 1,
114 UCHAR = 2,
115 SHORT = 3,
116 USHORT = 4,
117 INT = 5,
118 UINT = 6,
119 INT64 = 7,
120 UINT64 = 8,
121 FLOAT = 9,
122 DOUBLE = 10,
123 DOUBLE2 = 11,
124 BOOL = 12,
125 TCHAR = 13,
126 DWORD = 14,
127 TIMESTAMP = 17,
128 DATE = 18,
129 VECTOR_INT_2 = 256,
130 VECTOR_INT_3 = 257,
131 VECTOR_INT_4 = 258,
132 RECT_INT = 259,
133 VECTOR_DOUBLE_2 = 260,
134 VECTOR_DOUBLE_3 = 261,
135 VECTOR_DOUBLE_4 = 262,
136 RECT_DOUBLE = 263,
137 MATRIX_DOUBLE_2_2 = 264,
138 MATRIX_DOUBLE_3_3 = 265,
139 MATRIX_DOUBLE_4_4 = 266,
140 TUPLE_INT = 267,
141 TUPLE_DOUBLE = 268,
142 RGB = 269,
143 BGR = 270,
144 FIELD_TYPE = 271,
145 MEM_MODEL = 272,
146 COLOR_SPACE = 273,
147 UNICODE_TCHAR = 8192,
148 ARRAY_INT_2 = 274,
149 ARRAY_INT_3 = 275,
150 ARRAY_INT_4 = 276,
151 ARRAY_INT_5 = 277,
152 ARRAY_DOUBLE_2 = 279,
153 ARRAY_DOUBLE_3 = 280,
154 DIM_INDEX_1 = 8195,
155 DIM_INDEX_2 = 8199,
156 VOLUME_INDEX = 8200,
157 PIXEL_INFO_TYPE = 8470,
158 };
159 enum class ColorSpace
160 {
161 Unknown = 0,
162 Gray = 1,
163 Palette = 2,
164 RGB = 3,
165 BGR = 4,
166 HSV = 5
167 };
168 enum class Compression
169 {
170 RAW = 0,
171 JPEG = 2,
172 JPEG_2000 = 3,
173 JPEG_LOSSLESS = 5,
174 PNG = 8,
175 BMP = 9,
176 };
177 enum class StackType
178 {
179 DEFAULT_IMAGE = 0,
180 OVERVIEW_IMAGE = 1,
181 SAMPLE_MASK = 2,
182 FOCUS_IMAGE = 4,
183 EFI_SHARPNESS_MAP = 8,
184 EFI_HEIGHT_MAP = 16,
185 EFI_TEXTURE_MAP = 32,
186 EFI_STACK = 64,
187 MACRO_IMAGE = 256,
188 FOCUS_POINTS = 1024,
189 UNKNOWN = 0xFFFF,
190 };
191
192 std::string SLIDEIO_VSI_EXPORTS getStackTypeName(StackType type);
193
194 constexpr int Z = 1;
195 constexpr int T = 2;
196 constexpr int LAMBDA = 3;
197 constexpr int C = 4;
198 constexpr int UNKNOWN = 5;
199 constexpr int PHASE = 9;
200 }
201}
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12