Skip to content

How to specify ZarrSeparator #241

Closed
Closed

Description

@stuarteberg

By default, zarr chunk files use . as the axis separator in their names, e.g. 10.20.30. But in Python, one can use a NestedDirectoryStore to store in a directory tree, effectively using / as the separator, e.g. 10/20/30.

Unfortunately, the metadata in .zarray does not specify which format is used. (This is a known shortcoming of the zarr spec.)

Is there any way to tell neuroglancer which format a zarr array uses? I notice that the source code seems to support both, at least in theory. But I can't figure out how to tell neuroglancer that my zarr array uses the / separator in chunk names instead of the default . separator. Is there a way to do it?

Activity

  1. stuarteberg commented on Sep 7, 2020

    @stuarteberg
    ContributorAuthor

    Thanks very much for your reply. Sorry if I'm being dense, but I'm still confused. I'm trying to open the volume in neuroglancer. I can use either zarr or tensorstore to create the array on disk, but either way, the key_encoding setting is not stored in the metadata on disk, as far as I can tell.

    Is there a way to somehow provide a tensorstore-style JSON volume configuration to neuroglancer? So far, I'm just providing a source in the form of zarr://http://localhost:9000/path/to/myarray.zarr. Are you saying neuroglancer also accepts tensorstore JSON data in that text control?

    Again, sorry if that's a dumb question. I'm clearly missing something here.

  2. reopened this on Sep 7, 2020
  3. jbms commented on Sep 7, 2020

    @jbms
    Collaborator

    Oh sorry, I didn't notice that you opened this issue on neuroglancer rather than tensorstore. Indeed, there is not at the moment support for specifying the separator. If you want to add support, I'd suggest making it a query string parameter, like

    zarr://http://localhost:9000/path/to/myarray.zarr?separator=/

  4. joshmoore commented on Feb 24, 2021

    @joshmoore
    Contributor

    I will be looking at a PR for zarr-python at least which will use one of a small number of options for finding the key. Work on the Java side has taken place in bcdev/jzarr#17:

    • heuristic that loops through chunks "0.0.0", "0/0/0", "0.0.1", "0/0/1" searching for existence... (with the downside being the overheaded of the search if no key_separator was chosen)
    • uses optional metadata in the .zarray (with the downside that we need to agree on this metadata)
    • ...
  5. added a commit that references this issue on Apr 16, 2021
    61f5f77
  6. added a commit that references this issue on Apr 30, 2021
    2ff8d53
  7. added a commit that references this issue on Feb 3, 2024
    6b2111e
  8. added a commit that references this issue on Jan 24, 2025
    809a719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions