napari / napari

napari: a fast, interactive, multi-dimensional image viewer for python
https://napari.org
BSD 3-Clause "New" or "Revised" License
2.19k stars 422 forks source link

Properties shown in the bottom bar for labels and points, but not for shapes #7306

Open LucaMarconato opened 3 weeks ago

LucaMarconato commented 3 weeks ago

🐛 Bug Report

When I add a layer with features and hover it with the mouse over one of the geometrical instances, I expect to see the text description of the currently hovered instance in the bottom bar. This happens correctly for labels and points, but not for shapes.

Related to https://github.com/napari/napari/issues/2866.

💡 Steps to Reproduce

I use these three snippets from the napari example gallery, copy-pasted:

To reproduce the bug, I simply over the mouse over any geometrical instance for the current layer.

Labels (correct)

image

Points (correct)

image

Shapes (wrong)

We see shapes (422 109): 1 in the bottom bar, but no reference to "likelihood" nor "class". image

💡 Expected Behavior

I expect a text description for the current hovered property to be visible in the bottom bar. This happens for labels and points, but not for shapes, as you can see in the images below.

🌎 Environment

napari: 0.5.3.dev30+g3b5b3a98 Platform: macOS-14.6.1-arm64-arm-64bit System: MacOS 14.6.1 Python: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ] Qt: 5.15.14 PyQt5: 5.15.11 NumPy: 1.26.4 SciPy: 1.14.0 Dask: 2024.8.0 VisPy: 0.14.3 magicgui: 0.8.3 superqt: 0.6.7 in-n-out: 0.2.1 app-model: 0.2.8 npe2: 0.7.7

OpenGL:

Screens:

Optional:

Settings path:

💡 Additional Context

No response

Czaki commented 3 weeks ago

It is not a bug, it is feature request.

It requires changes in shape layer like in Labels and Points:

https://github.com/napari/napari/blob/c73e9d5ec0864cc9fa727cf7b147ccdd6ab39a03/napari/layers/labels/labels.py#L1548-L1581

and

https://github.com/napari/napari/blob/c73e9d5ec0864cc9fa727cf7b147ccdd6ab39a03/napari/layers/labels/labels.py#L1497-L1505

Maybe we should generalize it somehow to any layer with properties.

psobolewskiPhD commented 3 weeks ago

It is not a bug, it is feature request.

I mean, if it never worked, for any layer, then yes? But I think it's a very reasonable expectation that if it works for labels and points, it works for Shapes--especially given that we have an example to show it off! So it does feel like a bug. For what it's worth, I didn't realize this didn't work and I recently steered a user into it... 👀 I've not heard back, so maybe they haven't tried it 🤷

jni commented 2 weeks ago

The point is it never has worked. Each layer is implemented separately so each layer is a separate feature request. Of course, as @Czaki pointed out, perhaps it means that we should unify the implementations.