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#pragma once
5#include <cstdint>
6#include <string>
7#include <vector>
8
9namespace slideio
10{
11 const int SIZE_ATTACHMENTDIRECTORY_DATA = 256;
12
13 #pragma pack(push,1)
14 struct SegmentHeader
15 {
16 char SID[16];
17 uint64_t allocatedSize;
18 uint64_t usedSize;
19 };
20 struct FileHeader
21 {
22 uint32_t majorVersion;
23 uint32_t minorVerion;
24 uint64_t reserved;
25 char primaryFileGuid[16];
26 char fileGuid[16];
27 uint32_t filePart;
28 uint64_t directoryPosition;
29 uint64_t metadataPosition;
30 uint32_t updatePending;
31 uint64_t attachmentDirectoryPosition;
32 };
33 struct MetadataHeader
34 {
35 uint32_t xmlSize;
36 uint32_t attachmentSize;
37 uint8_t reserved[248];
38 };
39 struct DirectoryHeader
40 {
41 uint32_t entryCount;
42 uint8_t reserved[124];
43 };
44 struct DirectoryEntryDV
45 {
46 char schemaType[2];
47 int32_t pixelType;
48 int64_t filePosition;
49 int32_t filePart;
50 int32_t compression;
51 uint8_t pyramidType;
52 uint8_t reserved[5];
53 int32_t dimensionCount;
54 };
55 struct DimensionEntryDV
56 {
57 char dimension[4];
58 int32_t start;
59 int32_t size;
60 float startCoordinate;
61 int32_t storedSize;
62 };
63 struct SubBlockHeader
64 {
65 int32_t metadataSize;
66 int32_t attachmentSize;
67 int64_t dataSize;
68 DirectoryEntryDV direEntry;
69 };
70 struct AttachmentEntry
71 {
72 char schemaType[2];
73 uint8_t reserved[10];
74 int64_t filePosition;
75 int32_t filePart;
76 char guidContent[16];
77 char contentFileType[8];
78 char name[80];
79 };
80 struct AttachmentDirectorySegmentData
81 {
82 int32_t entryCount;
83 uint8_t spare[SIZE_ATTACHMENTDIRECTORY_DATA - 4];
84 };
85 struct AttachmentDirectorySegment
86 {
87 struct SegmentHeader header;
88 struct AttachmentDirectorySegmentData data;
89 };
90 struct AttachmentEntryA1
91 {
92 char schemaType[2];
93 uint8_t reserved[10];
94 int64_t filePosition;
95 int filePart;
96 uint8_t contentGuid[16];
97 char contentFileType[8];
98 char name[80];
99 };
100 struct AttachmentSegmentData
101 {
102 int64_t dataSize;
103 uint8_t spare[8];
104 union
105 {
106 struct AttachmentEntryA1 attachmentEntry;
107 uint8_t reservedSpace[128];
108 };
109 uint8_t reserved[112];
110 };
111 struct AttachmentSegment
112 {
113 struct SegmentHeader header;
114 struct AttachmentSegmentData data;
115 };
116 #pragma pack(pop)
117 struct CZIChannelInfo
118 {
119 std::string id;
120 std::string name;
121 std::vector<std::pair<std::string, std::string>> attributes;
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}
Definition: exceptions.hpp:15