scalableminds / webknossos

Visualize, share and annotate your large 3D images online
https://webknossos.org
GNU Affero General Public License v3.0
124 stars 22 forks source link

OME NGFF coordinateTransformations translate #6600

Open will-moore opened 1 year ago

will-moore commented 1 year ago

Context

Tried importing OME NGFF sample at https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr This has a 'translation' in the datasets coordinateTransformations:

"datasets": [
                {
                    "coordinateTransformations": [
                        {
                            "scale": [
                                1.0,
                                1.0,
                                0.4,
                                0.108335,
                                0.108335
                            ],
                            "type": "scale"
                        },
                        {
                            "translation": [
                                0,
                                0,
                                1.2,
                                52.109135,
                                60.88427
                            ],
                            "type": "translation"
                        }
                    ],
                    "path": "0"
                },

Expected Behavior

The image should at least be viewable. Ideally, the translation should also be applied, to offset the image with respect to other images in the same coordinate system

Current Behavior

Fails to import. It seems that each coordinateTransformations item is expected to have a scale attribute:

Trying to explore https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr as OME NGFF Zarr v0.4...
Error when reading https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr as OME NGFF Zarr v0.4: Failed to read OME NGFF header at https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr/.zattrs <~ Failed to validate json against data schema <~ Validating Json Failed: {"obj.multiscales[0].datasets[0].coordinateTransformations[1].scale":[{"msg":["error.path.missing"],"args":[]}],"obj.multiscales[0].datasets[1].coordinateTransformations[1].scale":[{"msg":["error.path.missing"],"args":[]}],"obj.multiscales[0].datasets[2].coordinateTransformations[1].scale":[{"msg":["error.path.missing"],"args":[]}]}

Steps to Reproduce the bug

Try to import the image above

Your Environment for bug

fm3 commented 1 year ago

Thanks for the report! I can reproduce the behavior you describe.

I suggest we use this issue to track the actual support of using the translations in webKnossos. This is still blocked by internal discussions concerning our dataset coordinate systems and may take some time.

I created a second issue #6607 for only the “should at least be viewable” part, which should be pretty easy to solve.

MichaelBuessemeyer commented 1 month ago

For reference when this issue is scheduled in a sprint: Here is a very short discussion on this topic: https://scm.slack.com/archives/C5AKLAV0B/p1723014010079719