Skip to content

Commit

Permalink
Merge pull request #69 from will-moore/salad
Browse files Browse the repository at this point in the history
NGFF json validation
  • Loading branch information
sbesson authored Nov 26, 2021
2 parents 3ec8d61 + dd312a8 commit 37a4238
Show file tree
Hide file tree
Showing 27 changed files with 1,272 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validation
on:
push:
pull_request:

jobs:

validate:
name: Validation
strategy:
matrix:
ngff:
- '0.3'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: python -mpip install --upgrade wheel tox
- run: cd ${{matrix.ngff}} && tox
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"ct"
]
}
]
}
20 changes: 20 additions & 0 deletions 0.3/examples/invalid/invalid_axes_count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"y"
]
}
]
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_axes_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"y",
"t",
"c"
]
}
]
}
36 changes: 36 additions & 0 deletions 0.3/examples/invalid/invalid_channels_color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
],
"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
}
}
]
}
}
36 changes: 36 additions & 0 deletions 0.3/examples/invalid/invalid_channels_window.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
],
"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
}
}
]
}
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
},
{
"path": 0
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
14 changes: 14 additions & 0 deletions 0.3/examples/invalid/missing_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
]
}
]
}
14 changes: 14 additions & 0 deletions 0.3/examples/invalid/missing_datasets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"axes": [
"z",
"y",
"x"
]
}
]
}
33 changes: 33 additions & 0 deletions 0.3/examples/invalid/missing_name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"datasets": [
{
"path": "path/to/0"
},
{
"path": 0
}
],
"type": "gaussian",
"metadata": {
"method": "skimage.transform.pyramid_gaussian",
"version": "0.16.1",
"args": [
"true",
"false"
],
"kwargs": {
"multichannel": true
}
},
"axes": [
"z",
"y",
"x"
]
}
]
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/missing_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"foo": "path/to/0"
},
{
"path": "1"
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
18 changes: 18 additions & 0 deletions 0.3/examples/invalid/missing_version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
15 changes: 15 additions & 0 deletions 0.3/examples/invalid/no_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": []
}
]
}
15 changes: 15 additions & 0 deletions 0.3/examples/invalid/no_datasets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [],
"axes": [
"z",
"y",
"x"
]
}
]
}
4 changes: 4 additions & 0 deletions 0.3/examples/invalid/no_multiscales.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"@type": "ngff:Image",
"multiscales": []
}
17 changes: 17 additions & 0 deletions 0.3/examples/valid/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{"path": "path/to/0"},
{"path": "1"},
{"path": "2"}
],
"axes": [
"z", "y", "x"
]
}
]
}
33 changes: 33 additions & 0 deletions 0.3/examples/valid/image_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"@id": "top",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "inner",
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"type": "gaussian",
"metadata": {
"method": "skimage.transform.pyramid_gaussian",
"version": "0.16.1",
"args": [
"true",
"false"
],
"kwargs": {
"multichannel": true
}
},
"axes": [
"z",
"y",
"x"
]
}
]
}
Loading

0 comments on commit 37a4238

Please sign in to comment.