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

Allow any filepath that *contains* zarr #58

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

will-moore
Copy link
Member

Currently, file paths recognised by napari-ome-zarr must end in .zarr or .zarr/.
However, this doesn't support viewing of HCS Wells or Images.

As suggested by DragaDoncila at #55 (comment), this PR allows the path to contain .zarr at any point

To test, open a Well and Image from a Plate. NB: opening the plate itself .zarr/ still works:

# Well (screenshot)
$ napari --plugin napari-ome-zarr https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/7825.zarr/A/1/

# Image:
$ napari --plugin napari-ome-zarr https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/7825.zarr/A/1/0/

# Plate:
$ napari --plugin napari-ome-zarr https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/7825.zarr/

Without this PR, opening an unrecognised path as above gave:

  File "/Users/wmoore/opt/anaconda3/envs/napari-env/lib/python3.9/site-packages/napari/plugins/io.py", line 86, in read_data_with_plugins
    raise ValueError(
ValueError: There is no registered plugin named 'napari-ome-zarr'.
Names of plugins offering readers are: {'ome-types', 'builtins'}

Screenshot 2022-06-30 at 17 23 51

cc @sbesson

@joshmoore
Copy link
Member

Interesting!

As a side note, there was some discussion yesterday during the Zarr community call about making /.zarr\// the definitive definition of where the root of a fileset is in V3, but there were other proposals as well.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the former investigation in #42 (comment).

In terms of implementation, I assume both patterns could also be combined a single *.zarr* or kept separate or clarity.

I think this applies more widely than the HCS use cases as nested image labels or images in the new bioformats2rawlayout will benefit from it. More generically this should allow to point the napari command to any leaf under a top-level .zarr root node as long implements an OME-NGFF specification supported by this plugin.

@sbesson sbesson requested a review from joshmoore July 1, 2022 08:36
@will-moore
Copy link
Member Author

I have a marginal preference for keeping *.zarr for clarity - and I like a 1-character PR!
But no strong preference.

Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, guys. I assume we may be editing these few lines a bit more in the coming weeks, so 👍 for giving @will-moore his one char change ;)

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 this pull request may close these issues.

3 participants