diff --git a/schemas/scene.schema b/schemas/scene.schema index 6c409a85..ee39ed35 100644 --- a/schemas/scene.schema +++ b/schemas/scene.schema @@ -16,37 +16,43 @@ }, "coordinateTransformations": { "$comment": "Merge general coordinate transformations with constraints for scene metadata", - "allOf": [ - { - "$ref": "coordinate_transformations.schema", - "description": "General coordinate transformations defining spatial relationships between coordinate systems" - }, - { - "type": "array", - "items": { - "allOf": [ - { + "type": "array", + "minItems": 1, + "items": { + "allOf": [ + { + "$ref": "coordinate_transformations.schema#/$defs/coordinateTransformation", + "description": "Parameters of any possible transform" + }, + { + "type": "object", + "description": "Transformations between two coordinate systems referenced by name in the same metadata document", + "properties": { + "input": { + "type": "object", "properties": { - "input": { - "allOf": [ - {"$ref": "coordinate_transformations.schema#/$defs/inputOutput"}, - {"required": ["name"]} - ] - }, - "output": { - "allOf": [ - {"$ref": "coordinate_transformations.schema#/$defs/inputOutput"}, - {"required": ["name"]} - ] - } - } + "name": {"type": "string"}, + "path": {"type": "string"} + }, + "required": ["name"], + "additionalProperties": false, + "description": "Must reference a coordinate system defined in the same metadata document (path empty)" + }, + "output": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "path": {"type": "string"} + }, + "required": ["name"], + "additionalProperties": false, + "description": "Must reference a coordinate system defined in the same metadata document (path empty)" } - ] - }, - "description": "Constrained input/output for coordinate transformations in scene metadata" - } - ] - + }, + "required": ["input", "output"] + } + ] + } }, "arrayCoordinateSystem": { "type": "object", diff --git a/tests/attributes/spec/valid/scene/scene.json b/tests/attributes/spec/valid/scene/scene.json new file mode 100644 index 00000000..eae5a2de --- /dev/null +++ b/tests/attributes/spec/valid/scene/scene.json @@ -0,0 +1,71 @@ +{ + "ome": { + "version": "0.6.dev4", + "scene": { + "coordinateTransformations": [ + { + "input": {"path": "4995115_cropped_400_100_400_400_rot10.zarr", "name": "rotated"}, + "output": {"name": "translated_x50"}, + "name": "translate_tile_to_stitched_position", + "type": "translation", + "translation": [ + 0, + 0, + 30.608878192215265, + 11.21775638443053 + ] + }, + { + "input": {"path": "4995115_cropped_700_700_400_400_rot45.zarr", "name": "rotated"}, + "output": {"name": "translated_x50"}, + "name": "translate_tile_to_stitched_position", + "type": "translation", + "translation": [ + 0, + 0, + 91.8266345766458, + 41.8266345766458 + ] + }, + { + "input": {"name": "translated_x50"}, + "output": {"path": "4995115_full.zarr", "name": "physical"}, + "name": "translate_tile_to_stitched_position", + "type": "translation", + "translation": [ + 0, + 0, + 0, + 50 + ] + } + ], + "coordinateSystems": [ + { + "name": "translated_x50", + "axes": [ + { + "name": "c", + "type": "channel" + }, + { + "name": "z", + "type": "space", + "unit": "micrometer" + }, + { + "name": "y", + "type": "space", + "unit": "micrometer" + }, + { + "name": "x", + "type": "space", + "unit": "micrometer" + } + ] + } + ] + } + } +} \ No newline at end of file