Skip to content

Commit fc7fef0

Browse files
authored
WIP: Update rfc5 schemas (#1)
I'm merging this so that all necessary changes regarding the addition of rfc5-stuff to the main branch of the ngff-spec repo can be in one place. This branch was supposed to be a break-out to keep the commit-history of ome#17 clean. * Update input/output to input_axes/output_axes in schema * Add description and required field to byDimension * Update mapAxis schema to use integer array * Add path and interpolation to displacements schema The displacements object now includes a required 'path' property for specifying the zarr array location and an 'interpolation' property with supported methods. This enhances the schema's ability to describe displacement fields and their application. * Add path and interpolation to coordinates schema Introduces 'path' and 'interpolation' properties to the 'coordinates' object in the schema, specifying the location of the coordinate field and the interpolation method to use. The 'path' property is now required. * only allow paths, no URLs * move required fields to correct places * name musnt't be empty * added axis types to schema * Added descriptions to schemas * updated versions to 0.6dev2 * fix paths and versions * pull schema from correct location * Added action to run the tests * update config reference * update versions in test suite * Revert "update config reference" This reverts commit ff3fedd. * update all version references to "0.6dev2" * update version reference * at least two spatial axes * allow any axis type * update version reference * Add maxItems constraint to axes schema Set a maximum of 5 items for the axes array in the schema to enforce limits on the number of axes allowed. * Refactor image schema for coordinate transformations Refactors the definition of coordinateTransformations and coordinateSystems to use inline array schemas with stricter constraints. Adds a new multiscale_coordinateTransformations definition to support scale and translate transformations for multiscale datasets. * Update to NGFF 0.6dev2 and refactor coordinate systems Updated example and test JSON files to use the NGFF 0.6dev2 specification. Replaced 'axes' with 'coordinateSystems', added explicit 'input' and 'output' fields to coordinateTransformations, and restructured transformation chains for clarity and compliance with the new spec. * fix schema resolution
1 parent bb63455 commit fc7fef0

31 files changed

Lines changed: 1023 additions & 589 deletions

.github/workflows/validation.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Validation
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
validate:
8+
name: Validation
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: '3.12'
15+
- run: python -mpip install --upgrade wheel tox
16+
- run: tox

ngff_spec/examples/multiscales_strict/multiscales_example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"input": "2",
5858
"output": "physical"
5959
}
60-
]
60+
]
6161
}
6262
],
6363
"type": "gaussian",
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"multiscales": [
33
{
4-
"version": "0.5-dev",
4+
"version": "0.6dev2",
55
"name": "example",
66
"coordinateSystems" : [
77
{
8-
"name" : "exampleCoordinateSystem",
9-
"axes": [
10-
{"name": "t", "type": "time", "unit": "millisecond"},
11-
{"name": "c", "type": "channel"},
12-
{"name": "z", "type": "space", "unit": "micrometer"},
13-
{"name": "y", "type": "space", "unit": "micrometer"},
14-
{"name": "x", "type": "space", "unit": "micrometer"}
15-
]
8+
"name" : "world",
9+
"axes": {
10+
"t": {"type": "time", "unit": "millisecond"},
11+
"c": {"type": "channel"},
12+
"z": {"type": "space", "unit": "micrometer"},
13+
"y": {"type": "space", "unit": "micrometer"},
14+
"x": {"type": "space", "unit": "micrometer"}
15+
}
1616
},
1717
{
18-
"name" : "array_0",
18+
"name" : "intrinsic",
1919
"axes": [
2020
{"name": "t", "type": "time", "unit": "millisecond"},
2121
{"name": "c", "type": "channel"},
@@ -27,12 +27,14 @@
2727
],
2828
"datasets": [
2929
{
30-
"path": "0",
31-
// the transformation of other arrays are defined relative to this, the highest resolution, array
30+
"path": "s0",
31+
// the transformation of other arrays are
32+
// defined relative to this, the highest resolution, array
3233
"coordinateTransformations": [{
33-
"type": "identity",
34-
"input": "/0",
35-
"output": "array_0"
34+
"type": "scale",
35+
"scale": [1, 1, 1, 1, 1],
36+
"input": "s0",
37+
"output": "intrinsic"
3638
}]
3739
},
3840
{
@@ -56,21 +58,15 @@
5658
}]
5759
}
5860
],
59-
"coordinateTransformations": [{
60-
// the time unit (0.1 milliseconds), the voxel size for all spatial axes of "0" (0.5 micrometers)
61-
"type": "scale",
62-
"scale": [0.1, 1.0, 0.5, 0.5, 0.5],
63-
"input" : "array_0",
64-
"output" : "exampleCoordinateSystem"
65-
}],
66-
"type": "gaussian",
67-
"metadata": {
68-
"description": "the fields in metadata depend on the downscaling implementation. Here, the parameters passed to the skimage function are given",
69-
"method": "skimage.transform.pyramid_gaussian",
70-
"version": "0.16.1",
71-
"args": "[true]",
72-
"kwargs": {"multichannel": true}
73-
}
61+
"coordinateTransformations": [
62+
{
63+
"name": "additional_translation",
64+
"type": "translation",
65+
"translation": [0, 0, 10, 20, 30],
66+
"input": "intrinsic",
67+
"output": "world"
68+
}
69+
]
7470
}
7571
]
7672
}

