diff --git a/index.md b/index.md index 5c825ed3..a543fb14 100644 --- a/index.md +++ b/index.md @@ -1431,17 +1431,16 @@ if not datasets: ### "omero" metadata (transitional) (omero-md)= -[=Transitional=] information specific to the channels of an image and how to render it can be found under the `omero` key in the group-level metadata: +Information specific to the channels of an image and how to render it +can be found under the `omero` key in the group-level metadata (i.e., under `"ome" > "omero"`): ```json -"id": 1, # ID in OMERO -"name": "example.tif", # Name as shown in the UI -"channels": [ # Array matching the c dimension size +"id": 1, // ID in OMERO +"name": "example.tif", // Name as shown in the UI +"channels": [ // Array matching the c dimension size { "active": true, - "coefficient": 1, "color": "0000FF", - "family": "linear", "inverted": false, "label": "LaminB1", "window": { @@ -1453,25 +1452,30 @@ if not datasets: } ], "rdefs": { - "defaultT": 0, # First timepoint to show the user - "defaultZ": 118, # First Z section to show the user - "model": "color" # "color" or "greyscale" + "defaultT": 0, // First timepoint to show the user + "defaultZ": 118, // First Z section to show the user + "model": "color" // "color" or "greyscale" } ``` -See the [OMERO WebGateway documentation](https://omero.readthedocs.io/en/stable/developers/Web/WebGateway.html#imgdata) -for more information. - The `omero` metadata is optional, but if present it MUST contain the field `channels`, which is an array of objects describing the channels of the image. -Each object in `channels` MUST contain the field `color`, -which is a string of 6 hexadecimal digits specifying the color of the channel in RGB format. -Each object in `channels` MUST contain the field `window`, -which is a object describing the windowing of the channel. -The field `window` MUST contain the fields `min` and `max`, -which are the minimum and maximum values of the window, respectively. -It MUST also contain the fields `start` and `end`, -which are the start and end values of the window, respectively. +The `channels` array length SHOULD correspond to the size of the respective channels axis, if present. +Each object in `channels` is optional and MAY contain the following fields: + +- `color` (string) String of 6 hexadecimal digits specifying the color of the channel in RGB format. +- `label` (string) Channel name. +- `active` (boolean) Indicates whether the channel should be displayed. +- `window` (dictionary) Values describing the windowing of the channel. + If provided, `start` and `end` values MUST be specified. + All values can be floating-point numbers, but will likely be integers for integer pixel types. + - `min` (float) Default setting for lower bound for values of `start` field. + MAY be used by viewers as the lower range of channel sliders. + - `max` (float) Default setting for upper bound for values of `end` field. + MAY be used by viewers as the upper range of channel sliders. + - `start` (float) Start of the rendering window. + - `end` (float) End of the rendering window. +- `inverted` (boolean) If true, the rendering of darkest to brightest pixels should be inverted. ### "labels" metadata (labels-md)= diff --git a/schemas/image.schema b/schemas/image.schema index 379b00f4..099f35d2 100644 --- a/schemas/image.schema +++ b/schemas/image.schema @@ -238,22 +238,20 @@ }, "required": [ "start", - "min", - "end", - "max" + "end" ] }, "label": { "type": "string" }, - "family": { - "type": "string" - }, "color": { "type": "string" }, "active": { "type": "boolean" + }, + "inverted": { + "type": "boolean" } } } diff --git a/tests/attributes/spec/invalid/image/invalid_channels_color.json b/tests/attributes/spec/invalid/image/invalid_channels_color.json index 2521d6cc..a1974bc2 100644 --- a/tests/attributes/spec/invalid/image/invalid_channels_color.json +++ b/tests/attributes/spec/invalid/image/invalid_channels_color.json @@ -42,9 +42,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": 255, - "family": "linear", "label": "1234", "window": { "end": 1765.0, diff --git a/tests/attributes/spec/invalid/image/invalid_channels_window.json b/tests/attributes/spec/invalid/image/invalid_channels_window.json index f915eaad..bf394f94 100644 --- a/tests/attributes/spec/invalid/image/invalid_channels_window.json +++ b/tests/attributes/spec/invalid/image/invalid_channels_window.json @@ -42,9 +42,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": "ff0000", - "family": "linear", "label": "1234", "window": { "end": "100", diff --git a/tests/attributes/spec/invalid/omero/missing_channels.json b/tests/attributes/spec/invalid/omero/missing_channels.json new file mode 100644 index 00000000..7c5b7b58 --- /dev/null +++ b/tests/attributes/spec/invalid/omero/missing_channels.json @@ -0,0 +1,56 @@ +{ + "ome": { + "version": "0.6.dev3", + "multiscales": [ + { + "coordinateSystems": [ + { + "name": "physical", + "axes": [ + { + "name": "z", + "type": "space", + "unit": "micrometer" + }, + { + "name": "y", + "type": "space", + "unit": "micrometer" + }, + { + "name": "x", + "type": "space", + "unit": "micrometer" + } + ] + } + ], + "datasets": [ + { + "path": "s0", + "coordinateTransformations": [ + { + "scale": [ + 1, + 1, + 1 + ], + "input": "s0", + "output": "physical", + "type": "scale" + } + ] + } + ] + } + ], + "omero": { + } + }, + "_conformance": { + "schema": { + "id": "schemas/image.schema" + }, + "valid": false + } +} \ No newline at end of file diff --git a/tests/attributes/spec/invalid/omero/missing_start_end.json b/tests/attributes/spec/invalid/omero/missing_start_end.json new file mode 100644 index 00000000..8778a74c --- /dev/null +++ b/tests/attributes/spec/invalid/omero/missing_start_end.json @@ -0,0 +1,88 @@ +{ + "ome": { + "version": "0.6.dev3", + "multiscales": [ + { + "coordinateSystems": [ + { + "name": "physical", + "axes": [ + { + "name": "z", + "type": "space", + "unit": "micrometer" + }, + { + "name": "y", + "type": "space", + "unit": "micrometer" + }, + { + "name": "x", + "type": "space", + "unit": "micrometer" + } + ] + } + ], + "datasets": [ + { + "path": "s0", + "coordinateTransformations": [ + { + "scale": [ + 1, + 1, + 1 + ], + "input": "s0", + "output": "physical", + "type": "scale" + } + ] + } + ] + } + ], + "omero": { + "channels": [ + { + "label": "Channel:0", + "color": "ff0000", + "active": true, + "inverted": false, + "window": { + "min": 0, + "max": 255 + } + }, + { + "label": "Channel:1", + "color": "00ff00", + "active": true, + "inverted": true, + "window": { + "min": 0, + "max": 255 + } + }, + { + "label": "Channel:2", + "color": "0000ff", + "active": true, + "inverted": false, + "window": { + "min": 0, + "max": 255 + } + } + ] + } + }, + "_conformance": { + "schema": { + "id": "schemas/image.schema" + }, + "valid": false + } +} \ No newline at end of file diff --git a/tests/attributes/spec/valid/omero/full_omero_metadata.json b/tests/attributes/spec/valid/omero/full_omero_metadata.json new file mode 100644 index 00000000..77d3a029 --- /dev/null +++ b/tests/attributes/spec/valid/omero/full_omero_metadata.json @@ -0,0 +1,93 @@ +{ + "ome": { + "version": "0.6rc0", + "multiscales": [ + { + "coordinateSystems": [ + { + "name": "physical", + "axes": [ + { + "name": "z", + "type": "space", + "unit": "micrometer" + }, + { + "name": "y", + "type": "space", + "unit": "micrometer" + }, + { + "name": "x", + "type": "space", + "unit": "micrometer" + } + ] + } + ], + "datasets": [ + { + "path": "s0", + "coordinateTransformations": [ + { + "scale": [ + 1, + 1, + 1 + ], + "input": {"path": "s0"}, + "output": {"name": "physical"}, + "type": "scale" + } + ] + } + ] + } + ], + "omero": { + "channels": [ + { + "label": "Channel:0", + "color": "ff0000", + "active": true, + "inverted": false, + "window": { + "min": 0, + "start": 100, + "end": 200, + "max": 255 + } + }, + { + "label": "Channel:1", + "color": "00ff00", + "active": true, + "inverted": true, + "window": { + "min": 0, + "start": 50, + "end": 150, + "max": 255 + } + }, + { + "label": "Channel:2", + "color": "0000ff", + "active": true, + "inverted": false, + "window": { + "min": 0, + "start": 25, + "end": 125, + "max": 255 + } + } + ] + } + }, + "_conformance": { + "schema": { + "id": "schemas/image.schema" + } + } +} \ No newline at end of file diff --git a/tests/attributes/strict/valid/image/image_omero.json b/tests/attributes/strict/valid/image/image_omero.json index c61a7d70..5e7555e1 100644 --- a/tests/attributes/strict/valid/image/image_omero.json +++ b/tests/attributes/strict/valid/image/image_omero.json @@ -122,9 +122,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": "00FF00", - "family": "linear", "inverted": false, "label": "FITC", "window": { @@ -136,9 +134,7 @@ }, { "active": true, - "coefficient": 1.0, "color": "FF0000", - "family": "linear", "inverted": false, "label": "RD-TR-PE", "window": { diff --git a/tests/zarr/spec/invalid/image/invalid_channels_color.ome.zarr/zarr.json b/tests/zarr/spec/invalid/image/invalid_channels_color.ome.zarr/zarr.json index cd5a8f3e..f6b2632a 100644 --- a/tests/zarr/spec/invalid/image/invalid_channels_color.ome.zarr/zarr.json +++ b/tests/zarr/spec/invalid/image/invalid_channels_color.ome.zarr/zarr.json @@ -45,9 +45,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": 255, - "family": "linear", "label": "1234", "window": { "end": 1765.0, diff --git a/tests/zarr/spec/invalid/image/invalid_channels_window.ome.zarr/zarr.json b/tests/zarr/spec/invalid/image/invalid_channels_window.ome.zarr/zarr.json index 0c1f59cf..9384f149 100644 --- a/tests/zarr/spec/invalid/image/invalid_channels_window.ome.zarr/zarr.json +++ b/tests/zarr/spec/invalid/image/invalid_channels_window.ome.zarr/zarr.json @@ -45,9 +45,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": "ff0000", - "family": "linear", "label": "1234", "window": { "end": "100", diff --git a/tests/zarr/strict/valid/image/image_omero.ome.zarr/zarr.json b/tests/zarr/strict/valid/image/image_omero.ome.zarr/zarr.json index e8222896..1f5e1df4 100644 --- a/tests/zarr/strict/valid/image/image_omero.ome.zarr/zarr.json +++ b/tests/zarr/strict/valid/image/image_omero.ome.zarr/zarr.json @@ -125,9 +125,7 @@ "channels": [ { "active": true, - "coefficient": 1.0, "color": "00FF00", - "family": "linear", "inverted": false, "label": "FITC", "window": { @@ -139,9 +137,7 @@ }, { "active": true, - "coefficient": 1.0, "color": "FF0000", - "family": "linear", "inverted": false, "label": "RD-TR-PE", "window": {