AllenCellModeling / napari-aicsimageio

Multiple file format reading directly into napari using pure Python
GNU General Public License v3.0
33 stars 9 forks source link

SVS image does not load #74

Closed ihnorton closed 1 year ago

ihnorton commented 1 year ago

Description

OpenSlide sample image from here: https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/JP2K-33003-2.svs

Does not load, long backtrace ending up with the following error:

File ~/opt/conda/envs/imaging/lib/python3.10/site-packages/numpy/core/shape_base.py:426, in stack(arrays=[<class 'imageio.core.util.Array'> (47076, 32671, 3) uint8, <class 'imageio.core.util.Array'> (768, 532, 3) uint8, <class 'imageio.core.util.Array'> (422, 415, 3) uint8, <class 'imageio.core.util.Array'> (421, 1280, 3) uint8], axis=0, out=None)
    424 shapes = {arr.shape for arr in arrays}
    425 if len(shapes) != 1:
--> 426     raise ValueError('all input arrays must have the same shape')
    428 result_ndim = arrays[0].ndim + 1
    429 axis = normalize_axis_index(axis, result_ndim)

ValueError: all input arrays must have the same shape

Expected Behavior

Image is displayed, or give some information about missing X (if applicable?).

Reproduction

Download image, load with File->Open File (or via Open with Plugin)

Environment

napari: 0.4.17
Platform: macOS-12.6-arm64-arm-64bit
System: MacOS 12.6
Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:12:31) [Clang 14.0.6 ]
Qt: 5.15.6
PyQt5: 5.15.7
NumPy: 1.23.1
SciPy: 1.9.1
Dask: 2023.4.0
VisPy: 0.11.0
magicgui: 0.7.2
superqt: unknown
in-n-out: 0.1.7
app-model: 0.1.4
npe2: 0.7.0

OpenGL:
- GL version: 2.1 Metal - 76.3
- MAX_TEXTURE_SIZE: 16384

Screens:
- screen 1: resolution 1728x1117, scale 2.0
evamaxfield commented 1 year ago

Hey! Sorry you are encountering this issue. Your dumped environment list doesn't include any details about what aicsimageio and napari-aicsimageio versions you have installed.

Can you run pip freeze in your terminal and reply with the output?

On Python 3.10.10, with aicsimageio==4.10.0, and napari-aicsimageio==0.7.2 installed I can load the image you provided with base aicsimageio:

from aicsimageio import AICSImage
img = AICSImage("/home/eva/Downloads/JP2K-33003-2.tiff")
print(img.data.shape)  # prints (1, 1, 1, 47076, 32671, 3) after 30 seconds of loading

And in napari I see:

napari-view-of-example-file

Again it takes ~20 - 30 seconds to load.

Let me know!

ihnorton commented 1 year ago

Hi @evamaxfield, thanks for the response! Here's my version details -- looks like the same for aicsimagio and the plugin:

``` aicsimageio==4.10.0 aicspylibczi==3.1.2 aiobotocore==2.5.0 aiohttp==3.8.4 aioitertools==0.11.0 aiosignal==1.3.1 ... napari @ file:///home/conda/feedstock_root/build_artifacts/napari-meta_1668158544277/work napari-aicsimageio==0.7.2 napari-console @ file:///home/conda/feedstock_root/build_artifacts/napari-console_1681022369341/work napari-lazy-openslide==0.3.0 napari-plugin-engine @ file:///home/conda/feedstock_root/build_artifacts/napari-plugin-engine_1637358573066/work napari-svg @ file:///home/conda/feedstock_root/build_artifacts/napari-svg_1672396627338/work napari-tiledb-bioimg @ git+https://github.com/TileDB-Inc/napari-tiledb-bioimg.git@1a3a7873273ff918fb3f8f74679d953b681b90e4 ```

I did install base napari from conda-forge, so I'll try installing everything with pip (I'm on macos m1 and it looks like there's still quite a few packages that need to build from source 🤞 -- will report back).


[edit]: follow-up

Unfortunately it looks like the dependency chain isn't quite there yet on macOS-arm64 -- installing only via pip ends up with an error about missing Qt.

I tried again with a clean conda environment and got a slightly different error. Posting below FWIW. Thanks.

environment: ``` # packages in environment at /Users/inorton/opt/conda/envs/np4: # # Name Version Build Channel aicsimageio 4.10.0 pypi_0 pypi aicspylibczi 3.1.2 pypi_0 pypi aiobotocore 2.5.0 pypi_0 pypi aiohttp 3.8.4 pypi_0 pypi aioitertools 0.11.0 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi alabaster 0.7.13 pyhd8ed1ab_0 conda-forge aom 3.5.0 h7ea286d_0 conda-forge app-model 0.1.4 pyhd8ed1ab_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge appnope 0.1.3 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 hce30654_16_cpu conda-forge asciitree 0.3.3 py_2 conda-forge asttokens 2.2.1 pyhd8ed1ab_0 conda-forge async-timeout 4.0.2 pypi_0 pypi attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h8dc84a0_4 conda-forge aws-c-cal 0.5.21 h9c01cc2_3 conda-forge aws-c-common 0.8.17 hb547adb_0 conda-forge aws-c-compression 0.2.16 h7a7fafa_6 conda-forge aws-c-event-stream 0.2.20 heb79caa_6 conda-forge aws-c-http 0.7.6 h68bc73f_2 conda-forge aws-c-io 0.13.21 h2594004_1 conda-forge aws-c-mqtt 0.8.6 h45e359e_14 conda-forge aws-c-s3 0.2.8 hd05d2e1_2 conda-forge aws-c-sdkutils 0.1.9 h7a7fafa_1 conda-forge aws-checksums 0.1.14 h7a7fafa_6 conda-forge aws-crt-cpp 0.19.9 h1b4e415_3 conda-forge aws-sdk-cpp 1.10.57 hc8901a9_10 conda-forge babel 2.12.1 pyhd8ed1ab_1 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 pyhd8ed1ab_3 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bfio 2.3.0 pypi_0 pypi bioformats-jar 2020.5.27 pypi_0 pypi blosc 1.21.3 h1d6ff8b_0 conda-forge bokeh 3.1.0 pyhd8ed1ab_0 conda-forge botocore 1.29.76 pypi_0 pypi brotli 1.0.9 h1a8c8d9_8 conda-forge brotli-bin 1.0.9 h1a8c8d9_8 conda-forge brotlipy 0.7.0 py310h8e9501a_1005 conda-forge brunsli 0.1 h9f76cd9_0 conda-forge bzip2 1.0.8 h3422bc3_4 conda-forge c-ares 1.18.1 h3422bc3_0 conda-forge c-blosc2 2.8.0 h303ed30_1 conda-forge ca-certificates 2022.12.7 h4653dfc_0 conda-forge cachey 0.2.1 pyh9f0ad1d_0 conda-forge certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py310h2399d43_3 conda-forge cfitsio 4.2.0 h2f961c4_0 conda-forge charls 2.4.1 hb7217d7_0 conda-forge charset-normalizer 3.1.0 pyhd8ed1ab_0 conda-forge click 8.1.3 unix_pyhd8ed1ab_2 conda-forge cloudpickle 2.2.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge comm 0.1.3 pyhd8ed1ab_0 conda-forge contourpy 1.0.7 py310h2887b22_0 conda-forge cryptography 40.0.2 py310hfc83b78_0 conda-forge cytoolz 0.12.0 py310h8e9501a_1 conda-forge dask 2023.4.0 pyhd8ed1ab_0 conda-forge dask-core 2023.4.0 pyhd8ed1ab_0 conda-forge dav1d 1.0.0 he4db4b2_1 conda-forge debugpy 1.6.7 py310h0f1eb42_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge distributed 2023.4.0 pyhd8ed1ab_0 conda-forge dnspython 2.3.0 pypi_0 pypi docstring_parser 0.15 pyhd8ed1ab_0 conda-forge docutils 0.17.1 py310hbe9552e_3 conda-forge elementpath 4.1.1 pypi_0 pypi email-validator 2.0.0.post2 pypi_0 pypi entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 1.2.0 pyhd8ed1ab_0 conda-forge expat 2.5.0 hb7217d7_1 conda-forge fasteners 0.17.3 pyhd8ed1ab_0 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 3.000 h77eed37_0 conda-forge font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.14.2 h82840c6_0 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge freetype 2.12.1 hd633e50_1 conda-forge freetype-py 2.3.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 pypi_0 pypi fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gettext 0.21.1 h0186832_0 conda-forge gflags 2.2.2 hc88da5d_1004 conda-forge giflib 5.2.1 h1a8c8d9_3 conda-forge glib 2.76.2 ha614eb4_0 conda-forge glib-tools 2.76.2 ha614eb4_0 conda-forge glog 0.6.0 h6da1cb0_0 conda-forge gst-plugins-base 1.22.0 h8b7775e_2 conda-forge gstreamer 1.22.0 hcb7b3dd_2 conda-forge heapdict 1.0.1 py_0 conda-forge hsluv 5.0.2 pyh44b312d_0 conda-forge icu 72.1 he12128b_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge imagecodecs 2023.1.23 py310hcb660b6_2 conda-forge imageio 2.28.0 pyh24c5eb1_0 conda-forge imageio-ffmpeg 0.4.8 pypi_0 pypi imagesize 1.4.1 pyhd8ed1ab_0 conda-forge importlib-metadata 6.6.0 pyha770c72_0 conda-forge importlib_metadata 6.6.0 hd8ed1ab_0 conda-forge importlib_resources 5.12.0 pyhd8ed1ab_0 conda-forge in-n-out 0.1.7 pyhd8ed1ab_0 conda-forge ipykernel 6.22.0 pyh736e0ef_0 conda-forge ipython 8.12.0 pyhd1c38e8_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jedi 0.18.2 pyhd8ed1ab_0 conda-forge jgo 1.0.5 pypi_0 pypi jinja2 3.1.2 pyhd8ed1ab_1 conda-forge jmespath 1.0.1 pypi_0 pypi jpype1 1.4.1 pypi_0 pypi jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge jupyter_client 8.2.0 pyhd8ed1ab_0 conda-forge jupyter_core 5.3.0 py310hbe9552e_0 conda-forge jxrlib 1.1 h27ca646_2 conda-forge kiwisolver 1.4.4 py310h2887b22_1 conda-forge krb5 1.20.1 h69eda48_0 conda-forge lazy_loader 0.2 pyhd8ed1ab_0 conda-forge lcms2 2.15 hd835a16_1 conda-forge lerc 4.0.0 h9a09cb3_0 conda-forge libabseil 20230125.0 cxx17_hb7217d7_1 conda-forge libaec 1.0.6 hb7217d7_1 conda-forge libarrow 11.0.0 h9a4fcc8_16_cpu conda-forge libavif 0.11.1 h3d80962_0 conda-forge libblas 3.9.0 16_osxarm64_openblas conda-forge libbrotlicommon 1.0.9 h1a8c8d9_8 conda-forge libbrotlidec 1.0.9 h1a8c8d9_8 conda-forge libbrotlienc 1.0.9 h1a8c8d9_8 conda-forge libcblas 3.9.0 16_osxarm64_openblas conda-forge libclang 14.0.6 default_h81a5282_0 conda-forge libclang13 14.0.6 default_he70ec0d_0 conda-forge libcrc32c 1.1.2 hbdafb3b_0 conda-forge libcurl 8.0.1 heffe338_0 conda-forge libcxx 16.0.2 h4653b0c_0 conda-forge libdeflate 1.18 h1a8c8d9_0 conda-forge libedit 3.1.20191231 hc8eb9b7_2 conda-forge libev 4.33 h642e427_1 conda-forge libevent 2.1.12 h5643135_0 conda-forge libexpat 2.5.0 hb7217d7_1 conda-forge libffi 3.4.2 h3422bc3_5 conda-forge libgfortran 5.0.0 12_2_0_hd922786_31 conda-forge libgfortran5 12.2.0 h0eea778_31 conda-forge libglib 2.76.2 h24e9cb9_0 conda-forge libgoogle-cloud 2.8.0 he22f4c0_2 conda-forge libgrpc 1.54.0 he98ff75_0 conda-forge libiconv 1.17 he4db4b2_0 conda-forge libjpeg-turbo 2.1.5.1 h1a8c8d9_0 conda-forge liblapack 3.9.0 16_osxarm64_openblas conda-forge libllvm14 14.0.6 hf6e71e7_1 conda-forge libnghttp2 1.52.0 hae82a92_0 conda-forge libogg 1.3.4 h27ca646_1 conda-forge libopenblas 0.3.21 openmp_hc731615_3 conda-forge libopus 1.3.1 h27ca646_1 conda-forge libpng 1.6.39 h76d750c_0 conda-forge libpq 15.2 h1a28acd_0 conda-forge libprotobuf 3.21.12 hb5ab8b9_0 conda-forge libsodium 1.0.18 h27ca646_1 conda-forge libsqlite 3.40.0 h76d750c_1 conda-forge libssh2 1.10.0 h7a5bd25_3 conda-forge libthrift 0.18.1 ha061701_1 conda-forge libtiff 4.5.0 h4f7d55c_6 conda-forge libutf8proc 2.8.0 h1a8c8d9_0 conda-forge libvorbis 1.3.7 h9f76cd9_0 conda-forge libwebp-base 1.3.0 h1a8c8d9_0 conda-forge libxcb 1.13 h9b22ae9_1004 conda-forge libzlib 1.2.13 h03a7124_4 conda-forge libzopfli 1.0.3 h9f76cd9_0 conda-forge llvm-openmp 16.0.2 h1c12783_0 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lxml 4.9.2 pypi_0 pypi lz4 4.3.2 py310ha6df754_0 conda-forge lz4-c 1.9.4 hb7217d7_0 conda-forge magicgui 0.7.2 pyhd8ed1ab_0 conda-forge markdown-it-py 2.2.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.2 py310h8e9501a_0 conda-forge matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge mdurl 0.1.0 pyhd8ed1ab_0 conda-forge mrc 0.3.0 pypi_0 pypi msgpack-python 1.0.5 py310h2887b22_0 conda-forge multidict 6.0.4 pypi_0 pypi mypy_extensions 1.0.0 pyha770c72_0 conda-forge mysql-common 8.0.32 h518ea0a_1 conda-forge mysql-libs 8.0.32 hcb599eb_1 conda-forge napari 0.4.17 pyh275ddea_0_pyqt conda-forge napari-aicsimageio 0.7.2 pypi_0 pypi napari-console 0.0.8 pyhd8ed1ab_0 conda-forge napari-plugin-engine 0.2.0 pyhd8ed1ab_2 conda-forge napari-svg 0.1.6 pyhd8ed1ab_1 conda-forge ncurses 6.3 h07bb92c_1 conda-forge nd2 0.5.3 pypi_0 pypi nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge networkx 3.1 pyhd8ed1ab_0 conda-forge npe2 0.7.0 pyhd8ed1ab_0 conda-forge nspr 4.35 hb7217d7_0 conda-forge nss 3.89 h789eff7_0 conda-forge numcodecs 0.11.0 py310h0f1eb42_1 conda-forge numpy 1.24.3 py310haa1e00c_0 conda-forge numpydoc 1.5.0 pyhd8ed1ab_0 conda-forge ome-types 0.3.4 pypi_0 pypi ome-zarr 0.6.1 pypi_0 pypi openjpeg 2.5.0 hbc2ba62_2 conda-forge openssl 3.1.0 h53f4e23_2 conda-forge orc 1.8.3 hef0d403_0 conda-forge packaging 23.1 pyhd8ed1ab_0 conda-forge pandas 2.0.1 py310h1cdf563_0 conda-forge parquet-cpp 1.5.1 2 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge partd 1.4.0 pyhd8ed1ab_0 conda-forge pcre2 10.40 hb34f9b4_0 conda-forge pexpect 4.8.0 pyh1a96a4e_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 8.4.0 pypi_0 pypi pint 0.20.1 pyhd8ed1ab_0 conda-forge pip 23.1.2 pyhd8ed1ab_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 3.5.0 pyhd8ed1ab_0 conda-forge ply 3.11 py_1 conda-forge pooch 1.7.0 pyha770c72_3 conda-forge prompt-toolkit 3.0.38 pyha770c72_0 conda-forge prompt_toolkit 3.0.38 hd8ed1ab_0 conda-forge psutil 5.9.5 py310h8e9501a_0 conda-forge psygnal 0.9.0 pyhd8ed1ab_0 conda-forge pthread-stubs 0.4 h27ca646_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pyarrow 11.0.0 py310h7c67832_16_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydantic 1.10.7 py310h8e9501a_0 conda-forge pygments 2.15.1 pyhd8ed1ab_0 conda-forge pyopengl 3.1.6 pyhd8ed1ab_1 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pyproject_hooks 1.0.0 pyhd8ed1ab_0 conda-forge pyqt 5.15.7 py310h7aaa74b_3 conda-forge pyqt5-sip 12.11.0 py310h0f1eb42_3 conda-forge pyrsistent 0.19.3 py310h8e9501a_0 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge python 3.10.10 h3ba56d0_0_cpython conda-forge python-build 0.10.0 pyhd8ed1ab_0 conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python_abi 3.10 3_cp310 conda-forge pytomlpp 1.0.13 py310h2887b22_0 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pywavelets 1.4.1 py310hf1a086a_0 conda-forge pyyaml 6.0 py310h8e9501a_5 conda-forge pyzmq 25.0.2 py310hc407298_0 conda-forge qt-main 5.15.8 h8c42f20_9 conda-forge qtconsole-base 5.4.1 pyha770c72_0 conda-forge qtpy 2.3.1 pyhd8ed1ab_0 conda-forge re2 2023.02.02 hb7217d7_0 conda-forge readlif 0.6.5 pypi_0 pypi readline 8.2 h92ec313_1 conda-forge requests 2.29.0 pyhd8ed1ab_0 conda-forge resource-backed-dask-array 0.1.0 pypi_0 pypi rich 13.3.5 pyhd8ed1ab_0 conda-forge s3fs 2023.4.0 pypi_0 pypi scikit-image 0.19.3 pypi_0 pypi scipy 1.10.1 py310ha0d8a01_0 conda-forge scyjava 1.9.0 pypi_0 pypi setuptools 67.7.2 pyhd8ed1ab_0 conda-forge shellingham 1.5.1 pyhd8ed1ab_0 conda-forge sip 6.7.9 py310h1253130_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 h17c5cce_0 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sphinx 4.5.0 pyh6c4a22f_0 conda-forge sphinxcontrib-applehelp 1.0.4 pyhd8ed1ab_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.1 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge superqt 0.4.1 pyhd8ed1ab_0 conda-forge tblib 1.7.0 pyhd8ed1ab_0 conda-forge tifffile 2022.4.8 pypi_0 pypi tk 8.6.12 he1e0b03_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge toolz 0.12.0 pyhd8ed1ab_0 conda-forge tornado 6.3 py310h8e9501a_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge traitlets 5.9.0 pyhd8ed1ab_0 conda-forge typer 0.4.2 pyhd8ed1ab_0 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vispy 0.11.0 py310hb614ae6_1 conda-forge wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge wrapt 1.15.0 py310h8e9501a_0 conda-forge wurlitzer 3.0.3 pypi_0 pypi xarray 2023.1.0 pypi_0 pypi xmlschema 2.2.3 pypi_0 pypi xorg-libxau 1.0.9 h27ca646_0 conda-forge xorg-libxdmcp 1.1.3 h27ca646_0 conda-forge xyzservices 2023.2.0 pyhd8ed1ab_0 conda-forge xz 5.2.6 h57fd34a_0 conda-forge yaml 0.2.5 h3422bc3_2 conda-forge yarl 1.9.2 pypi_0 pypi zarr 2.14.2 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 hbdafb3b_1 conda-forge zfp 1.0.0 hb6e4faa_3 conda-forge zict 3.0.0 pyhd8ed1ab_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 h03a7124_4 conda-forge zlib-ng 2.0.7 h1a8c8d9_0 conda-forge zstd 1.5.2 hf913c23_6 conda-forge ``` backtrace: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/components/viewer_model.py:1127, in ViewerModel._open_or_raise_error(self=Viewer(axes=Axes(visible=False, labels=True, col...indings._transform_active_layer at 0x1646fe680>}), paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], kwargs={}, layer_type=None, stack=False) 1126 try: -> 1127 added = self._add_layers_with_plugins( added = [] self = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, size=1, style=), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, color= (4,) float32, ticks=True, position=, font_size=10.0, box=False, box_color= (4,) float32, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float32, font_size=10.0, position=, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=, transform_drag=, transform_final=, transform=, allow_new_selection=True, selected_vertex=None)), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[.mouse_move at 0x16474e680>], mouse_drag_callbacks=[.mouse_drag at 0x16474dab0>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': .hold_to_lock_aspect_ratio at 0x16474e560>, 'Control-Shift-R': , 'Control-Shift-A': }) paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] kwargs = {} stack = False plugin = 'napari-aicsimageio' layer_type = None 1128 paths, 1129 kwargs=kwargs, 1130 stack=stack, 1131 plugin=plugin, 1132 layer_type=layer_type, 1133 ) 1134 # plugin failed File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/components/viewer_model.py:1217, in ViewerModel._add_layers_with_plugins(self=Viewer(axes=Axes(visible=False, labels=True, col...indings._transform_active_layer at 0x1646fe680>}), paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False, kwargs={}, plugin='napari-aicsimageio', layer_type=None) 1216 assert len(paths) == 1 -> 1217 layer_data, hookimpl = read_data_with_plugins( paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] stack = False plugin = 'napari-aicsimageio' 1218 paths, plugin=plugin, stack=stack 1219 ) 1221 # glean layer names from filename. These will be used as *fallback* 1222 # names, if the plugin does not return a name kwarg in their meta dict. File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/plugins/io.py:77, in read_data_with_plugins(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], plugin='napari-aicsimageio', stack=False) 75 hookimpl: Optional[HookImplementation] ---> 77 res = _npe2.read(paths, plugin, stack=stack) paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] plugin = 'napari-aicsimageio' stack = False _npe2 = 78 if res is not None: File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/plugins/_npe2.py:55, in read(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], plugin='napari-aicsimageio', stack=False) 54 try: ---> 55 layer_data, reader = io_utils.read_get_reader( io_utils = npe1_path = '/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs' plugin = 'napari-aicsimageio' 56 npe1_path, plugin_name=plugin 57 ) 58 return layer_data, _FakeHookimpl(reader.plugin_name) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/npe2/io_utils.py:66, in read_get_reader(path='/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs', plugin_name='napari-aicsimageio', stack=None) 65 new_path, new_stack = v1_to_v2(path) ---> 66 return _read( new_path = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] new_stack = False plugin_name = 'napari-aicsimageio' 67 new_path, plugin_name=plugin_name, return_reader=True, stack=new_stack 68 ) 69 else: File ~/opt/conda/envs/np4/lib/python3.10/site-packages/npe2/io_utils.py:165, in _read(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False, plugin_name='napari-aicsimageio', return_reader=True, _pm=) 163 if read_func is not None: 164 # if the reader function raises an exception here, we don't try to catch it --> 165 if layer_data := read_func(paths, stack=stack): paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] read_func = .npe1_compat at 0x168dafa30> stack = False 166 return (layer_data, rdr) if return_reader else layer_data File ~/opt/conda/envs/np4/lib/python3.10/site-packages/npe2/manifest/contributions/_readers.py:60, in ReaderContribution.exec..npe1_compat(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False) 59 path = v2_to_v1(paths, stack) ---> 60 return callable_(path) path = '/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs' callable_ = functools.partial(, in_memory=None) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari_aicsimageio/core.py:256, in reader_function(path='/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs', in_memory=None) 255 else: --> 256 data = _get_full_image_data(img, in_memory=_in_memory) img = _in_memory = True 257 meta = _get_meta(path, data, img) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari_aicsimageio/core.py:44, in _get_full_image_data(img=, in_memory=True) 40 def _get_full_image_data( 41 img: AICSImage, 42 in_memory: bool, 43 ) -> xr.DataArray: ---> 44 if DimensionNames.MosaicTile in img.reader.dims.order: DimensionNames.MosaicTile = 'M' img = 45 try: File ~/opt/conda/envs/np4/lib/python3.10/site-packages/aicsimageio/readers/reader.py:532, in Reader.dims(self=) 531 if self._dims is None: --> 532 self._dims = Dimensions(dims=self.xarray_dask_data.dims, shape=self.shape) self._dims = None self = 534 return self._dims File ~/opt/conda/envs/np4/lib/python3.10/site-packages/aicsimageio/readers/reader.py:359, in Reader.xarray_dask_data(self=) 358 if self._xarray_dask_data is None: --> 359 self._xarray_dask_data = self._read_delayed() self._xarray_dask_data = None self = 361 return self._xarray_dask_data File ~/opt/conda/envs/np4/lib/python3.10/site-packages/aicsimageio/readers/default_reader.py:418, in DefaultReader._read_delayed(self=) 414 with imageio.get_reader( 415 open_resource, format=self.extension, mode=self.imageio_read_mode 416 ) as reader: 417 # Store image length --> 418 image_length = self._get_image_length( self = self._fs = self._path = '/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs' self.extension = 'svs' self.imageio_read_mode = '?' 419 fs=self._fs, 420 path=self._path, 421 extension=self.extension, 422 mode=self.imageio_read_mode, 423 ) 425 # Handle single image formats like png, jpeg, etc File ~/opt/conda/envs/np4/lib/python3.10/site-packages/aicsimageio/readers/default_reader.py:286, in DefaultReader._get_image_length(fs=, path='/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs', extension='svs', mode='?') 285 # Default get_length call for all others --> 286 return reader.get_length() reader = File ~/opt/conda/envs/np4/lib/python3.10/site-packages/imageio/v2.py:138, in LegacyReader.get_length(self=) 137 def get_length(self): --> 138 return self.instance.properties(index=...).n_images self.instance = self = File ~/opt/conda/envs/np4/lib/python3.10/site-packages/imageio/plugins/tifffile_v3.py:376, in TifffilePlugin.properties(self=, index=Ellipsis, page=None) 370 n_series = len(self._fh.series) 371 props = ImageProperties( 372 shape=(n_series, *target_page.shape), 373 dtype=target_page.dtype, 374 n_images=n_series, 375 is_batch=True, --> 376 spacing=_get_resolution(target_page)["resolution"], target_page = n_series = 4 target_page.shape = (47076, 32671, 3) target_page.dtype = dtype('uint8') 377 ) 378 elif index is Ellipsis and page is Ellipsis: KeyError: 'resolution' The above exception was the direct cause of the following exception: ReaderPluginError Traceback (most recent call last) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/qt_viewer.py:830, in QtViewer._qt_open(self=, filenames=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False, choose_plugin=False, plugin=None, layer_type=None, **kwargs={}) 829 try: --> 830 self.viewer.open( self = self.viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, size=1, style=), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, color= (4,) float32, ticks=True, position=, font_size=10.0, box=False, box_color= (4,) float32, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float32, font_size=10.0, position=, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=, transform_drag=, transform_final=, transform=, allow_new_selection=True, selected_vertex=None)), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[.mouse_move at 0x16474e680>], mouse_drag_callbacks=[.mouse_drag at 0x16474dab0>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': .hold_to_lock_aspect_ratio at 0x16474e560>, 'Control-Shift-R': , 'Control-Shift-A': }) filenames = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] stack = False plugin = None layer_type = None kwargs = {} 831 filenames, 832 stack=stack, 833 plugin=plugin, 834 layer_type=layer_type, 835 **kwargs, 836 ) 837 except ReaderPluginError as e: File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/components/viewer_model.py:1024, in ViewerModel.open(self=Viewer(axes=Axes(visible=False, labels=True, col...indings._transform_active_layer at 0x1646fe680>}), path=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False, plugin=None, layer_type=None, **kwargs={}) 1022 # no plugin choice was made 1023 else: -> 1024 layers = self._open_or_raise_error( layers = self = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, size=1, style=), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, color= (4,) float32, ticks=True, position=, font_size=10.0, box=False, box_color= (4,) float32, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float32, font_size=10.0, position=, text=''), overlays=Overlays(interaction_box=InteractionBox(points=None, show=False, show_handle=False, show_vertices=False, selection_box_drag=None, selection_box_final=None, transform_start=, transform_drag=, transform_final=, transform=, allow_new_selection=True, selected_vertex=None)), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True, mouse_move_callbacks=[.mouse_move at 0x16474e680>], mouse_drag_callbacks=[.mouse_drag at 0x16474dab0>], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Shift': .hold_to_lock_aspect_ratio at 0x16474e560>, 'Control-Shift-R': , 'Control-Shift-A': }) _path = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] _stack = False kwargs = {} layer_type = None 1025 _path, kwargs, layer_type, _stack 1026 ) 1027 added.extend(layers) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/components/viewer_model.py:1136, in ViewerModel._open_or_raise_error(self=Viewer(axes=Axes(visible=False, labels=True, col...indings._transform_active_layer at 0x1646fe680>}), paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], kwargs={}, layer_type=None, stack=False) 1135 except Exception as e: -> 1136 raise ReaderPluginError( trans = plugin = 'napari-aicsimageio' paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] 1137 trans._( 1138 'Tried opening with {plugin}, but failed.', 1139 deferred=True, 1140 plugin=plugin, 1141 ), 1142 plugin, 1143 paths, 1144 ) from e 1145 # multiple plugins 1146 else: ReaderPluginError: Tried opening with napari-aicsimageio, but failed. The above exception was the direct cause of the following exception: ReaderPluginError Traceback (most recent call last) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/qt_viewer.py:748, in QtViewer._open_files_dialog(self=, choose_plugin=False) 746 if (filenames != []) and (filenames is not None): 747 for filename in filenames: --> 748 self._qt_open( self = filename = '/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs' [filename] = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] choose_plugin = False 749 [filename], stack=False, choose_plugin=choose_plugin 750 ) 751 update_open_history(filenames[0]) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/qt_viewer.py:838, in QtViewer._qt_open(self=, filenames=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], stack=False, choose_plugin=False, plugin=None, layer_type=None, **kwargs={}) 830 self.viewer.open( 831 filenames, 832 stack=stack, (...) 835 **kwargs, 836 ) 837 except ReaderPluginError as e: --> 838 handle_gui_reading( filenames = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] self = stack = False layer_type = None kwargs = {} 839 filenames, 840 self, 841 stack, 842 e.reader_plugin, 843 e, 844 layer_type=layer_type, 845 **kwargs, 846 ) 847 except MultipleReaderError: 848 handle_gui_reading(filenames, self, stack, **kwargs) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py:188, in handle_gui_reading(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], qt_viewer=, stack=False, plugin_name='napari-aicsimageio', error=ReaderPluginError('Tried opening with napari-aicsimageio, but failed.'), plugin_override=False, **kwargs={'layer_type': None}) 161 """Present reader dialog to choose reader and open paths based on result. 162 163 This function is called whenever ViewerModel._open_or_get_error returns (...) 185 Dictates whether checkbox to remember choice is unchecked by default 186 """ 187 _path = paths[0] --> 188 readers = prepare_remaining_readers(paths, plugin_name, error) paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] plugin_name = 'napari-aicsimageio' error = ReaderPluginError('Tried opening with napari-aicsimageio, but failed.') 189 error_message = str(error) if error else '' 190 readerDialog = QtReaderDialog( 191 parent=qt_viewer, 192 pth=_path, (...) 195 persist_checked=not plugin_override, 196 ) File ~/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py:243, in prepare_remaining_readers(paths=['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'], plugin_name='napari-aicsimageio', error=ReaderPluginError('Tried opening with napari-aicsimageio, but failed.')) 241 # if there's no other readers left, raise the exception 242 if not readers and error: --> 243 raise ReaderPluginError( trans = paths[0] = '/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs' paths = ['/Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs'] len(paths) > 1 = False len(paths) = 1 plugin_name = 'napari-aicsimageio' error = ReaderPluginError('Tried opening with napari-aicsimageio, but failed.') 244 trans._( 245 "Tried to read {path_message} with plugin {plugin}, because it was associated with that file extension/because it is the only plugin capable of reading that path, but it gave an error. Try associating a different plugin or installing a different plugin for this kind of file.", 246 path_message=f"[{paths[0]}, ...]" 247 if len(paths) > 1 248 else paths[0], 249 plugin=plugin_name, 250 ), 251 plugin_name, 252 paths, 253 ) from error 255 return readers ReaderPluginError: Tried to read /Users/inorton/work/scratch/2023/0427-image-compression/JP2K-33003-2.svs with plugin napari-aicsimageio, because it was associated with that file extension/because it is the only plugin capable of reading that path, but it gave an error. Try associating a different plugin or installing a different plugin for this kind of file. ^CTraceback (most recent call last): File "/Users/inorton/opt/conda/envs/np4/bin/napari", line 10, in sys.exit(main()) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/__main__.py", line 561, in main _run() File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/__main__.py", line 390, in _run run(gui_exceptions=True) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/qt_event_loop.py", line 420, in run with notification_manager, _maybe_allow_interrupt(app): File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/contextlib.py", line 142, in __exit__ next(self.gen) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/_qt/utils.py", line 456, in _maybe_allow_interrupt old_sigint_handler(*handler_args) KeyboardInterrupt Traceback (most recent call last): File "/Users/inorton/opt/conda/envs/np4/bin/napari", line 10, in sys.exit(main()) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/__main__.py", line 551, in main _maybe_rerun_with_macos_fixes() File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/site-packages/napari/__main__.py", line 539, in _maybe_rerun_with_macos_fixes result = subprocess.run(cmd, env=env, cwd=cwd) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/subprocess.py", line 505, in run stdout, stderr = process.communicate(input, timeout=timeout) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/subprocess.py", line 1146, in communicate self.wait() File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/subprocess.py", line 1209, in wait return self._wait(timeout=timeout) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/subprocess.py", line 1943, in _wait (pid, sts) = self._try_wait(0) File "/Users/inorton/opt/conda/envs/np4/lib/python3.10/subprocess.py", line 1901, in _try_wait (pid, sts) = os.waitpid(self.pid, wait_flags) KeyboardInterrupt ```

