SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
czistructs.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_czistructs_HPP
5#define OPENCV_slideio_czistructs_HPP
6#include <cstdint>
7#include <string>
8#include <vector>
9
10namespace slideio
11{
12 const int SIZE_ATTACHMENTDIRECTORY_DATA = 256;
13
14 #pragma pack(push,1)
15 struct SegmentHeader
16 {
17 char SID[16];
18 uint64_t allocatedSize;
19 uint64_t usedSize;
20 };
21 struct FileHeader
22 {
23 uint32_t majorVersion;
24 uint32_t minorVerion;
25 uint64_t reserved;
26 char primaryFileGuid[16];
27 char fileGuid[16];
28 uint32_t filePart;
29 uint64_t directoryPosition;
30 uint64_t metadataPosition;
31 uint32_t updatePending;
32 uint64_t attachmentDirectoryPosition;
33 };
34 struct MetadataHeader
35 {
36 uint32_t xmlSize;
37 uint32_t attachmentSize;
38 uint8_t reserved[248];
39 };
40 struct DirectoryHeader
41 {
42 uint32_t entryCount;
43 uint8_t reserved[124];
44 };
45 struct DirectoryEntryDV
46 {
47 char schemaType[2];
48 int32_t pixelType;
49 int64_t filePosition;
50 int32_t filePart;
51 int32_t compression;
52 uint8_t pyramidType;
53 uint8_t reserved[5];
54 int32_t dimensionCount;
55 };
56 struct DimensionEntryDV
57 {
58 char dimension[4];
59 int32_t start;
60 int32_t size;
61 float startCoordinate;
62 int32_t storedSize;
63 };
64 struct SubBlockHeader
65 {
66 int32_t metadataSize;
67 int32_t attachmentSize;
68 int64_t dataSize;
69 DirectoryEntryDV direEntry;
70 };
71 struct AttachmentEntry
72 {
73 char schemaType[2];
74 uint8_t reserved[10];
75 int64_t filePosition;
76 int32_t filePart;
77 char guidContent[16];
78 char contentFileType[8];
79 char name[80];
80 };
81 struct AttachmentDirectorySegmentData
82 {
83 int32_t entryCount;
84 uint8_t spare[SIZE_ATTACHMENTDIRECTORY_DATA - 4];
85 };
86 struct AttachmentDirectorySegment
87 {
88 struct SegmentHeader header;
89 struct AttachmentDirectorySegmentData data;
90 };
91 struct AttachmentEntryA1
92 {
93 char schemaType[2];
94 uint8_t reserved[10];
95 int64_t filePosition;
96 int filePart;
97 uint8_t contentGuid[16];
98 char contentFileType[8];
99 char name[80];
100 };
101 struct AttachmentSegmentData
102 {
103 int64_t dataSize;
104 uint8_t spare[8];
105 union
106 {
107 struct AttachmentEntryA1 attachmentEntry;
108 uint8_t reservedSpace[128];
109 };
110 uint8_t reserved[112];
111 };
112 struct AttachmentSegment
113 {
114 struct SegmentHeader header;
115 struct AttachmentSegmentData data;
116 };
117 #pragma pack(pop)
118 struct CZIChannelInfo
119 {
120 std::string id;
121 std::string name;
122 };
123 typedef std::vector<CZIChannelInfo> CZIChannelInfos;
124 struct Dimension
125 {
126 char type;
127 int start;
128 int size;
129 };
130 enum CZIDataType
131 {
132 Gray8 = 0,
133 Gray16 = 1,
134 Gray32Float = 2,
135 Bgr24 = 3,
136 Bgr48 = 4,
137 Bgr96Float = 8,
138 Bgra32 = 9,
139 Gray64ComplexFloat = 10,
140 Bgr192ComplexFloat = 11,
141 Gray32 = 12,
142 Gray64 = 13,
143 };
144}
145#endif
Definition: exceptions.hpp:12