From 1a60cb788fb31882ecb5a1d09881f0a8a0fee77f Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Fri, 27 May 2022 08:41:56 +0100 Subject: [PATCH 01/15] Add first version of minimal and strict JSON schemas for image-label --- 0.4/schemas/image-label.schema | 77 +++++++++++++++++++++++++++ 0.4/schemas/strict_image-label.schema | 18 +++++++ 2 files changed, 95 insertions(+) create mode 100644 0.4/schemas/image-label.schema create mode 100644 0.4/schemas/strict_image-label.schema diff --git a/0.4/schemas/image-label.schema b/0.4/schemas/image-label.schema new file mode 100644 index 00000000..e8e8fdd5 --- /dev/null +++ b/0.4/schemas/image-label.schema @@ -0,0 +1,77 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", + "title": "OME-NGFF well schema", + "description": "JSON from OME-NGFF .zattrs", + "type": "object", + "properties": { + "image-label": { + "type": "object", + "properties": { + "colors": { + "description": "The colors for this label image", + "type": "array", + "items": { + "type": "object", + "properties": { + "label-value": { + "description": "The value of the label", + "type": "number" + }, + "rgba": { + "description": "The color stored as an RGBA unsigned-int 4-tuple", + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "minItems": 4, + "maxItems": 4 + } + }, + "required": [ + "label-value" + ] + }, + "minItems": 1, + "uniqueItems": true + }, + "properties": { + "description": "The properties for this label image", + "type": "array", + "items": { + "type": "object", + "properties": { + "label-value": { + "description": "The pixel value for this label", + "type": "integer" + } + }, + "required": [ + "label-value" + ] + }, + "minItems": 1, + "uniqueItems": true + }, + "source": { + "description": "The source of this label image", + "type": "object", + "properties": { + "image": { + "type": "string" + } + } + }, + "version": { + "description": "The version of the specification", + "type": "string", + "enum": [ + "0.4" + ] + } + } + } + } +} diff --git a/0.4/schemas/strict_image-label.schema b/0.4/schemas/strict_image-label.schema new file mode 100644 index 00000000..afa63aef --- /dev/null +++ b/0.4/schemas/strict_image-label.schema @@ -0,0 +1,18 @@ +{ + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_image-label.schema", + "allOf": [ + { + "$ref": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema" + }, + { + "properties": { + "image-label": { + "required": [ + "version", + "colors" + ] + } + } + } + ] +} From 8e436c4fc808b521be4ff9a6801a62a68a848d30 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Fri, 27 May 2022 08:43:49 +0100 Subject: [PATCH 02/15] Extract image-label snippet under examples and add validation config file --- 0.4/examples/image-label_strict/.config.json | 3 ++ .../image-label_strict/colors_properties.json | 29 ++++++++++++++ 0.4/index.bs | 38 ++----------------- 3 files changed, 36 insertions(+), 34 deletions(-) create mode 100644 0.4/examples/image-label_strict/.config.json create mode 100644 0.4/examples/image-label_strict/colors_properties.json diff --git a/0.4/examples/image-label_strict/.config.json b/0.4/examples/image-label_strict/.config.json new file mode 100644 index 00000000..3ffdb606 --- /dev/null +++ b/0.4/examples/image-label_strict/.config.json @@ -0,0 +1,3 @@ +{ + "schema": "schemas/strict_image-label.schema" +} diff --git a/0.4/examples/image-label_strict/colors_properties.json b/0.4/examples/image-label_strict/colors_properties.json new file mode 100644 index 00000000..60a3d7f1 --- /dev/null +++ b/0.4/examples/image-label_strict/colors_properties.json @@ -0,0 +1,29 @@ +{ + "image-label": { + "version": "0.4", + "colors": [ + { + "label-value": 1, + "rgba": [255, 255, 255, 1] + }, + { + "label-value": 4, + "rgba": [0, 255, 255, 128] + } + ], + "properties": [ + { + "label-value": 1, + "area (pixels)": 1200, + "class": "foo" + }, + { + "label-value": 4, + "area (pixels)": 1650 + } + ], + "source": { + "image": "../../" + } + } +} diff --git a/0.4/index.bs b/0.4/index.bs index a0c3f83d..7322ab8c 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -398,40 +398,10 @@ whose value is the relative path to a Zarr image group. The default value is above). -```json -"image-label": - { - "version": "0.4", - "colors": [ - { - "label-value": 1, - "rgba": [255, 255, 255, 0] - }, - { - "label-value": 4, - "rgba": [0, 255, 255, 128] - }, - ... - ], - "properties": [ - { - "label-value": 1, - "area (pixels)": 1200, - "class": "foo" - - }, - { - "label-value": 4, - "area (pixels)": 1650 - }, - ... - ] - }, - "source": { - "image": "../../" - } -] -``` +
+path: examples/image-label_strict/color_properties.json
+highlight: json
+
"plate" metadata {#plate-md} ---------------------------- From b2e2849a71d685bb3b0551d90de01e4ed97e9462 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Mon, 6 Jun 2022 21:37:53 +0100 Subject: [PATCH 03/15] Clarify image-label specification Try to be unambiguous and explicit about the colors, properties and image key --- 0.4/index.bs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/0.4/index.bs b/0.4/index.bs index 7322ab8c..025dc3ae 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -375,27 +375,29 @@ in which each unique pixel value represents a separate segmented object. `image-label` groups MUST also contain `multiscales` metadata and the two "datasets" series MUST have the same number of entries. -The `colors` key defines a list of JSON objects describing the unique label -values. Each entry in the list MUST contain the key "label-value" with the -pixel value for that label. Additionally, the "rgba" key MAY be present, the -value for which is an RGBA unsigned-int 4-tuple: `[uint8, uint8, uint8, uint8]` -All `label-value`s must be unique. Clients who choose to not throw an error -should ignore all except the _last_ entry. - -Some implementations may represent overlapping labels by using a specially assigned +The `image-label` dictionary SHOULD contain a `colors` key whose value MUST be a +list of JSON objects describing the unique label values. Each color object MUST +contain the `label-value` key whose value MUST be an integer specifying the +pixel value for that label. It MAY contain an `rgba` key whose value MUST be an tuple +of four integers between 0 and 255 `[uint8, uint8, uint8, uint8]` specifying the label +color as RGBA. All the values under the `label-value` key MUST be unique. Clients +who choose to not throw an error SHOULD ignore all except the _last_ entry. + +Some implementations MAY represent overlapping labels by using a specially assigned value, for example the highest integer available in the pixel range. -The `properties` key defines a list of JSON objects which also describes the unique -label values. Each entry in the list MUST contain the key "label-value" with the -pixel value for that label. Additionally, an arbitrary number of key-value pairs +The `image-label` dictionary MAY contain a `properties` key whose value MUST be a +ist of JSON objects which also describes the unique label values. Each property object +MUST contain the `label-value` key whose value MUST be an integer specifying the pixel +value for that label. Additionally, an arbitrary number of key-value pairs MAY be present for each label value denoting associated metadata. Not all label values must share the same key-value pairs within the properties list. -The `source` key is an optional dictionary which contains information on the -image the label is associated with. If included it MAY include a key `image` -whose value is the relative path to a Zarr image group. The default value is -"../../" since most labels are stored under a subgroup named "labels/" (see -above). +The `image-label` dictionary MAY contain a `source` key whose value MUST be a JSON +object conatining information on the image the label is associated with. If included, +it MAY include a key `image` whose value MUST be a string specifying the relative +path to a Zarr image group. The default value is "../../" since most labels are stored +under a subgroup named "labels/" (see above).

From 156262fcc3ec86995eaa0a4248e97f6e3e59d5b8 Mon Sep 17 00:00:00 2001
From: Sebastien Besson 
Date: Tue, 14 Jun 2022 14:54:13 +0100
Subject: [PATCH 04/15] Add JSON schema test suite for image-label

---
 0.4/tests/image-label_suite.json        | 131 ++++++++++++++++++++++++
 0.4/tests/strict_image-label_suite.json |  31 ++++++
 2 files changed, 162 insertions(+)
 create mode 100644 0.4/tests/image-label_suite.json
 create mode 100644 0.4/tests/strict_image-label_suite.json

diff --git a/0.4/tests/image-label_suite.json b/0.4/tests/image-label_suite.json
new file mode 100644
index 00000000..27dacc41
--- /dev/null
+++ b/0.4/tests/image-label_suite.json
@@ -0,0 +1,131 @@
+{
+  "description": "Tests for the image-label JSON schema",
+  "schema": {
+    "id": "schemas/image-label.schema"
+  },
+  "tests": [
+    {
+      "formerly": "image-label/minimal",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 0]
+            }
+          ]
+        }
+      },
+      "valid": true
+    },
+    {
+      "formerly": "image-label/minimal_properties",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 0]
+            }
+          ],
+          "properties": [
+            {
+              "label-value": 1
+            }
+          ]
+        }
+      },
+      "valid": true
+    },
+    {
+      "formerly": "image-label/empty_colors",
+      "data": {
+        "image-label": {
+          "colors": []
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/empty_properties",
+      "data": {
+        "image-label": {
+          "properties": []
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/colors_no_label_value",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "rgba": [0, 0, 0, 0]
+            }
+          ]
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/properties_no_label_value",
+      "data": {
+        "image-label": {
+          "properties": [
+            {
+              "value": "foo"
+            }
+          ]
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/colors_rgba_length",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0]
+            }
+          ]
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/colors_rgba_type",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 500]
+            }
+          ]
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/colors_duplicate",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 0]
+            },
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 0]
+            }
+          ]
+        }
+      },
+      "valid": false
+    }
+  ]
+}
diff --git a/0.4/tests/strict_image-label_suite.json b/0.4/tests/strict_image-label_suite.json
new file mode 100644
index 00000000..5eaeeaf3
--- /dev/null
+++ b/0.4/tests/strict_image-label_suite.json
@@ -0,0 +1,31 @@
+{
+  "description": "Tests for the strict image-label JSON schema",
+  "schema": {
+    "id": "schemas/strict_image-label.schema"
+  },
+  "tests": [
+    {
+      "formerly": "image-label/no_version",
+      "data": {
+        "image-label": {
+          "colors": [
+            {
+              "label-value": 1,
+              "rgba": [0, 0, 0, 0]
+            }
+          ]
+        }
+      },
+      "valid": false
+    },
+    {
+      "formerly": "image-label/no_colors",
+      "data": {
+        "image-label": {
+          "version": "0.4"
+        }
+      },
+      "valid": false
+    }
+  ]
+}

From 9db3f0ae4f7f239a80925f11ba061050fae9e1bd Mon Sep 17 00:00:00 2001
From: Sebastien Besson 
Date: Tue, 14 Jun 2022 15:00:32 +0100
Subject: [PATCH 05/15] Port 0.4 image-label improvement (schemas, examples,
 test, spec) to latest

---
 .../examples/image-label_strict/.config.json  |   3 +
 .../image-label_strict/colors_properties.json |  29 ++++
 latest/index.bs                               |  72 +++-------
 latest/schemas/image-label.schema             |  77 ++++++++++
 latest/schemas/strict_image-label.schema      |  18 +++
 latest/tests/image-label_suite.json           | 131 ++++++++++++++++++
 latest/tests/strict_image-label_suite.json    |  31 +++++
 7 files changed, 311 insertions(+), 50 deletions(-)
 create mode 100644 latest/examples/image-label_strict/.config.json
 create mode 100644 latest/examples/image-label_strict/colors_properties.json
 create mode 100644 latest/schemas/image-label.schema
 create mode 100644 latest/schemas/strict_image-label.schema
 create mode 100644 latest/tests/image-label_suite.json
 create mode 100644 latest/tests/strict_image-label_suite.json

diff --git a/latest/examples/image-label_strict/.config.json b/latest/examples/image-label_strict/.config.json
new file mode 100644
index 00000000..3ffdb606
--- /dev/null
+++ b/latest/examples/image-label_strict/.config.json
@@ -0,0 +1,3 @@
+{
+    "schema": "schemas/strict_image-label.schema"
+}
diff --git a/latest/examples/image-label_strict/colors_properties.json b/latest/examples/image-label_strict/colors_properties.json
new file mode 100644
index 00000000..7773c9b4
--- /dev/null
+++ b/latest/examples/image-label_strict/colors_properties.json
@@ -0,0 +1,29 @@
+{
+  "image-label": {
+    "version": "0.5-dev",
+    "colors": [
+      {
+        "label-value": 1,
+        "rgba": [255, 255, 255, 1]
+      },
+      {
+        "label-value": 4,
+        "rgba": [0, 255, 255, 128]
+      }
+    ],
+    "properties": [
+      {
+        "label-value": 1,
+        "area (pixels)": 1200,
+        "class": "foo"
+      },
+      {
+        "label-value": 4,
+        "area (pixels)": 1650
+      }
+    ],
+    "source": {
+      "image": "../../"
+    }
+  }
+}
diff --git a/latest/index.bs b/latest/index.bs
index e2fc6bcf..56b9ff6f 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -377,63 +377,35 @@ in which each unique pixel value represents a separate segmented object.
 `image-label` groups MUST also contain `multiscales` metadata and the two
 "datasets" series MUST have the same number of entries.
 
-The `colors` key defines a list of JSON objects describing the unique label
-values. Each entry in the list MUST contain the key "label-value" with the
-pixel value for that label. Additionally, the "rgba" key MAY be present, the
-value for which is an RGBA unsigned-int 4-tuple: `[uint8, uint8, uint8, uint8]`
-All `label-value`s must be unique. Clients who choose to not throw an error
-should ignore all except the _last_ entry.
-
-Some implementations may represent overlapping labels by using a specially assigned
+The `image-label` dictionary SHOULD contain a `colors` key whose value MUST be a
+list of JSON objects describing the unique label values. Each color object MUST
+contain the `label-value` key whose value MUST be an integer specifying the
+pixel value for that label. It MAY contain an `rgba` key whose value MUST be an tuple
+of four integers between 0 and 255 `[uint8, uint8, uint8, uint8]` specifying the label
+color as RGBA. All the values under the `label-value` key MUST be unique. Clients
+who choose to not throw an error SHOULD ignore all except the _last_ entry.
+
+Some implementations MAY represent overlapping labels by using a specially assigned
 value, for example the highest integer available in the pixel range.
 
-The `properties` key defines a list of JSON objects which also describes the unique
-label values. Each entry in the list MUST contain the key "label-value" with the
-pixel value for that label. Additionally, an arbitrary number of key-value pairs
+The `image-label` dictionary MAY contain a `properties` key whose value MUST be a
+ist of JSON objects which also describes the unique label values. Each property object
+MUST contain the `label-value` key whose value MUST be an integer specifying the pixel
+value for that label. Additionally, an arbitrary number of key-value pairs
 MAY be present for each label value denoting associated metadata. Not all label
 values must share the same key-value pairs within the properties list.
 