ngff_spec/examples/multiscales_strict/multiscales_transformations.json

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,39 @@
33
"node_type": "group",
44
"attributes": {
55
"ome": {
6-
"version": "0.5",
6+
"version": "0.6dev2",
77
"multiscales": [
88
{
9-
"axes": [
9+
"coordinateSystems": [
1010
{
11-
"name": "y",
12-
"type": "space",
13-
"unit": "micrometer"
11+
"name": "physical",
12+
"axes": [
13+
{
14+
"name": "y",
15+
"type": "space",
16+
"unit": "micrometer"
17+
},
18+
{
19+
"name": "x",
20+
"type": "space",
21+
"unit": "micrometer"
22+
}
23+
]
1424
},
1525
{
16-
"name": "x",
17-
"type": "space",
18-
"unit": "micrometer"
26+
"name": "intrinsic",
27+
"axes": [
28+
{
29+
"name": "y",
30+
"type": "space",
31+
"unit": "micrometer"
32+
},
33+
{
34+
"name": "x",
35+
"type": "space",
36+
"unit": "micrometer"
37+
}
38+
]
1939
}
2040
],
2141
"datasets": [
@@ -24,15 +44,19 @@
2444
"coordinateTransformations": [
2545
{
2646
"scale": [1, 1],
27-
"type": "scale"
47+
"type": "scale",
48+
"input": "0",
49+
"output": "intrinsic"
2850
}
2951
]
3052
}
3153
],
3254
"coordinateTransformations": [
3355
{
3456
"scale": [10, 10],
35-
"type": "scale"
57+
"type": "scale",
58+
"input": "intrinsic",
59+
"output": "physical"
3660
}
3761
],
3862
"name": "image_with_coordinateTransformations",

ngff_spec/schemas/_version.schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://ngff.openmicroscopy.org/0.6.dev1/schemas/_version.schema",
3+
"$id": "https://ngff.openmicroscopy.org/0.6dev2/schemas/_version.schema",
44
"title": "OME-Zarr Metadata version",
55
"description": "The version of the OME-Zarr Metadata",
66
"type": "string",
77
"enum": [
8-
"0.6.dev1"
8+
"0.6dev2"
99
]
1010
}

ngff_spec/schemas/axes.schema

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://ngff.openmicroscopy.org/latest/schemas/axes.schema",
3+
"$id": "https://ngff.openmicroscopy.org/0.6dev2/schemas/axes.schema",
44
"title": "NGFF Axes",
55
"description": "JSON from OME-NGFF .zattrs",
66
"type": "array",
77
"uniqueItems": true,
88
"minItems": 1,
9+
"maxItems": 5,
910
"items": {
1011
"$ref": "#/$defs/axis"
1112
},
@@ -27,23 +28,24 @@
2728
}
2829
}
2930
},
30-
"minContains": 0,
31+
"minContains": 2,
3132
"maxContains": 3,
3233
"$defs": {
3334
"axis": {
3435
"type": "object",
3536
"properties": {
3637
"name": {
3738
"type": "string",
38-
"description": "Name of the axis"
39+
"minLength": 1,
40+
"description": "Name of the axis. Must be unique within the coordinate system."
3941
},
4042
"longName": {
4143
"type": "string",
4244
"description": "Longer name or description of the axis."
4345
},
4446
"type": {
4547
"type": "string",
46-
"description": "Dimension of the axis"
48+
"description": "Type of the axis. Can be a predefined type or custom type."
4749
},
4850
"discrete": {
4951
"type": "boolean",

ngff_spec/schemas/bf2raw.schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://ngff.openmicroscopy.org/0.6.dev1/schemas/bf2raw.schema",
3+
"$id": "https://ngff.openmicroscopy.org/0.6dev2/schemas/bf2raw.schema",
44
"title": "OME-Zarr container produced by bioformats2raw",
55
"description": "The zarr.json attributes key",
66
"type": "object",
@@ -17,7 +17,7 @@
1717
]
1818
},
1919
"version": {
20-
"$ref": "https://ngff.openmicroscopy.org/0.6.dev1/schemas/_version.schema"
20+
"$ref": "https://ngff.openmicroscopy.org/0.6dev2/schemas/_version.schema"
2121
}
2222
},
2323
"required": [

ngff_spec/schemas/coordinate_systems.schema

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://ngff.openmicroscopy.org/latest/schemas/coordinate_systems.schema",
3+
"$id": "https://ngff.openmicroscopy.org/0.6dev2/schemas/coordinate_systems.schema",
44
"title": "NGFF CoordinateSystem",
55
"description": "JSON from OME-NGFF .zattrs",
66
"type": "array",
@@ -15,7 +15,8 @@
1515
"properties": {
1616
"name": {
1717
"type": "string",
18-
"description": "Name of coordinate system"
18+
"minLength": 1,
19+
"description": "Name of coordinate system. Must be unique among all coordinate systems."
1920
},
2021
"axes": {
2122
"$ref": "axes.schema"

ngff_spec/schemas/coordinate_systems_and_transforms.schema

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://ngff.openmicroscopy.org/latest/schemas/coordinate_systems_and_transforms.schema",
3+
"$id": "https://ngff.openmicroscopy.org/0.6dev2/schemas/coordinate_systems_and_transforms.schema",
44
"title": "NGFF Coordinate Systems and Transforms",
55
"description": "Coordinate Systems and transforms for OME-NGFF",
66
"type": "object",
77
"properties": {
88
"coordinateSystems": {
9-
"$ref": "coordinate_systems.schema"
9+
"$ref": "coordinate_systems.schema",
10+
"description": "Coordinate systems to combine with transforms to define spatial relationships"
1011
},
1112
"coordinateTransformations": {
12-
"$ref": "coordinate_transformations.schema"
13+
"$ref": "coordinate_transformations.schema",
14+
"description": "Coordinate transformations defining spatial relationships between coordinate systems"
1315
},
1416
"arrayCoordinateSystem": {
1517
"type": "object",

0 commit comments

Comments
 (0)