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

sharding codec bytes configuration block #25

Closed
will-moore opened this issue Aug 7, 2024 · 5 comments · Fixed by manzt/zarrita.js#199
Closed

sharding codec bytes configuration block #25

will-moore opened this issue Aug 7, 2024 · 5 comments · Fixed by manzt/zarrita.js#199

Comments

@will-moore
Copy link
Member

will-moore commented Aug 7, 2024

The zarr.json I get from running ome2024-ngff-challenge is missing a configuration section from the bytes codec within the sharding codec, and this prevents it from being viewed in vizarr, giving errors:

TypeError: Cannot read properties of undefined (reading 'endian')

I noticed that this IS found in the sample at https://deploy-preview-36--ome-ngff-validator.netlify.app/?source=https://uk1s3.embassy.ebi.ac.uk/idr/share/ome2024-ngff-challenge/0.0.5/6001240.zarr

It's also found in the spec at https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/codecs/sharding-indexed/v1.0.rst#configuration-parameters

Manually adding this in as follows allows the data to be viewed in vizarr:

{
  "chunk_grid": {
    "configuration": { "chunk_shape": [1, 1, 1, 1024, 1024] },
    "name": "regular"
  },
  "chunk_key_encoding": { "name": "default" },
  "codecs": [
    {
      "configuration": {
        "chunk_shape": [1, 1, 1, 256, 256],
        "codecs": [
          {
            "name": "bytes",
+           "configuration": {
+            "endian": "little"
+            }
          },
          {
            "configuration": {
              "blocksize": 0,
              "clevel": 5,
              "cname": "zstd",
              "shuffle": "bitshuffle",
              "typesize": 1
            },
            "name": "blosc"
          }
        ],
        "index_codecs": [
          { "configuration": { "endian": "little" }, "name": "bytes" },
          { "name": "crc32c" }
        ]
      },
      "name": "sharding_indexed"
    }
  ],
  "data_type": "uint8",
  "dimension_names": ["t", "c", "z", "y", "x"],
  "fill_value": 0,
  "node_type": "array",
  "shape": [1, 4, 1, 140, 167],
  "zarr_format": 3
}
@will-moore will-moore changed the title Vizarr/zarrita expecting sharding codec bytes configuration block sharding codec bytes configuration block Aug 7, 2024
@LDeakin
Copy link

LDeakin commented Aug 8, 2024

"endian" is only required for multi-byte data types where endianness is applicable, so vizarr is non-conformant in this case.

https://zarr-specs.readthedocs.io/en/latest/v3/codecs/bytes/v1.0.html#configuration-parameters

@will-moore
Copy link
Member Author

Thanks @LDeakin.

Hi @manzt - does this look right to you? Potential issue with zarrita?

I tried to create a sample image to illustrate the issue: I'm not getting the expected error in vizarr but the image still fails to display and applying the change to zarr.json above seems to fix it (becomes viewable)
https://deploy-preview-36--ome-ngff-validator.netlify.app/?source=https://minio-dev.openmicroscopy.org/idr/v0.5/astronaut.zarr

Thanks

@manzt
Copy link

manzt commented Aug 8, 2024

Yeah, this is a bug in zarrita. The issue arises not because endian is missing, but rather because the configuration object is omitted entirely.

@manzt
Copy link

manzt commented Aug 10, 2024

Fix now available, just need to bump in Vizarr.

@will-moore
Copy link
Member Author

Thanks @manzt - Sample image above is now displaying in vizarr at https://hms-dbmi.github.io/vizarr/?source=https://minio-dev.openmicroscopy.org/idr/v0.5/astronaut.zarr
Closing...

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

Successfully merging a pull request may close this issue.

3 participants