ome / napari-ome-zarr

A napari plugin for zarr backed OME-NGFF images
https://www.napari-hub.org/plugins/napari-ome-zarr
BSD 3-Clause "New" or "Revised" License
27 stars 21 forks source link

Drop color key #112

Closed will-moore closed 2 months ago

will-moore commented 2 months ago

See https://github.com/ome/ome-zarr-py/pull/389 cc @jni

This combines the version check for napari from that PR, along with @psobolewskiPhD's change.

Test viewing an image with labels (label colours are preserved) with napari 0.5.0 and with napari 0.4.x

E.g. red labels in

$ napari --plugin napari-ome-zarr https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0076A/10501752.zarr

Screenshot 2024-07-11 at 11 46 43

will-moore commented 2 months ago

Test fixes included handling the metadata change from name to channel_names in https://github.com/ome/ome-zarr-py/commit/cae02c8198deb3a7575c33b04c6399d977293bb0

The other failure was new with napari v0.5.0:

  >       viewer.window.qt_viewer.on_draw(None)
  E       AttributeError: 'QtViewer' object has no attribute 'on_draw'

I couldn't find what the correct method was to use instead of on_draw. This also produces a warning:

FutureWarning: Public access to Window.qt_viewer is deprecated and will be removed in
  v0.6.0. It is considered an "implementation detail" of the napari
  application, not part of the napari viewer model. If your use case
  requires access to qt_viewer, please open an issue to discuss.

so it looks like this testing strategy won't be available soon anyway. My try/except AttributeError should handle both cases.

cc @joshmoore

joshmoore commented 2 months ago

@jni: https://pypi.org/project/napari-ome-zarr/0.6.1/ (0.6.0 failed for GH action reasons)

jni commented 2 months ago

(0.6.0 failed for GH action reasons)

image

psobolewskiPhD commented 2 months ago

Sorry to be late to this, but it works perfectly on my end. ❤️

joshmoore commented 2 months ago

Thanks, all!