-The `source` key is an optional dictionary which contains information on the
-image the label is associated with. If included it MAY include a key `image`
-whose value is the relative path to a Zarr image group. The default value is
-"../../" since most labels are stored under a subgroup named "labels/" (see
-above).
+The `image-label` dictionary MAY contain a `source` key whose value MUST be a JSON
+object conatining information on the image the label is associated with. If included,
+it MAY include a key `image` whose value MUST be a string specifying the relative
+path to a Zarr image group. The default value is "../../" since most labels are stored
+under a subgroup named "labels/" (see above).
 
 
-```json
-"image-label":
-  {
-    "version": "0.5-dev",
-    "colors": [
-      {
-        "label-value": 1,
-        "rgba": [255, 255, 255, 0]
-      },
-      {
-        "label-value": 4,
-        "rgba": [0, 255, 255, 128]
-      },
-      ...
-      ],
-    "properties": [
-      {
-        "label-value": 1,
-        "area (pixels)": 1200,
-        "class": "foo"
-
-      },
-      {
-        "label-value": 4,
-        "area (pixels)": 1650
-      },
-      ...
-      ]
-  },
-  "source": {
-    "image": "../../"
-  }
-]
-```
+
+path: examples/image-label_strict/color_properties.json
+highlight: json
+
"plate" metadata {#plate-md} ---------------------------- diff --git a/latest/schemas/image-label.schema b/latest/schemas/image-label.schema new file mode 100644 index 00000000..de45f511 --- /dev/null +++ b/latest/schemas/image-label.schema @@ -0,0 +1,77 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", + "title": "OME-NGFF well schema", + "description": "JSON from OME-NGFF .zattrs", + "type": "object", + "properties": { + "image-label": { + "type": "object", + "properties": { + "colors": { + "description": "The colors for this label image", + "type": "array", + "items": { + "type": "object", + "properties": { + "label-value": { + "description": "The value of the label", + "type": "number" + }, + "rgba": { + "description": "The color stored as an RGBA unsigned-int 4-tuple", + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "minItems": 4, + "maxItems": 4 + } + }, + "required": [ + "label-value" + ] + }, + "minItems": 1, + "uniqueItems": true + }, + "properties": { + "description": "The properties for this label image", + "type": "array", + "items": { + "type": "object", + "properties": { + "label-value": { + "description": "The pixel value for this label", + "type": "integer" + } + }, + "required": [ + "label-value" + ] + }, + "minItems": 1, + "uniqueItems": true + }, + "source": { + "description": "The source of this label image", + "type": "object", + "properties": { + "image": { + "type": "string" + } + } + }, + "version": { + "description": "The version of the specification", + "type": "string", + "enum": [ + "0.5-dev" + ] + } + } + } + } +} diff --git a/latest/schemas/strict_image-label.schema b/latest/schemas/strict_image-label.schema new file mode 100644 index 00000000..afa63aef --- /dev/null +++ b/latest/schemas/strict_image-label.schema @@ -0,0 +1,18 @@ +{ + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_image-label.schema", + "allOf": [ + { + "$ref": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema" + }, + { + "properties": { + "image-label": { + "required": [ + "version", + "colors" + ] + } + } + } + ] +} diff --git a/latest/tests/image-label_suite.json b/latest/tests/image-label_suite.json new file mode 100644 index 00000000..27dacc41 --- /dev/null +++ b/latest/tests/image-label_suite.json @@ -0,0 +1,131 @@ +{ + "description": "Tests for the image-label JSON schema", + "schema": { + "id": "schemas/image-label.schema" + }, + "tests": [ + { + "formerly": "image-label/minimal", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0, 0] + } + ] + } + }, + "valid": true + }, + { + "formerly": "image-label/minimal_properties", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0, 0] + } + ], + "properties": [ + { + "label-value": 1 + } + ] + } + }, + "valid": true + }, + { + "formerly": "image-label/empty_colors", + "data": { + "image-label": { + "colors": [] + } + }, + "valid": false + }, + { + "formerly": "image-label/empty_properties", + "data": { + "image-label": { + "properties": [] + } + }, + "valid": false + }, + { + "formerly": "image-label/colors_no_label_value", + "data": { + "image-label": { + "colors": [ + { + "rgba": [0, 0, 0, 0] + } + ] + } + }, + "valid": false + }, + { + "formerly": "image-label/properties_no_label_value", + "data": { + "image-label": { + "properties": [ + { + "value": "foo" + } + ] + } + }, + "valid": false + }, + { + "formerly": "image-label/colors_rgba_length", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0] + } + ] + } + }, + "valid": false + }, + { + "formerly": "image-label/colors_rgba_type", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0, 500] + } + ] + } + }, + "valid": false + }, + { + "formerly": "image-label/colors_duplicate", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0, 0] + }, + { + "label-value": 1, + "rgba": [0, 0, 0, 0] + } + ] + } + }, + "valid": false + } + ] +} diff --git a/latest/tests/strict_image-label_suite.json b/latest/tests/strict_image-label_suite.json new file mode 100644 index 00000000..3a877f6f --- /dev/null +++ b/latest/tests/strict_image-label_suite.json @@ -0,0 +1,31 @@ +{ + "description": "Tests for the strict image-label JSON schema", + "schema": { + "id": "schemas/strict_image-label.schema" + }, + "tests": [ + { + "formerly": "image-label/no_version", + "data": { + "image-label": { + "colors": [ + { + "label-value": 1, + "rgba": [0, 0, 0, 0] + } + ] + } + }, + "valid": false + }, + { + "formerly": "image-label/no_colors", + "data": { + "image-label": { + "version": "0.5-dev" + } + }, + "valid": false + } + ] +} From 2d279978a7274f95245e6dc148a3d5a5fdcf45c1 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 14 Jun 2022 15:12:04 +0100 Subject: [PATCH 06/15] Add statement about version property --- 0.4/index.bs | 2 ++ latest/index.bs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/0.4/index.bs b/0.4/index.bs index 025dc3ae..239ed274 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -399,6 +399,8 @@ it MAY include a key `image` whose value MUST be a string specifying the relativ path to a Zarr image group. The default value is "../../" since most labels are stored under a subgroup named "labels/" (see above). +The `image-label` dictionary SHOULD contain a `version` key whose value MUST be a string +specifying the version of the image-label specification.
 path: examples/image-label_strict/color_properties.json
diff --git a/latest/index.bs b/latest/index.bs
index 56b9ff6f..74268f55 100644
--- a/latest/index.bs
+++ b/latest/index.bs
@@ -401,6 +401,8 @@ it MAY include a key `image` whose value MUST be a string specifying the relativ
 path to a Zarr image group. The default value is "../../" since most labels are stored
 under a subgroup named "labels/" (see above).
 
+The `image-label` dictionary SHOULD contain a `version` key whose value MUST be a string
+specifying the version of the image-label specification.
 
 
 path: examples/image-label_strict/color_properties.json

From d3f6cd57a5a4d8b518c61b0a91496cd32686aff6 Mon Sep 17 00:00:00 2001
From: Sebastien Besson 
Date: Tue, 14 Jun 2022 15:48:29 +0100
Subject: [PATCH 07/15] Fix typo in example path

---
 0.4/index.bs    | 2 +-
 latest/index.bs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/0.4/index.bs b/0.4/index.bs
index 239ed274..ac04ccdf 100644
--- a/0.4/index.bs
+++ b/0.4/index.bs
@@ -403,7 +403,7 @@ The `image-label` dictionary SHOULD contain a `version` key whose value MUST be
 specifying the version of the image-label specification.
 
 
-path: examples/image-label_strict/color_properties.json
+path: examples/image-label_strict/colors_properties.json
 highlight: json
 
diff --git a/latest/index.bs b/latest/index.bs index 74268f55..b27b2960 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -405,7 +405,7 @@ The `image-label` dictionary SHOULD contain a `version` key whose value MUST be specifying the version of the image-label specification.
-path: examples/image-label_strict/color_properties.json
+path: examples/image-label_strict/colors_properties.json
 highlight: json
 
From 10a86237b7e11bd5e7b273792c148904397379e8 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Wed, 15 Jun 2022 15:24:08 +0100 Subject: [PATCH 08/15] Fix typos --- 0.4/index.bs | 2 +- latest/index.bs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/0.4/index.bs b/0.4/index.bs index ac04ccdf..e4f5f490 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -387,7 +387,7 @@ Some implementations MAY represent overlapping labels by using a specially assig value, for example the highest integer available in the pixel range. The `image-label` dictionary MAY contain a `properties` key whose value MUST be a -ist of JSON objects which also describes the unique label values. Each property object +list of JSON objects which also describes the unique label values. Each property object MUST contain the `label-value` key whose value MUST be an integer specifying the pixel value for that label. Additionally, an arbitrary number of key-value pairs MAY be present for each label value denoting associated metadata. Not all label diff --git a/latest/index.bs b/latest/index.bs index b27b2960..c3e78871 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -389,7 +389,7 @@ Some implementations MAY represent overlapping labels by using a specially assig value, for example the highest integer available in the pixel range. The `image-label` dictionary MAY contain a `properties` key whose value MUST be a -ist of JSON objects which also describes the unique label values. Each property object +list of JSON objects which also describes the unique label values. Each property object MUST contain the `label-value` key whose value MUST be an integer specifying the pixel value for that label. Additionally, an arbitrary number of key-value pairs MAY be present for each label value denoting associated metadata. Not all label From 9dc320434488e53f384f8b5f613d0576722f40fa Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Thu, 23 Jun 2022 17:00:17 +0100 Subject: [PATCH 09/15] Update title of image-label schemas --- 0.4/schemas/image-label.schema | 2 +- latest/schemas/image-label.schema | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/0.4/schemas/image-label.schema b/0.4/schemas/image-label.schema index e8e8fdd5..9aef0788 100644 --- a/0.4/schemas/image-label.schema +++ b/0.4/schemas/image-label.schema @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", - "title": "OME-NGFF well schema", + "title": "OME-NGFF image-label schema", "description": "JSON from OME-NGFF .zattrs", "type": "object", "properties": { diff --git a/latest/schemas/image-label.schema b/latest/schemas/image-label.schema index de45f511..880264e0 100644 --- a/latest/schemas/image-label.schema +++ b/latest/schemas/image-label.schema @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", - "title": "OME-NGFF well schema", + "title": "OME-NGFF image-label schema", "description": "JSON from OME-NGFF .zattrs", "type": "object", "properties": { From 3a0c1609ca0015d6732c2a4f7bec4f8563d5642a Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Thu, 23 Jun 2022 17:00:57 +0100 Subject: [PATCH 10/15] Fix another typo --- 0.4/index.bs | 2 +- latest/index.bs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/0.4/index.bs b/0.4/index.bs index e4f5f490..96a7f9b6 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -394,7 +394,7 @@ MAY be present for each label value denoting associated metadata. Not all label values must share the same key-value pairs within the properties list. The `image-label` dictionary MAY contain a `source` key whose value MUST be a JSON -object conatining information on the image the label is associated with. If included, +object containing information on the image the label is associated with. If included, it MAY include a key `image` whose value MUST be a string specifying the relative path to a Zarr image group. The default value is "../../" since most labels are stored under a subgroup named "labels/" (see above). diff --git a/latest/index.bs b/latest/index.bs index c3e78871..2ecc3aff 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -396,7 +396,7 @@ MAY be present for each label value denoting associated metadata. Not all label values must share the same key-value pairs within the properties list. The `image-label` dictionary MAY contain a `source` key whose value MUST be a JSON -object conatining information on the image the label is associated with. If included, +object containing information on the image the label is associated with. If included, it MAY include a key `image` whose value MUST be a string specifying the relative path to a Zarr image group. The default value is "../../" since most labels are stored under a subgroup named "labels/" (see above). From 138da58ce8ec63e76a12b68cb9beac17f9471a85 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Thu, 23 Jun 2022 17:09:35 +0100 Subject: [PATCH 11/15] Use 255 as the alpha value of the first item of the example --- 0.4/examples/image-label_strict/colors_properties.json | 2 +- latest/examples/image-label_strict/colors_properties.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/0.4/examples/image-label_strict/colors_properties.json b/0.4/examples/image-label_strict/colors_properties.json index 60a3d7f1..2a14cbe4 100644 --- a/0.4/examples/image-label_strict/colors_properties.json +++ b/0.4/examples/image-label_strict/colors_properties.json @@ -4,7 +4,7 @@ "colors": [ { "label-value": 1, - "rgba": [255, 255, 255, 1] + "rgba": [255, 255, 255, 255] }, { "label-value": 4, diff --git a/latest/examples/image-label_strict/colors_properties.json b/latest/examples/image-label_strict/colors_properties.json index 7773c9b4..7f1d6f20 100644 --- a/latest/examples/image-label_strict/colors_properties.json +++ b/latest/examples/image-label_strict/colors_properties.json @@ -4,7 +4,7 @@ "colors": [ { "label-value": 1, - "rgba": [255, 255, 255, 1] + "rgba": [255, 255, 255, 255] }, { "label-value": 4, From a80b6bc38cd7c7dd0ea60950dc5eb399b73e76cb Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Thu, 23 Jun 2022 23:43:23 +0100 Subject: [PATCH 12/15] Use array rather than tuple --- 0.4/index.bs | 2 +- 0.4/schemas/image-label.schema | 2 +- latest/index.bs | 2 +- latest/schemas/image-label.schema | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/0.4/index.bs b/0.4/index.bs index 96a7f9b6..bdc6f8e7 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -378,7 +378,7 @@ in which each unique pixel value represents a separate segmented object. The `image-label` dictionary SHOULD contain a `colors` key whose value MUST be a list of JSON objects describing the unique label values. Each color object MUST contain the `label-value` key whose value MUST be an integer specifying the -pixel value for that label. It MAY contain an `rgba` key whose value MUST be an tuple +pixel value for that label. It MAY contain an `rgba` key whose value MUST be an array of four integers between 0 and 255 `[uint8, uint8, uint8, uint8]` specifying the label color as RGBA. All the values under the `label-value` key MUST be unique. Clients who choose to not throw an error SHOULD ignore all except the _last_ entry. diff --git a/0.4/schemas/image-label.schema b/0.4/schemas/image-label.schema index 9aef0788..cceb2820 100644 --- a/0.4/schemas/image-label.schema +++ b/0.4/schemas/image-label.schema @@ -19,7 +19,7 @@ "type": "number" }, "rgba": { - "description": "The color stored as an RGBA unsigned-int 4-tuple", + "description": "The RGBA color stored as an array of four integers between 0 and 255", "type": "array", "items": { "type": "integer", diff --git a/latest/index.bs b/latest/index.bs index 2ecc3aff..be480f6c 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -380,7 +380,7 @@ in which each unique pixel value represents a separate segmented object. The `image-label` dictionary SHOULD contain a `colors` key whose value MUST be a list of JSON objects describing the unique label values. Each color object MUST contain the `label-value` key whose value MUST be an integer specifying the -pixel value for that label. It MAY contain an `rgba` key whose value MUST be an tuple +pixel value for that label. It MAY contain an `rgba` key whose value MUST be an array of four integers between 0 and 255 `[uint8, uint8, uint8, uint8]` specifying the label color as RGBA. All the values under the `label-value` key MUST be unique. Clients who choose to not throw an error SHOULD ignore all except the _last_ entry. diff --git a/latest/schemas/image-label.schema b/latest/schemas/image-label.schema index 880264e0..0c01c114 100644 --- a/latest/schemas/image-label.schema +++ b/latest/schemas/image-label.schema @@ -19,7 +19,7 @@ "type": "number" }, "rgba": { - "description": "The color stored as an RGBA unsigned-int 4-tuple", + "description": "The RGBA color stored as an array of four integers between 0 and 255", "type": "array", "items": { "type": "integer", From aac0de4cc2c3a3d61b0bb2cf160618cefe349a82 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 5 Jul 2022 13:52:49 +0100 Subject: [PATCH 13/15] Simplify name of 0.4 schemas for image-label specification --- .../{image-label_strict => label_strict}/.config.json | 0 .../colors_properties.json | 0 0.4/index.bs | 2 +- 0.4/schemas/{image-label.schema => label.schema} | 4 ++-- .../{strict_image-label.schema => strict_label.schema} | 4 ++-- 0.4/tests/{image-label_suite.json => label_suite.json} | 2 +- ...{strict_image-label_suite.json => strict_label_suite.json} | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename 0.4/examples/{image-label_strict => label_strict}/.config.json (100%) rename 0.4/examples/{image-label_strict => label_strict}/colors_properties.json (100%) rename 0.4/schemas/{image-label.schema => label.schema} (94%) rename 0.4/schemas/{strict_image-label.schema => strict_label.schema} (54%) rename 0.4/tests/{image-label_suite.json => label_suite.json} (98%) rename 0.4/tests/{strict_image-label_suite.json => strict_label_suite.json} (92%) diff --git a/0.4/examples/image-label_strict/.config.json b/0.4/examples/label_strict/.config.json similarity index 100% rename from 0.4/examples/image-label_strict/.config.json rename to 0.4/examples/label_strict/.config.json diff --git a/0.4/examples/image-label_strict/colors_properties.json b/0.4/examples/label_strict/colors_properties.json similarity index 100% rename from 0.4/examples/image-label_strict/colors_properties.json rename to 0.4/examples/label_strict/colors_properties.json diff --git a/0.4/index.bs b/0.4/index.bs index bdc6f8e7..18a6656f 100644 --- a/0.4/index.bs +++ b/0.4/index.bs @@ -403,7 +403,7 @@ The `image-label` dictionary SHOULD contain a `version` key whose value MUST be specifying the version of the image-label specification.
-path: examples/image-label_strict/colors_properties.json
+path: examples/label_strict/colors_properties.json
 highlight: json
 
diff --git a/0.4/schemas/image-label.schema b/0.4/schemas/label.schema similarity index 94% rename from 0.4/schemas/image-label.schema rename to 0.4/schemas/label.schema index cceb2820..1629d0f9 100644 --- a/0.4/schemas/image-label.schema +++ b/0.4/schemas/label.schema @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", - "title": "OME-NGFF image-label schema", + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/label.schema", + "title": "OME-NGFF labelled image schema", "description": "JSON from OME-NGFF .zattrs", "type": "object", "properties": { diff --git a/0.4/schemas/strict_image-label.schema b/0.4/schemas/strict_label.schema similarity index 54% rename from 0.4/schemas/strict_image-label.schema rename to 0.4/schemas/strict_label.schema index afa63aef..af9090da 100644 --- a/0.4/schemas/strict_image-label.schema +++ b/0.4/schemas/strict_label.schema @@ -1,8 +1,8 @@ { - "$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_image-label.schema", + "$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_label.schema", "allOf": [ { - "$ref": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema" + "$ref": "https://ngff.openmicroscopy.org/0.4/schemas/label.schema" }, { "properties": { diff --git a/0.4/tests/image-label_suite.json b/0.4/tests/label_suite.json similarity index 98% rename from 0.4/tests/image-label_suite.json rename to 0.4/tests/label_suite.json index 27dacc41..634225c8 100644 --- a/0.4/tests/image-label_suite.json +++ b/0.4/tests/label_suite.json @@ -1,7 +1,7 @@ { "description": "Tests for the image-label JSON schema", "schema": { - "id": "schemas/image-label.schema" + "id": "schemas/label.schema" }, "tests": [ { diff --git a/0.4/tests/strict_image-label_suite.json b/0.4/tests/strict_label_suite.json similarity index 92% rename from 0.4/tests/strict_image-label_suite.json rename to 0.4/tests/strict_label_suite.json index 5eaeeaf3..a4ccf01d 100644 --- a/0.4/tests/strict_image-label_suite.json +++ b/0.4/tests/strict_label_suite.json @@ -1,7 +1,7 @@ { "description": "Tests for the strict image-label JSON schema", "schema": { - "id": "schemas/strict_image-label.schema" + "id": "schemas/strict_label.schema" }, "tests": [ { From e4aec89632023d046dd03427dea084fdd31686e6 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 5 Jul 2022 13:55:16 +0100 Subject: [PATCH 14/15] Fix examples configuration file --- 0.4/examples/label_strict/.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0.4/examples/label_strict/.config.json b/0.4/examples/label_strict/.config.json index 3ffdb606..e7329dc9 100644 --- a/0.4/examples/label_strict/.config.json +++ b/0.4/examples/label_strict/.config.json @@ -1,3 +1,3 @@ { - "schema": "schemas/strict_image-label.schema" + "schema": "schemas/strict_label.schema" } From e769766f99954df3914190b249f9630854a89546 Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 5 Jul 2022 13:58:39 +0100 Subject: [PATCH 15/15] Simplify name of latest schemas for image-label specification --- latest/examples/image-label_strict/.config.json | 3 --- latest/examples/label_strict/.config.json | 3 +++ .../colors_properties.json | 0 latest/index.bs | 2 +- latest/schemas/{image-label.schema => label.schema} | 4 ++-- .../{strict_image-label.schema => strict_label.schema} | 4 ++-- latest/tests/{image-label_suite.json => label_suite.json} | 2 +- ...{strict_image-label_suite.json => strict_label_suite.json} | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 latest/examples/image-label_strict/.config.json create mode 100644 latest/examples/label_strict/.config.json rename latest/examples/{image-label_strict => label_strict}/colors_properties.json (100%) rename latest/schemas/{image-label.schema => label.schema} (94%) rename latest/schemas/{strict_image-label.schema => strict_label.schema} (54%) rename latest/tests/{image-label_suite.json => label_suite.json} (98%) rename latest/tests/{strict_image-label_suite.json => strict_label_suite.json} (92%) diff --git a/latest/examples/image-label_strict/.config.json b/latest/examples/image-label_strict/.config.json deleted file mode 100644 index 3ffdb606..00000000 --- a/latest/examples/image-label_strict/.config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "schema": "schemas/strict_image-label.schema" -} diff --git a/latest/examples/label_strict/.config.json b/latest/examples/label_strict/.config.json new file mode 100644 index 00000000..e7329dc9 --- /dev/null +++ b/latest/examples/label_strict/.config.json @@ -0,0 +1,3 @@ +{ + "schema": "schemas/strict_label.schema" +} diff --git a/latest/examples/image-label_strict/colors_properties.json b/latest/examples/label_strict/colors_properties.json similarity index 100% rename from latest/examples/image-label_strict/colors_properties.json rename to latest/examples/label_strict/colors_properties.json diff --git a/latest/index.bs b/latest/index.bs index be480f6c..3ed6d7d7 100644 --- a/latest/index.bs +++ b/latest/index.bs @@ -405,7 +405,7 @@ The `image-label` dictionary SHOULD contain a `version` key whose value MUST be specifying the version of the image-label specification.
-path: examples/image-label_strict/colors_properties.json
+path: examples/label_strict/colors_properties.json
 highlight: json
 
diff --git a/latest/schemas/image-label.schema b/latest/schemas/label.schema similarity index 94% rename from latest/schemas/image-label.schema rename to latest/schemas/label.schema index 0c01c114..8b23d577 100644 --- a/latest/schemas/image-label.schema +++ b/latest/schemas/label.schema @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema", - "title": "OME-NGFF image-label schema", + "$id": "https://ngff.openmicroscopy.org/latest/schemas/label.schema", + "title": "OME-NGFF labelled image schema", "description": "JSON from OME-NGFF .zattrs", "type": "object", "properties": { diff --git a/latest/schemas/strict_image-label.schema b/latest/schemas/strict_label.schema similarity index 54% rename from latest/schemas/strict_image-label.schema rename to latest/schemas/strict_label.schema index afa63aef..c52dd51b 100644 --- a/latest/schemas/strict_image-label.schema +++ b/latest/schemas/strict_label.schema @@ -1,8 +1,8 @@ { - "$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_image-label.schema", + "$id": "https://ngff.openmicroscopy.org/latest/schemas/strict_label.schema", "allOf": [ { - "$ref": "https://ngff.openmicroscopy.org/0.4/schemas/image-label.schema" + "$ref": "https://ngff.openmicroscopy.org/latest/schemas/label.schema" }, { "properties": { diff --git a/latest/tests/image-label_suite.json b/latest/tests/label_suite.json similarity index 98% rename from latest/tests/image-label_suite.json rename to latest/tests/label_suite.json index 27dacc41..634225c8 100644 --- a/latest/tests/image-label_suite.json +++ b/latest/tests/label_suite.json @@ -1,7 +1,7 @@ { "description": "Tests for the image-label JSON schema", "schema": { - "id": "schemas/image-label.schema" + "id": "schemas/label.schema" }, "tests": [ { diff --git a/latest/tests/strict_image-label_suite.json b/latest/tests/strict_label_suite.json similarity index 92% rename from latest/tests/strict_image-label_suite.json rename to latest/tests/strict_label_suite.json index 3a877f6f..9fe0cda2 100644 --- a/latest/tests/strict_image-label_suite.json +++ b/latest/tests/strict_label_suite.json @@ -1,7 +1,7 @@ { "description": "Tests for the strict image-label JSON schema", "schema": { - "id": "schemas/strict_image-label.schema" + "id": "schemas/strict_label.schema" }, "tests": [ {