ome / ome-ngff-validator

Web page for validating OME-NGFF files
https://ome.github.io/ome-ngff-validator
BSD 2-Clause "Simplified" License
4 stars 3 forks source link

Transforms support #32

Closed will-moore closed 3 months ago

will-moore commented 7 months ago

Adding support for https://github.com/ome/ngff/pull/138

Since that PR isn't merged yet, we need custom URL for loading schemas from that branch.

This PR build is deployed at https://deploy-preview-32--ome-ngff-validator.netlify.app - but I don't know of good sample data to test with.

To test a sample file containing various example snippets from the PR above see https://deploy-preview-32--ome-ngff-validator.netlify.app/?source=https://minio-dev.openmicroscopy.org/idr/v0.5/idr0050/4995115.zarr

NB: this is valid according to the proposed schemas, but won't make any sense to a viewer client.

I'm not loading some schemas, such as coordinate_systems_and_transforms.schema and coordinateTransformations.schema. I'm don't see that they are needed by any validation yet, but I've not tried much. Also the strict schemas aren't used (same as before).

netlify[bot] commented 7 months ago

Deploy Preview for ome-ngff-validator ready!

Name Link
Latest commit 2408246e2256cb90e0e6ba2e2449ceafee9319c5
Latest deploy log https://app.netlify.com/sites/ome-ngff-validator/deploys/65c25dd7e7511a00088ef8b0
Deploy Preview https://deploy-preview-32--ome-ngff-validator.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

will-moore commented 7 months ago

cc @joshmoore - know any good samples for testing?

joshmoore commented 7 months ago

I'd probably start from https://github.com/scverse/spatialdata-notebooks/tree/main/notebooks/developers_resources/storage_format

cc: @LucaMarconato

LucaMarconato commented 7 months ago

Thanks @joshmoore for tagging. Unfortunately the datasets linked could be some good starting points (and especially the code to generate variations of them), but they don't agree 100% to the current specs. As discussed here: https://github.com/scverse/spatialdata/issues/35 we wanted to wait until the transformation PR got merged, but unfortunately it didn't happen.

will-moore commented 7 months ago

Testing a bunch of invalid sample files, validation is working but I find the errors can be a bit verbose. E.g. "affine": [[1, 2, 3, 4], [5, 6, 7, 8, 9], 1], gives me 21 Errors!

Screenshot 2024-02-07 at 13 07 46

The useful ones are:

{
  "instancePath": "/multiscales/0/coordinateTransformations/0/affine/0",
  "schemaPath": "#/$defs/mtxFlatOrNested/oneOf/0/items/type",
  "keyword": "type",
  "params": {
    "type": "number"
  },
  "message": "must be number"
}
{
  "instancePath": "/multiscales/0/coordinateTransformations/0/affine/2",
  "schemaPath": "#/$defs/mtxFlatOrNested/oneOf/1/items/type",
  "keyword": "type",
  "params": {
    "type": "array"
  },
  "message": "must be array"
}
will-moore commented 7 months ago

I tried adding an invalid arrayCoordinateSystem block (without axes element) but this doesn't fail validation

{
"multiscales": [
      {
          "version": "0.5-dev",
          "name": "example",
          "arrayCoordinateSystem" : {
            "name" : "myDataArray",
            "missing_axes" : []
          },

The schema that contains arrayCoordinateSystem spec is coordinate_systems_and_transforms.schema but that schema isn't referenced by the image.schema or any other schemas that I can see, so I haven't loaded it in this PR.

joshmoore commented 6 months ago

LucaMarconato commented 2 weeks ago https://github.com/scverse/spatialdata/issues/35 we wanted to wait until the transformation PR got merged...

cc: @bogovicj but I think, @LucaMarconato, that it would now be a good time to tackle this.

joshmoore commented 3 months ago

@will-moore: I've updated the title to be "Transforms supports" rather than v0.5. I leave it up to you whether to change the usages internally or if we just close for the moment.

will-moore commented 3 months ago

I'll close for now, thx