diff --git a/index.md b/index.md index f55b15e7..5553570e 100644 --- a/index.md +++ b/index.md @@ -1491,12 +1491,13 @@ 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, @@ -1513,9 +1514,9 @@ 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" } ``` @@ -1525,11 +1526,13 @@ 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. The `channels` array length SHOULD correspond to the size of the respective channels axis, if present. -Each object in `channels` MAY contain the following fields: +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. +- `coefficient`: (float) Value to multiply the pixel values of the channel by when rendering. +- `family`: (string) Used transfer function family for rendering the channel, e.g. "linear", "log", "gamma". - `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. diff --git a/schemas/image.schema b/schemas/image.schema index fcba2982..bc181458 100644 --- a/schemas/image.schema +++ b/schemas/image.schema @@ -143,6 +143,9 @@ "label": { "type": "string" }, + "coefficient": { + "type": "number" + }, "family": { "type": "string" }, 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..c188b5f9 --- /dev/null +++ b/tests/attributes/spec/invalid/omero/missing_start_end.json @@ -0,0 +1,94 @@ +{ + "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, + "family": "linear", + "coefficient": 1.0, + "inverted": false, + "window": { + "min": 0, + "max": 255 + } + }, + { + "label": "Channel:1", + "color": "#00ff00", + "active": true, + "family": "log", + "coefficient": 0.5, + "inverted": true, + "window": { + "min": 0, + "max": 255 + } + }, + { + "label": "Channel:2", + "color": "#0000ff", + "active": true, + "family": "gamma", + "coefficient": 2.0, + "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..367d255f --- /dev/null +++ b/tests/attributes/spec/valid/omero/full_omero_metadata.json @@ -0,0 +1,99 @@ +{ + "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, + "family": "linear", + "coefficient": 1.0, + "inverted": false, + "window": { + "min": 0, + "start": 100, + "end": 200, + "max": 255 + } + }, + { + "label": "Channel:1", + "color": "#00ff00", + "active": true, + "family": "log", + "coefficient": 0.5, + "inverted": true, + "window": { + "min": 0, + "start": 50, + "end": 150, + "max": 255 + } + }, + { + "label": "Channel:2", + "color": "#0000ff", + "active": true, + "family": "gamma", + "coefficient": 2.0, + "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/version_history.md b/version_history.md index f08db909..041af156 100644 --- a/version_history.md +++ b/version_history.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Updated version keys from `0.6.dev2` to `0.6.dev3` everywhere - style: Homogeneous use of backticks in spec document +- spec: Released requirements for `omero` metadata in the spec document and in schemas. ### Removed