I also tried installing the arm64 napari release bundle, then the plugin via the plugin manager. In that case, importing from aicsimageio import AICSImage fails, I get:

``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) File ~/Library/napari-0.5.0a2.dev63+g64160989/envs/napari-0.5.0a2.dev63+g64160989/lib/python3.9/site-packages/qtconsole/base_frontend_mixin.py:138, in BaseFrontendMixin._dispatch(self=, msg={'buffers': [], 'content': {'execution_count': 1, 'payload': [], 'status': 'ok', 'user_expressions': {}}, 'header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 13, 76992, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}, 'metadata': {'dependencies_met': True, 'engine': '9c2c38e6-4e75-4ba3-a145-03bf2e586bb6', 'started': '2023-04-28T18:11:12.916824Z', 'status': 'ok'}, 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'parent_header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 12, 916034, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_4', 'msg_type': 'execute_request', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}}) 136 handler = getattr(self, '_handle_' + msg_type, None) 137 if handler: --> 138 handler(msg) handler = > msg = {'header': {'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'username': 'inorton', 'session': '289612ba-7c64db1148a2c34a506091cb', 'date': datetime.datetime(2023, 4, 28, 18, 11, 13, 76992, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'parent_header': {'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_4', 'msg_type': 'execute_request', 'username': 'inorton', 'session': '289612ba-7c64db1148a2c34a506091cb', 'date': datetime.datetime(2023, 4, 28, 18, 11, 12, 916034, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {'started': '2023-04-28T18:11:12.916824Z', 'dependencies_met': True, 'engine': '9c2c38e6-4e75-4ba3-a145-03bf2e586bb6', 'status': 'ok'}, 'content': {'status': 'ok', 'execution_count': 1, 'user_expressions': {}, 'payload': []}, 'buffers': []} File ~/Library/napari-0.5.0a2.dev63+g64160989/envs/napari-0.5.0a2.dev63+g64160989/lib/python3.9/site-packages/qtconsole/jupyter_widget.py:193, in JupyterWidget._handle_execute_reply(self=, msg={'buffers': [], 'content': {'execution_count': 1, 'payload': [], 'status': 'ok', 'user_expressions': {}}, 'header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 13, 76992, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}, 'metadata': {'dependencies_met': True, 'engine': '9c2c38e6-4e75-4ba3-a145-03bf2e586bb6', 'started': '2023-04-28T18:11:12.916824Z', 'status': 'ok'}, 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'parent_header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 12, 916034, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_4', 'msg_type': 'execute_request', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}}) 191 self._request_info['execute'].pop(msg_id) 192 else: --> 193 super()._handle_execute_reply(msg) msg = {'header': {'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'username': 'inorton', 'session': '289612ba-7c64db1148a2c34a506091cb', 'date': datetime.datetime(2023, 4, 28, 18, 11, 13, 76992, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'parent_header': {'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_4', 'msg_type': 'execute_request', 'username': 'inorton', 'session': '289612ba-7c64db1148a2c34a506091cb', 'date': datetime.datetime(2023, 4, 28, 18, 11, 12, 916034, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {'started': '2023-04-28T18:11:12.916824Z', 'dependencies_met': True, 'engine': '9c2c38e6-4e75-4ba3-a145-03bf2e586bb6', 'status': 'ok'}, 'content': {'status': 'ok', 'execution_count': 1, 'user_expressions': {}, 'payload': []}, 'buffers': []} File ~/Library/napari-0.5.0a2.dev63+g64160989/envs/napari-0.5.0a2.dev63+g64160989/lib/python3.9/site-packages/qtconsole/frontend_widget.py:468, in FrontendWidget._handle_execute_reply(self=, msg={'buffers': [], 'content': {'execution_count': 1, 'payload': [], 'status': 'ok', 'user_expressions': {}}, 'header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 13, 76992, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}, 'metadata': {'dependencies_met': True, 'engine': '9c2c38e6-4e75-4ba3-a145-03bf2e586bb6', 'started': '2023-04-28T18:11:12.916824Z', 'status': 'ok'}, 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_14', 'msg_type': 'execute_reply', 'parent_header': {'date': datetime.datetime(2023, 4, 28, 18, 11, 12, 916034, tzinfo=tzutc()), 'msg_id': '289612ba-7c64db1148a2c34a506091cb_98325_4', 'msg_type': 'execute_request', 'session': '289612ba-7c64db1148a2c34a506091cb', 'username': 'inorton', 'version': '5.3'}}) 464 return 465 if info.kind == 'user': 466 # Make sure that all output from the SUB channel has been processed 467 # before writing a new prompt. --> 468 if not self.kernel_client.iopub_channel.closed(): self = 469 self.kernel_client.iopub_channel.flush() 471 # Reset the ANSI style information to prevent bad text in stdout 472 # from messing up our colors. We're not a true terminal so we're 473 # allowed to do this. AttributeError: 'QtInProcessChannel' object has no attribute 'closed' ```
evamaxfield commented 1 year ago

I am still a bit confused. The above output is the result of:

conda create --name test-aicsimageio python=3.10 -y
conda activate test-aicsimageio
pip install napari-aicsimageio napari[qt]

?

evamaxfield commented 1 year ago

I guess I should say, napari-aicsimageio doesn't install qt.... maybe we should @psobolewskiPhD because of: https://github.com/AllenCellModeling/napari-aicsimageio/blob/main/napari_aicsimageio/core.py#L12

evamaxfield commented 1 year ago

we have just sort of assumed the user would handle that but that seems like a bad assumption

psobolewskiPhD commented 1 year ago

Sorry I missed this issue! Couple things: first on arm64 macOS, pyside2 and pyqt5 are not available as wheels on pypi. So options are: install napari via conda (qt covered), install just qt backend via conda then napari via pip (without [all]), or rely on experimental support for qt6 via pip.

napari[qt] and napari[all] are both aliases for napari plus pyqt5, so on arm64 those will fail with pip, which remains the default plugin installer inside napari—this is rapidly changing! Also, using either of those will break envs for people who have pyside2, or any of Qt6. So the general idea is for plugins to not depend on either pyside2 or pyqt5 etc, but qtpy and napari. Current napari-aicsimageio behavior is correct in that regard. (One totally differnet issue is the java component for bioformats requires conda install (see https://github.com/AllenCellModeling/napari-aicsimageio/issues/46).)

I tried to test this issue on my M1, arm64 conda-forge, mamba solver. I made a new 3.10 env with just napari (so both napari & Qt backend via conda). Then pip install napari-aicsimageio — this mimics using the plugin installer, which currently uses pip. Note: I did not install JVM, etc. as needed for bioformats (bfio) using conda. As a result, I immediately got a hard crash related to java 😢 So I used napari --reset to ensure nothing was carried over from settings—settings isolation is already fixed in main but not released 😬 Then drag-n-drop the .svs worked (not sure why it shows as .tif in your example @evamaxfield ):

image

with lots of:

/Users/piotrsobolewski/Dev/miniforge3/envs/napari-test/lib/python3.10/site-packages/ome_types/_convenience.py:112: FutureWarning: The default XML parser will be changing from 'xmlschema' to 'lxml' in version 0.4.0.  To silence this warning, please provide the `parser` argument, specifying either 'lxml' (to opt into the new behavior), or'xmlschema' (to retain the old behavior).!

Then I tried to properly install bioformats, as instructed in the README, using conda: conda install -c conda-forge bioformats_jar Except this results in the hard java related crash again 😬:

An irrecoverable stack overflow has occurred.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001edaa78a0, pid=7970, tid=259
#
# JRE version: OpenJDK Runtime Environment Zulu11.48+21-CA (11.0.11+9) (build 11.0.11+9-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu11.48+21-CA (11.0.11+9-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [libGLImage.dylib+0x68a0]  void glgVectorCopy<GLGProfile_Generic32, (GLGMemory)0>(GLGOperationRec const*, unsigned long, GLDPixelModeRec const*)+0x55c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/piotrsobolewski/Dev/napari/hs_err_pid7970.log
#
# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
ihnorton commented 1 year ago

I am still a bit confused. The above output is the result of:

I used:

conda create -n np5
conda activate np5
mamba install bioformats_jar bfio napari pip
pip install napari-aicsimageio
napari

Thanks for the responses/explanations.

evamaxfield commented 1 year ago

If that is the case, then yes, the error would occur because no pip install napari[qt] was ran.

We have always assumed that users have installed napari with some backend (qt in our case) prior to installing napari-aicsimageio. I will quickly push out a patch to fix that so you can just install pip install napari-aicsimageio and it will install napari (with qt) for you

ihnorton commented 1 year ago

Sorry, was missing part of the line: napari pip within mamba install bioformats_jar bfio napari pip. In any case, napari does start successfully, which indicates that Qt is available.

evamaxfield commented 1 year ago

I just pushed a new commit with qt as an added dep (via napari). And pushed a new git tag to trigger a new release. It should be out in ~15 minutes?

psobolewskiPhD commented 1 year ago

@evamaxfield But which Qt will you include? I think this will be majorly problematic, given that conda and pypi don't have the same names for pyqt packages, for example. Not to mention that pypi doesn't have wheels for arm64 macOS.

A functioning napari install has a Qt backend, which is why plugins shouldn't assert their own. See also: https://napari.org/stable/plugins/best_practices.html#don-t-include-pyside2-or-pyqt5-in-your-plugin-s-dependencies

Now if/given this was a case of installing the plugin without installing napari, then I'm not sure what we can do. it's a napari plugin after all. Make the README and napari-hub docs clearer that a functioning napari install needs to be present?

evamaxfield commented 1 year ago

Hah. Well good thing the build broke: https://github.com/AllenCellModeling/napari-aicsimageio/actions/runs/4854973626/jobs/8652982285

I will revert the commit then.

evamaxfield commented 1 year ago

I reverted the commit and hopefully fixed the tests (that I assume were broken due to aicsimageio recent development).

I don't know what to do about this current issue personally.

@ihnorton can you please try the barebones install that uses no mamba:

conda create --name test-aicsimageio python=3.10 -y
conda activate test-aicsimageio
pip install napari-aicsimageio napari[qt]
psobolewskiPhD commented 1 year ago

😬 I always end up going back to this zulip, where I was the one to add napari[all] to this plugin and Talley and Czaki clarified: Start--me being kinda stupid https://napari.zulipchat.com/#narrow/stream/212875-general/topic/plugin.20install.20with.20optional.20dependencies/near/253882482 Talley with the explanation: https://napari.zulipchat.com/#narrow/stream/212875-general/topic/plugin.20install.20with.20optional.20dependencies/near/253934983

evamaxfield commented 1 year ago

Hah. Ya. I have just been out of this repo for a while so I have entirely forgotten. Good checks on docs and Zulip

ihnorton commented 1 year ago

can you please try the barebones install that uses no mamba:

That doesn't work for me on M1 because of reasons mentioned by @psobolewskiPhD above:

napari[qt] and napari[all] are both aliases for napari plus pyqt5, so on arm64 those will fail with pip, which remains the default plugin installer inside napari—this is rapidly changing!

evamaxfield commented 1 year ago

Ahhh my bad. I don't have an M1 so I just don't encounter these issues. Do you think we need to do something on our side or is this an upstream issue?

Sorry I am just having a hard time understanding. I am out of practice in microscopy software land

psobolewskiPhD commented 1 year ago

@ihnorton Can you try:

mamba create -n napari-test python=3.10 napari bioformats_jar
conda activate napari-test
pip install napari-aicsimageio

(there appears to be a conflict that causes old napari-aicsimageio to be installed if just conda/mamba is used. Edit: it's due to nd2 not being arm64 yet ) When I do this on my M1 then I can open your linked file after selecting napari-aicsimageio from the pop-up. You may need to use napari --reset to reset any file-type associations. I don't think the pyramids are handled ideally, but it does open.

ihnorton commented 1 year ago

@psobolewskiPhD thanks, that worked.