-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathschema.json
More file actions
185 lines (185 loc) · 6.47 KB
/
Copy pathschema.json
File metadata and controls
185 lines (185 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json",
"title": "Spatial Coordinate Convention (spatial:)",
"description": "Schema for spatial coordinate information in Zarr. Properties use the 'spatial:' namespace prefix. This convention defines the relationship between array indices and spatial coordinates.",
"type": "object",
"properties": {
"zarr_format": {
"type": "integer",
"description": "Zarr format version"
},
"node_type": {
"type": "string",
"enum": ["array", "group"],
"description": "Type of Zarr node"
},
"attributes": {
"type": "object",
"description": "Zarr attributes containing convention metadata and spatial: prefixed properties",
"properties": {
"zarr_conventions": {
"type": "array",
"description": "Array of convention metadata objects",
"contains": {
"$ref": "#/$defs/conventionMetadata"
}
}
},
"required": ["zarr_conventions"],
"$ref": "#/$defs/spatialAttributes"
}
},
"required": ["zarr_format", "node_type", "attributes"],
"additionalProperties": true,
"allOf": [
{
"if": {
"properties": { "node_type": { "const": "array" } },
"required": ["node_type"]
},
"then": {
"properties": {
"attributes": {
"type": "object",
"required": ["spatial:dimensions"]
}
}
}
}
],
"$defs": {
"conventionMetadata": {
"type": "object",
"description": "Spatial coordinate convention metadata object for use in zarr_conventions array",
"properties": {
"schema_url": {
"type": "string",
"const": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json",
"description": "URL to the JSON Schema definition for this convention"
},
"spec_url": {
"type": "string",
"const": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md",
"description": "URL to the full specification document"
},
"uuid": {
"type": "string",
"const": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
"description": "UUID that permanently identifies this convention"
},
"name": {
"type": "string",
"const": "spatial",
"description": "Human-readable name of the convention"
},
"description": {
"type": "string",
"const": "Spatial coordinate information",
"description": "Brief description of the convention's purpose and usage"
}
},
"anyOf": [
{
"required": ["schema_url"]
},
{
"required": ["spec_url"]
},
{
"required": ["uuid"]
}
],
"additionalProperties": false
},
"spatialAttributes": {
"type": "object",
"description": "Spatial coordinate properties using spatial: key prefix",
"properties": {
"zarr_conventions": true,
"spatial:dimensions": {
"type": "array",
"description": "Names of the two spatial (X/Y) dimensions, in row-major order (e.g., [\"y\", \"x\"]).",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "string"
}
},
"spatial:bbox": {
"type": "array",
"description": "2D bounding box in coordinate space: [xmin, ymin, xmax, ymax].",
"minItems": 4,
"maxItems": 4,
"items": {
"type": "number"
}
},
"spatial:transform_type": {
"type": "string",
"description": "Type of transformation used to map array indices to coordinates. Defaults to 'affine' if not specified. Currently defined types: 'affine'. Additional transform types may be defined in future versions (e.g., 'rpc', 'polynomial', 'lookup'). Custom types are allowed for extensibility."
},
"spatial:transform": {
"type": "array",
"description": "2D affine transformation coefficients [a, b, c, d, e, f] mapping array indices to coordinates, where x = a*col_index + b*row_index + c and y = d*col_index + e*row_index + f. Used when transform_type is 'affine' (default).",
"minItems": 6,
"maxItems": 6,
"items": {
"type": "number"
}
},
"spatial:shape": {
"type": "array",
"description": "Shape of the two spatial dimensions [height, width], corresponding to [y, x].",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "integer",
"minimum": 1
}
},
"spatial:registration": {
"type": "string",
"description": "Grid cell registration type. 'node' (grid-registered) means cells are centered on coordinate points with footprints extending 1/2 cell width outside the range. 'pixel' (cell-registered) means cell boundaries align with coordinate points. Defaults to 'pixel' if not specified.",
"enum": ["node", "pixel"]
},
"multiscales": {
"type": "object",
"description": "When composing with multiscales convention, spatial: properties can be added to layout items",
"properties": {
"layout": {
"type": "array",
"items": {
"type": "object",
"properties": {
"spatial:shape": {
"type": "array",
"description": "Shape override for this resolution level [height, width]",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "integer",
"minimum": 1
}
},
"spatial:transform": {
"type": "array",
"description": "2D affine transform override for this resolution level [a, b, c, d, e, f]",
"minItems": 6,
"maxItems": 6,
"items": {
"type": "number"
}
}
},
"additionalProperties": true
}
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
}
}