Skip to content

Commit

Permalink
adds schema_url + changes the root object for the JSON schemas to 'at…
Browse files Browse the repository at this point in the history
…tributes' within a zarr.json
  • Loading branch information
normanrz committed Sep 26, 2024
1 parent f1bab0c commit 4e4bf5a
Show file tree
Hide file tree
Showing 32 changed files with 2,366 additions and 2,423 deletions.
6 changes: 5 additions & 1 deletion latest/examples/bf2raw/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"zarr_format": 3,
"node_type": "group",
"attributes": {
"ome": { "version": "0.5", "bioformats2raw.layout": 3 }
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"bioformats2raw.layout": 3
}
}
}
1 change: 1 addition & 0 deletions latest/examples/bf2raw/plate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"bioformats2raw.layout": 3,
"plate": {
"columns": [
Expand Down
1 change: 1 addition & 0 deletions latest/examples/label_strict/colors_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"image-label": {
"colors": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"multiscales": [
{
"name": "example",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"multiscales": [
{
"axes": [
Expand Down
6 changes: 5 additions & 1 deletion latest/examples/ome/series-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"zarr_format": 3,
"node_type": "group",
"attributes": {
"ome": { "version": "0.5", "series": ["0", "1"] }
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"series": ["0", "1"]
}
}
}
1 change: 1 addition & 0 deletions latest/examples/plate_strict/plate_2wells.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"plate": {
"acquisitions": [
{
Expand Down
1 change: 1 addition & 0 deletions latest/examples/plate_strict/plate_6wells.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"plate": {
"acquisitions": [
{
Expand Down
1 change: 1 addition & 0 deletions latest/examples/well_strict/well_2fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"well": {
"images": [
{
Expand Down
1 change: 1 addition & 0 deletions latest/examples/well_strict/well_4fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
"well": {
"images": [
{
Expand Down
6 changes: 4 additions & 2 deletions latest/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ The OME-Zarr Metadata is stored in the various `zarr.json` files throughout the
hierarchy. In this file, the metadata is stored under the namespaced key
`ome` in `attributes`.
The version of the OME-Zarr Metadata is denoted as a string in the `version` attribute within the `ome` namespace.
A URL to the JSON Schema of the OME-Zarr Metadata is denoted as a string in the `schema_url` attribute within the `ome` namespace.

The OME-Zarr Metadata version MUST be consistent within a hierarchy.

Expand All @@ -173,6 +174,7 @@ The OME-Zarr Metadata version MUST be consistent within a hierarchy.
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema",
...
}
}
Expand Down Expand Up @@ -324,7 +326,7 @@ Each "multiscales" dictionary MAY contain the field "coordinateTransformations",
The transformations MUST follow the same rules about allowed types, order, etc. as in "datasets:coordinateTransformations" and are applied after them.
They can for example be used to specify the `scale` for a dimension that is the same for all resolutions.

Each "multiscales" dictionary SHOULD contain the field "name". It MUST contain the field "version", which indicates the version of the multiscale metadata of this image (current version is [NGFFVERSION]).
Each "multiscales" dictionary SHOULD contain the field "name".

Each "multiscales" dictionary SHOULD contain the field "type", which gives the type of downscaling method used to generate the multiscale image pyramid.
It SHOULD contain the field "metadata", which contains a dictionary with additional information about the downscaling method.
Expand Down Expand Up @@ -358,7 +360,6 @@ can be found under the "omero" key in the group-level metadata:
```json
"id": 1, # ID in OMERO
"name": "example.tif", # Name as shown in the UI
"version": "0.5-dev", # Current version
"channels": [ # Array matching the c dimension size
{
"active": true,
Expand Down Expand Up @@ -408,6 +409,7 @@ labeled multiscale image(s). All label images SHOULD be listed within this metad
"attributes": {
"ome": {
"version": "0.5",
"schema_url": "https://ngff.openmicroscopy.org/latest/schemas/ome_zarr.schema",
"labels": [
"cell_space_segmentation"
]
Expand Down
10 changes: 10 additions & 0 deletions latest/schemas/_schema_url.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/_schema_url.schema",
"title": "OME-Zarr Schema URL",
"description": "A URL to the JSON schema of the OME-Zarr Metadata",
"type": "string",
"enum": [
"https://ngff.openmicroscopy.org/0.5/schemas/ome_zarr.schema"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/version.schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/_version.schema",
"title": "OME-Zarr Metadata version",
"description": "The version of the OME-Zarr Metadata",
"type": "string",
Expand Down
41 changes: 18 additions & 23 deletions latest/schemas/bf2raw.schema
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,35 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/bf2raw.schema",
"title": "OME-Zarr container produced by bioformats2raw",
"description": "JSON from OME-Zarr zarr.json",
"description": "The zarr.json attributes key",
"type": "object",
"properties": {
"attributes": {
"description": "The zarr.json attributes key",
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"bioformats2raw.layout": {
"description": "The top-level identifier metadata added by bioformats2raw",
"type": "number",
"enum": [
3
]
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/version.schema"
}
},
"required": [
"bioformats2raw.layout",
"version"
"bioformats2raw.layout": {
"description": "The top-level identifier metadata added by bioformats2raw",
"type": "number",
"enum": [
3
]
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_version.schema"
},
"schema_url": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_schema_url.schema"
}
},
"required": [
"ome"
"bioformats2raw.layout",
"version",
"schema_url"
]
}
},
"required": [
"attributes"
"ome"
]
}
47 changes: 21 additions & 26 deletions latest/schemas/image.schema
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,36 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/image.schema",
"title": "OME-Zarr Image",
"description": "JSON from OME-Zarr zarr.json",
"description": "The zarr.json attributes key",
"type": "object",
"properties": {
"attributes": {
"description": "The zarr.json attributes key",
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"multiscales": {
"$ref": "#/$defs/multiscales"
},
"omero": {
"$ref": "#/$defs/omero"
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/version.schema"
}
},
"required": [
"multiscales",
"version"
]
"multiscales": {
"$ref": "#/$defs/multiscales"
},
"omero": {
"$ref": "#/$defs/omero"
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_version.schema"
},
"schema_url": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_schema_url.schema"
}
},
"required": [
"ome"
"multiscales",
"version",
"schema_url"
]
}
},
"required": [
"ome"
],
"$defs": {
"multiscales": {
"description": "The multiscale datasets for this image",
Expand Down Expand Up @@ -270,8 +268,5 @@
]
}
}
},
"required": [
"attributes"
]
}
}
41 changes: 18 additions & 23 deletions latest/schemas/label.schema
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/label.schema",
"title": "OME-Zarr labelled image schema",
"description": "JSON from OME-Zarr zarr.json",
"description": "The zarr.json attributes key",
"type": "object",
"properties": {
"attributes": {
"description": "The zarr.json attributes key",
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"image-label": {
"$ref": "#/$defs/image-label"
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/version.schema"
}
},
"required": [
"image-label",
"version"
]
"image-label": {
"$ref": "#/$defs/image-label"
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_version.schema"
},
"schema_url": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_schema_url.schema"
}
},
"required": [
"ome"
"image-label",
"version",
"schema_url"
]
}
},
"required": [
"ome"
],
"$defs": {
"image-label": {
"type": "object",
Expand Down Expand Up @@ -93,8 +91,5 @@
}
}
}
},
"required": [
"attributes"
]
}
}
43 changes: 19 additions & 24 deletions latest/schemas/ome.schema
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,36 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ngff.openmicroscopy.org/latest/schemas/ome.schema",
"title": "OME-Zarr group produced by bioformats2raw to contain OME metadata",
"description": "JSON from OME-Zarr OME/zarr.json linked to an OME-XML file",
"description": "The zarr.json attributes key",
"type": "object",
"properties": {
"attributes": {
"description": "The zarr.json attributes key",
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"ome": {
"description": "The versioned OME-Zarr Metadata namespace",
"type": "object",
"properties": {
"series": {
"description": "An array of the same length and the same order as the images defined in the OME-XML",
"type": "array",
"items": {
"type": "string"
},
"minContains": 1
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/version.schema"
}
"series": {
"description": "An array of the same length and the same order as the images defined in the OME-XML",
"type": "array",
"items": {
"type": "string"
},
"required": [
"series",
"version"
]
"minContains": 1
},
"version": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_version.schema"
},
"schema_url": {
"$ref": "https://ngff.openmicroscopy.org/latest/schemas/_schema_url.schema"
}
},
"required": [
"ome"
"series",
"version",
"schema_url"
]
}
},
"required": [
"attributes"
"ome"
]
}
Loading

0 comments on commit 4e4bf5a

Please sign in to comment.