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

Blank canvas #262

Open
ziw-liu opened this issue Mar 7, 2025 · 7 comments
Open

Blank canvas #262

ziw-liu opened this issue Mar 7, 2025 · 7 comments

Comments

@ziw-liu
Copy link

ziw-liu commented Mar 7, 2025

I have OME-Zarr v0.4 images that are spec-conformant and can be viewed via napari-ome-zarr, neuroglancer etc. In vizarr, the metadata appear to be parsed, but the canvas is just black. This happens for both local files and HTTP servers.

For example, here's the image below rendered on the neuroglacer example app:

https://neuroglancer-demo.appspot.com/#!{"dimensions":{"t":[1%2C""]%2C"z":[0.00000124%2C"m"]%2C"y":[4.39e-7%2C"m"]%2C"x":[4.39e-7%2C"m"]}%2C"displayDimensions":["z"%2C"y"%2C"x"]%2C"position":[385%2C262%2C401%2C1211]%2C"crossSectionScale":1%2C"projectionScale":2147483648%2C"layers":[{"type":"image"%2C"source":"https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr/|zarr2:"%2C"localDimensions":{"c'":[1%2C""]}%2C"localPosition":[0]%2C"tab":"rendering"%2C"shaderControls":{"normalized":{"range":[0%2C120]%2C"window":[0%2C150]}}%2C"name":"ZSNS001.ome.zarr"}]%2C"selectedLayer":{"visible":true%2C"layer":"ZSNS001.ome.zarr"}%2C"layout":"4panel-alt"}
Image

In the same environment I can get the example astronaut image rendered. What am I doing wrong?

@ziw-liu
Copy link
Author

ziw-liu commented Mar 7, 2025

Also the memory usage does increase, so the images are being read, just not rendered.

@will-moore
Copy link
Collaborator

When I go to https://hms-dbmi.github.io/vizarr/?source=https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr I see CORS errors in the console:

Access to fetch at 'https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr/.zarray' from 
origin 'https://hms-dbmi.github.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on 
the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource 
with CORS disabled. 

validator also reports CORS issues: https://ome.github.io/ome-ngff-validator/?source=https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr

@ziw-liu
Copy link
Author

ziw-liu commented Mar 10, 2025

@will-moore I don't think CORS is the cause of this, since using a local copy also doesn't work.

Separately, the validator seems to be looking for zarr v3 data (indicated by zarr.json), while my dataset is zarr v2 / NGFF v0.4):

Error Loading https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr/zarr.json: Failed due to CORS issues.

@will-moore
Copy link
Collaborator

Both the validator and vizarr will check for zarr v2 and zarr v3 data, so a 404 for zarr.json doesn't mean that it's ONLY looking for zarr v3.

If the validator fails to load the original request (doesn't even respond with a 404), it makes another with no-cors mode and if this "succeeds" (even with a 404) then we assume that the original request failed due to CORS: https://github.com/ome/ome-ngff-validator/blob/27b6022766f576ac9b4136b685b1bb3c539b1976/src/utils.js#L38

So, your original issues is maybe not due to CORS, but CORS issues mean that I can't help to look into the problem.

What does the validator show when you use a local copy (and how are you serving this)?

@will-moore
Copy link
Collaborator

I tried downloading the sample using ome-zarr-py:

$ ome_zarr download https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr

but that died once it had used up all the space on my machine!

However, I was able to view the partially downloaded data with:

$ ome_zarr view ZSNS001.ome.zarr

After opening in vizarr and boosting the contrast levels:

Image

@ziw-liu
Copy link
Author

ziw-liu commented Mar 10, 2025

Sorry about using a large dataset as example. Here's a smaller one (a few GBs):

https://public.czbiohub.org/comp.micro/viscy/VS_datasets/VSCyto3D/test/HEK_H2B_CAAX_PhC_40x_registered.zarr/0/3/000000/

I'm trying to view it in the jupyter notebook (running in Google Colab), and the canvas is also blank.

Using a local copy of this, ome_zarr view shows validation error:

{
  "instancePath": "/multiscales/0/coordinateTransformations/0",
  "schemaPath": "#/$defs/coordinateTransformations/items/oneOf/0/required",
  "keyword": "required",
  "params": {
    "missingProperty": "scale"
  },
  "message": "must have required property 'scale'"
}

{
  "instancePath": "/multiscales/0/coordinateTransformations/0",
  "schemaPath": "#/$defs/coordinateTransformations/items/oneOf/1/required",
  "keyword": "required",
  "params": {
    "missingProperty": "translation"
  },
  "message": "must have required property 'translation'"
}

{
  "instancePath": "/multiscales/0/coordinateTransformations/0",
  "schemaPath": "#/$defs/coordinateTransformations/items/oneOf",
  "keyword": "oneOf",
  "params": {
    "passingSchemas": null
  },
  "message": "must match exactly one schema in oneOf"
}

Here the multiscale has an identity transform and the scale is set for the image:

            "coordinateTransformations": [
                {
                    "type": "identity"
                }
            ]

This is valid per spec text, but fails due to a bug in the schema for which the fix has been delayed for years: ome/ngff#152

@will-moore
Copy link
Collaborator

Have you tried adjusting the rendering settings in vizarr? The channel slider fused in the screenshot above. In my screenshot, both the slider handles are moved to the left end of the slider.
In your screenshot they are unmoved (at either ends of the slider).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants