napari-clusters-plotter icon indicating copy to clipboard operation
napari-clusters-plotter copied to clipboard

Labels layer opacity = 0

Open haesleinhuepf opened this issue 1 year ago • 2 comments

In napari-clusters-plotter 0.7.0 the labels layer's opacity is set to 0 at some point. It appears empty and a new user might be confused. Instead of setting its opacity, I would vote for hiding it (layer.visible=False). The user can then easily get it back.

haesleinhuepf avatar Apr 29 '23 18:04 haesleinhuepf

I can't recall what was exactly the issue but this change was made in the implementation of 2D histogram PR due to some bug that was appearing if labels layer is made invisible -> Originally posted by @thorstenwagner in https://github.com/BiAPoL/napari-clusters-plotter/pull/196#issuecomment-1466165021

lazigu avatar Apr 30 '23 18:04 lazigu

So, as soon as a layer is invisible, it is not in sync with the visible layer slices anymore. I think the world_to_data function gets confused and returns a wrong position (z-coordinate is wrong). That was a problem for one of my plugins interacting with the cluster-plotter-plugin. However, I added some changes to make sure that the label layer is visible:

https://github.com/MPI-Dortmund/napari-tomotwin/blob/main/src/napari_tomotwin/load_umap.py#L58

That said I think you can make your proposed change :-)

thorstenwagner avatar May 02 '23 16:05 thorstenwagner