-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start to modularize coordinate systems and transforms schemas
* reference in image schema
- Loading branch information
Showing
5 changed files
with
394 additions
and
73 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"schema": "schemas/coordinate_transforms.schema" | ||
"schema": "schemas/coordinate_systems_and_transforms.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"schema": "schemas/coordinate_transforms.schema" | ||
"schema": "schemas/coordinate_systems_and_transforms.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,45 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://ngff.openmicroscopy.org/latest/schemas/coordinate_systems_and_transforms.schema", | ||
"title": "NGFF Coordinate Systems and Transforms", | ||
"description": "Coordinate Systems and transforms for OME-NGFF", | ||
"type": "object", | ||
"properties": { | ||
"coordinateSystems": { | ||
"$ref": "coordinate_systems.schema" | ||
}, | ||
"coordinateTransformations": { | ||
"$ref": "coordinate_transformation.schema" | ||
}, | ||
"arrayCoordinateSystem": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Name of coordinate space" | ||
}, | ||
"axes": { | ||
"allOf": [ | ||
{ | ||
"$ref": "axes.schema" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "array" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"axes" | ||
] | ||
} | ||
} | ||
} |
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,343 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://ngff.openmicroscopy.org/latest/schemas/coordinate_transformation.schema", | ||
"title": "NGFF Coordinate Systems and Transforms", | ||
"description": "Coordinate Systems and transforms for OME-NGFF", | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/$defs/coordinateTransformation" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"input": { | ||
"type": "string" | ||
}, | ||
"output": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"input", | ||
"output" | ||
] | ||
} | ||
] | ||
}, | ||
"$defs": { | ||
"path_w_url": { | ||
"description": "Path specification. Schema local solution until https://github.com/ome/ngff/issues/144 is resolved.", | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
"required": [ | ||
"path" | ||
] | ||
}, | ||
"coordinateTransformation": { | ||
"description": "OME-NGFF coordinate transformation.", | ||
"allOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
}, | ||
{ | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/identity" | ||
}, | ||
{ | ||
"$ref": "#/$defs/mapAxis" | ||
}, | ||
{ | ||
"$ref": "#/$defs/scale" | ||
}, | ||
{ | ||
"$ref": "#/$defs/translation" | ||
}, | ||
{ | ||
"$ref": "#/$defs/affine" | ||
}, | ||
{ | ||
"$ref": "#/$defs/rotation" | ||
}, | ||
{ | ||
"$ref": "#/$defs/inverseOf" | ||
}, | ||
{ | ||
"$ref": "#/$defs/bijection" | ||
}, | ||
{ | ||
"$ref": "#/$defs/sequence" | ||
}, | ||
{ | ||
"$ref": "#/$defs/byDimension" | ||
}, | ||
{ | ||
"$ref": "#/$defs/displacements" | ||
}, | ||
{ | ||
"$ref": "#/$defs/coordinates" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"byDimensionTransformation": { | ||
"type": "object", | ||
"description": "Transformation used inside a byDimension transformation", | ||
"allOf": [ | ||
{ "$ref": "#/$defs/coordinateTransformation" }, | ||
{ | ||
"properties": { | ||
"input": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"output": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"required": ["input", "output"] | ||
}, | ||
"identity": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "identity" | ||
} | ||
} | ||
}, | ||
"mapAxis": { | ||
"type": "object", | ||
"description": "Permute axes by name", | ||
"properties": { | ||
"type": { | ||
"const": "mapAxis" | ||
}, | ||
"mapAxis": { | ||
"type": "object", | ||
"patternProperties": { | ||
".*": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"mapAxis" | ||
] | ||
} | ||
}, | ||
"scale": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "scale" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/path_w_url" | ||
}, | ||
{ | ||
"properties": { | ||
"scale": { | ||
"type": "array", | ||
"items": { | ||
"type": "number", | ||
"exclusiveMinimum": 0 | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"scale" | ||
] | ||
} | ||
] | ||
}, | ||
"translation": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "translation" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/path_w_url" | ||
}, | ||
{ | ||
"properties": { | ||
"translation": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"translation" | ||
] | ||
} | ||
] | ||
}, | ||
"mtxFlatOrNested" : { | ||
"type": "array", | ||
"oneOf": [ | ||
{ | ||
"items": { "type": "number" } | ||
}, | ||
{ | ||
"items": { | ||
"type": "array", | ||
"items" : { "type" : "number" } | ||
} | ||
} | ||
] | ||
}, | ||
"affine": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "affine" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/path_w_url" | ||
}, | ||
{ | ||
"properties": { | ||
"affine": { | ||
"$ref": "#/$defs/mtxFlatOrNested" | ||
}, | ||
"required": [ | ||
"affine" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"rotation": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "rotation" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/path_w_url" | ||
}, | ||
{ | ||
"properties": { | ||
"rotation": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"rotation" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"inverseOf": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "inverseOf" | ||
}, | ||
"transformation": { | ||
"$ref": "#/$defs/coordinateTransformation" | ||
} | ||
}, | ||
"required": [ | ||
"transformation" | ||
] | ||
}, | ||
"bijection": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "bijection" | ||
}, | ||
"forward": { | ||
"$ref": "#/$defs/coordinateTransformation" | ||
}, | ||
"inverse": { | ||
"$ref": "#/$defs/coordinateTransformation" | ||
} | ||
}, | ||
"required": [ | ||
"forward", "inverse" | ||
] | ||
}, | ||
"sequence": { | ||
"description": "A sequence of transformations", | ||
"type": "object", | ||
"properties": { | ||
"type": { "const": "sequence" }, | ||
"transformations": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/coordinateTransformation" | ||
} | ||
} | ||
} | ||
}, | ||
"byDimension": { | ||
"type": "object", | ||
"properties": { | ||
"type": { "const": "byDimension" }, | ||
"transformations": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/byDimensionTransformation" | ||
} | ||
} | ||
} | ||
}, | ||
"displacements": { | ||
"type": "object", | ||
"properties": { | ||
"type": { "const": "displacements" } | ||
} | ||
}, | ||
"coordinates": { | ||
"type": "object", | ||
"properties": { | ||
"type": { "const": "coordinates" } | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.