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

CLI: napari <PATH> fails for some ome.zarr files #37

Closed
constantinpape opened this issue Mar 16, 2022 · 2 comments
Closed

CLI: napari <PATH> fails for some ome.zarr files #37

constantinpape opened this issue Mar 16, 2022 · 2 comments

Comments

@constantinpape
Copy link

constantinpape commented Mar 16, 2022

For me opening the data from https://oc.embl.de/index.php/s/wfpdHpgHseGUTYK fails if I open it via $ napari MMStack_Pos0.ome.zarr. But opening it via drag and drop works. See the full stack trace below.
Note that opening other ome.zarrs works via the CLI, e.g. $ napari https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.3/idr0079A/9836998.zarr, and I also successfully tried with some other files from local disc.

$ napari MMStack_Pos0.ome.zarr
Traceback (most recent call last):
  File "/home/pape/software/conda/miniconda3/envs/napari/bin/napari", line 10, in <module>
    sys.exit(main())
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/__main__.py", line 449, in main
    _run()
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/__main__.py", line 314, in _run
    viewer = view_path(  # noqa: F841
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/view_layers.py", line 178, in view_path
    return _make_viewer_then('open', args, kwargs)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/view_layers.py", line 126, in _make_viewer_then
    method(*args, **kwargs)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 907, in open
    self._add_layers_with_plugins(
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 952, in _add_layers_with_plugins
    layer_data, hookimpl = read_data_with_plugins(
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/io.py", line 61, in read_data_with_plugins
    res = _npe2.read(path, plugin)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/_npe2.py", line 40, in read
    layer_data, reader = read_get_reader(path, plugin_name=plugin)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py", line 44, in read_get_reader
    return _read(path, plugin_name=plugin_name, return_reader=True)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py", line 131, in _read
    layer_data = read_func(path)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/types.py", line 144, in reader_function
    result = func(*args, **kwargs)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/utils/io.py", line 236, in magic_imread
    image, zarr_shape = read_zarr_dataset(filename)
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/utils/io.py", line 328, in read_zarr_dataset
    image.append(read_zarr_dataset(os.path.join(path, subpath))[0])
  File "/home/pape/software/conda/miniconda3/envs/napari/lib/python3.10/site-packages/napari/utils/io.py", line 329, in read_zarr_dataset
    shape = image[0].shape
AttributeError: 'list' object has no attribute 'shape'
@constantinpape
Copy link
Author

This issue still persists after fixing the image-label field. The fixed data is available here:
https://oc.embl.de/index.php/s/zsg7aHyg1R7aFgh

@constantinpape
Copy link
Author

This is fixed now since I have switched fully to https://github.com/ome/ome-zarr-py (which is possible now due to the changes in 0.4.0). So there was probably still some issue with the metadata I wrote with my custom script.

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

1 participant