diff --git a/latest/schemas/image.schema b/latest/schemas/image.schema index cff2114b..7cd4293f 100644 --- a/latest/schemas/image.schema +++ b/latest/schemas/image.schema @@ -1,348 +1,194 @@ { - "$defs": { - "Axis": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Type" - }, - "unit": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Unit" - } - }, - "required": [ - "name" - ], - "title": "Axis", - "type": "object" - }, - "Dataset": { - "properties": { - "path": { - "title": "Path", - "type": "string" - }, - "coordinateTransformations": { - "anyOf": [ - { - "maxItems": 1, - "minItems": 1, - "prefixItems": [ - { - "$ref": "#/$defs/ScaleTransform" - } - ], - "type": "array" - }, - { - "maxItems": 2, - "minItems": 2, - "prefixItems": [ - { - "$ref": "#/$defs/ScaleTransform" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ngff.openmicroscopy.org/latest/schemas/image.schema", + "title": "NGFF Image", + "description": "JSON from OME-NGFF .zattrs", + "type": "object", + "properties": { + "multiscales": { + "description": "The multiscale datasets for this image", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "datasets": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" }, - { - "$ref": "#/$defs/TranslationTransform" + "coordinateTransformations": { + "$ref": "#/$defs/coordinateTransformations" } - ], - "type": "array" + }, + "required": ["path", "coordinateTransformations"] } - ], - "title": "Coordinatetransformations" - } - }, - "required": [ - "path", - "coordinateTransformations" - ], - "title": "Dataset", - "type": "object" - }, - "Multiscale": { - "description": "The multiscale datasets for this image", - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "datasets": { - "items": { - "$ref": "#/$defs/Dataset" }, - "minItems": 1, - "title": "Datasets", - "type": "array" - }, - "axes": { - "items": { - "$ref": "#/$defs/Axis" + "version": { + "type": "string", + "enum": [ + "0.5-dev" + ] }, - "minItems": 1, - "title": "Axes", - "type": "array", - "uniqueItems": true - }, - "coordinateTransformations": { - "anyOf": [ - { - "maxItems": 1, - "minItems": 1, - "prefixItems": [ - { - "$ref": "#/$defs/ScaleTransform" - } - ], - "type": "array" - }, - { - "maxItems": 2, - "minItems": 2, - "prefixItems": [ - { - "$ref": "#/$defs/ScaleTransform" - }, - { - "$ref": "#/$defs/TranslationTransform" + "axes": { + "$ref": "#/$defs/axes" + }, + "coordinateTransformations": { + "$ref": "#/$defs/coordinateTransformations" } - ], - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Coordinatetransformations" }, - "version": { - "const": "0.5-dev", - "enum": [ - "0.5-dev" - ], - "title": "Version", - "type": "string" - } + "required": [ + "datasets", "axes", "version" + ] }, - "required": [ - "datasets", - "axes", - "version" - ], - "title": "Multiscale", - "type": "object" + "minItems": 1, + "uniqueItems": true }, - "Omero": { + "omero": { + "type": "object", "properties": { "channels": { + "type": "array", "items": { - "$ref": "#/$defs/OmeroRenderingSettings" - }, - "title": "Channels", - "type": "array" - }, - "rdefs": { - "$ref": "#/$defs/OmeroRdef" - } - }, - "required": [ - "channels", - "rdefs" - ], - "title": "Omero", - "type": "object" - }, - "OmeroRdef": { - "properties": { - "defaultT": { - "title": "Defaultt", - "type": "integer" - }, - "defaultZ": { - "title": "Defaultz", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string" - } - }, - "required": [ - "defaultT", - "defaultZ", - "model" - ], - "title": "OmeroRdef", - "type": "object" - }, - "OmeroRenderingSettings": { - "properties": { - "window": { - "$ref": "#/$defs/Window" - }, - "label": { - "title": "Label", - "type": "string" - }, - "family": { - "title": "Family", - "type": "string" - }, - "color": { - "title": "Color", - "type": "string" - }, - "active": { - "title": "Active", - "type": "boolean" + "type": "object", + "properties": { + "window": { + "type": "object", + "properties": { + "end": { + "type": "number" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + }, + "start": { + "type": "number" + } + }, + "required": [ + "start", + "min", + "end", + "max" + ] + }, + "label": { + "type": "string" + }, + "family": { + "type": "string" + }, + "color": { + "type": "string" + }, + "active": { + "type": "boolean" + } + } + } } }, "required": [ - "window", - "label", - "family", - "color", - "active" - ], - "title": "OmeroRenderingSettings", - "type": "object" - }, - "ScaleTransform": { - "properties": { - "type": { - "const": "scale", - "enum": [ - "scale" - ], - "title": "Type", - "type": "string" - }, - "scale": { - "items": { - "type": "number" + "channels" + ] + } + }, + "required": [ "multiscales" ], + + "$defs": { + "axes": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "minItems": 1, - "title": "Scale", - "type": "array" - } - }, - "required": [ - "type", - "scale" - ], - "title": "ScaleTransform", - "type": "object" - }, - "TranslationTransform": { - "properties": { - "type": { - "const": "translation", - "enum": [ - "translation" - ], - "title": "Type", - "type": "string" - }, - "translation": { - "items": { - "type": "number" + "type": { + "type": "string", }, - "minItems": 1, - "title": "Translation", - "type": "array" - } + "unit": { + "type": "string" + } + }, + "required": ["name", "type"] }, - "required": [ - "type", - "translation" - ], - "title": "TranslationTransform", - "type": "object" }, - "Window": { - "properties": { - "start": { - "title": "Start", - "type": "number" - }, - "end": { - "title": "End", - "type": "number" - }, - "min": { - "title": "Min", - "type": "number" - }, - "max": { - "title": "Max", - "type": "number" + "coordinateTransformations": { + "type": "array", + "minItems": 1, + "contains": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "scale" + ] + }, + "scale": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } } }, - "required": [ - "start", - "end", - "min", - "max" - ], - "title": "Window", - "type": "object" - } - }, - "description": "JSON from OME-NGFF .zattrs", - "properties": { - "multiscales": { + "maxContains": 1, "items": { - "$ref": "#/$defs/Multiscale" - }, - "minItems": 1, - "title": "Multiscales", - "type": "array" - }, - "omero": { - "anyOf": [ - { - "$ref": "#/$defs/Omero" - }, - { - "type": "null" - } - ], - "default": null + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "scale" + ] + }, + "scale": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "required": ["type", "scale"] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "translation" + ] + }, + "translation": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "required": ["type", "translation"] + } + ] + } } - }, - "required": [ - "multiscales" - ], - "title": "NGFF Image", - "type": "object", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ngff.openmicroscopy.org/latest/schemas/image.schema" + } }