Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 0.4 schemas and examples #87

Merged
merged 19 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- '0.1'
- '0.2'
- '0.3'
- '0.4'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down
33 changes: 33 additions & 0 deletions 0.4/examples/invalid/duplicate_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"multiscales": [
{
"axes": [
{
"name": "x",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
]
}
40 changes: 40 additions & 0 deletions 0.4/examples/invalid/duplicate_scale.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
},
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
]
}
25 changes: 25 additions & 0 deletions 0.4/examples/invalid/empty_transformations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": []
}
],
"version": "0.4"
}
]
}
28 changes: 28 additions & 0 deletions 0.4/examples/invalid/invalid_axes_count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
]
}
33 changes: 33 additions & 0 deletions 0.4/examples/invalid/invalid_axis_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "invalid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently a SHOULD, see https://github.com/ome/ngff/blob/main/latest/index.bs#L217. Not sure how exactly we want to tackle this. I will leave a more general comment once I went through everything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this should not fail validation but probably be flagged by the stricter schema. I propose to open a follow-up PR with the infrastructure to differentiate the two of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, re-reading this example, this should remain invalid.

As you rightfully mentioned type is a SHOULD and that is not sufficient ground to fail the strict schema. However there is only one space axe within the multiscales dictionary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you're right. But the name of this example is a bit misleading then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in fact it is failing because type is not space, channel or time rather than only-1-space-axis.
So the schema should allow 1 'invalid' axis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in fact it is failing because type is not space, channel or time rather than only-1-space-axis.
So the schema should allow 1 'invalid' axis.

I am not sure what you mean by this @will-moore. But I agree that this one should fail the strict spec because it has only 1 spatial axis, as @sbesson points out. But I would maybe rename the example to make that clear.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nods, that's probably more tests worth injecting but my understanding of the type restrictions is the following for multiscales.axes:

  • 1 space axes + anything else: invalid
  • 2 (or 3) space axes, 1 channel and/or 1 time: valid
  • 2 (or 3) space axes, 1 channel or 1 time), 1 custom type: valid but failing the strict schema
  • 2 (or 3) space axes, 1 channel or 1 time, 1 unspecified: valid but failing the strict schema
  • 2 (or 3) space axes, 2 customs or 2 unspecified or (1 custom and 1 unspecified): valid but failing the strict schema
  • 4+ space axes + anything else: invalid

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 (or 3) space axes, 1 channel or 1 time, 1 unspecified: valid but failing the strict schema

with 3 spatial axes this would fail because we would have > 5 dim. Same for some of the other examples you bring up.
But otherwise I agree with your list.

Copy link
Member

@sbesson sbesson Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh the or in between 1 channel and 1 time was meant to capture that but I certainly failed to write the different combinations in a concise way. Expanding a bit, all the following set of axes types should be valid according to the minimal schema but should fail the strict schema:

  • 2 space, 1 channel, 1 unspecified
  • 2 space, 1 time, 1 unspecified
  • 3 space, 1 channel, 1 unspecified
  • 3 space, 1 time, 1 unspecified

"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
]
}
48 changes: 48 additions & 0 deletions 0.4/examples/invalid/invalid_channels_color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [1, 1],
"type": "scale"
}
]
}
],
"version": "0.4"
}
],
"omero": {
"channels": [
{
"active": true,
"coefficient": 1.0,
"color": 255,
"family": "linear",
"label": "1234",
"window": {
"end": 1765.0,
"max": 2555.0,
"min": 5.0,
"start": 0.0
}
}
]
}
}

50 changes: 50 additions & 0 deletions 0.4/examples/invalid/invalid_channels_window.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
],
"omero": {
"channels": [
{
"active": true,
"coefficient": 1.0,
"color": "ff0000",
"family": "linear",
"label": "1234",
"window": {
"end": "100",
"max": 2555.0,
"min": 5.0,
"start": 0.0
}
}
]
}
}
39 changes: 39 additions & 0 deletions 0.4/examples/invalid/invalid_multiscales_transformations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"coordinateTransformations": [
{
"scale": ["invalid"],
"type": "scale"
}
],
"version": "0.4"
}
]
}
33 changes: 33 additions & 0 deletions 0.4/examples/invalid/invalid_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": 0,
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "scale"
}
]
}
],
"version": "0.4"
}
]
}
33 changes: 33 additions & 0 deletions 0.4/examples/invalid/invalid_transformation_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"multiscales": [
{
"axes": [
{
"name": "y",
"type": "space",
"units": "micrometer"
},
{
"name": "x",
"type": "space",
"units": "micrometer"
}
],
"datasets": [
{
"path": "0",
"coordinateTransformations": [
{
"scale": [
1,
1
],
"type": "translation"
}
]
}
],
"version": "0.4"
}
]
}
Loading