generated from w3c-ccg/markdown-to-spec
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from sbesson/image-label_spec
image-label: JSON schemas and clarifications
- Loading branch information
Showing
14 changed files
with
626 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"schema": "schemas/strict_label.schema" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"image-label": { | ||
"version": "0.4", | ||
"colors": [ | ||
{ | ||
"label-value": 1, | ||
"rgba": [255, 255, 255, 255] | ||
}, | ||
{ | ||
"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": "../../" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/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": { | ||
"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 RGBA color stored as an array of four integers between 0 and 255", | ||
"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" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$id": "https://ngff.openmicroscopy.org/0.4/schemas/strict_label.schema", | ||
"allOf": [ | ||
{ | ||
"$ref": "https://ngff.openmicroscopy.org/0.4/schemas/label.schema" | ||
}, | ||
{ | ||
"properties": { | ||
"image-label": { | ||
"required": [ | ||
"version", | ||
"colors" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{ | ||
"description": "Tests for the image-label JSON schema", | ||
"schema": { | ||
"id": "schemas/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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"description": "Tests for the strict image-label JSON schema", | ||
"schema": { | ||
"id": "schemas/strict_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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"schema": "schemas/strict_label.schema" | ||
} |
Oops, something went wrong.