napari-clusters-plotter
napari-clusters-plotter copied to clipboard
Meta layer navigation widget?
When the clusters plotter supports cross-layer clustering functionalities, we should provide users with a small widget that helps to navigate layers, especially if there are many of them. Such a widget could offer the following functioanlity:
- Select all layers of a particular kind (all
Labels/Surface/etc layers, for instance) - Select all layers as defined by a searchstring for their layer name
- Functionality for putting multiple layers in a grid layout (similar to what's already in napari), but put linked layers in the same place - how to interact with linked layers?
Hi @jo-mueller ,
any benefit of this belonging here and not in napari-clusters-plotter?
Errrr.....I may have accidentally created this widget in the wrong project. Oops!
Uhh, issue transferring, cool! hehe alright then!
@jo-mueller I really like the idea of a searchstring or regex function for selecting specific layers! I just gave the new plotter a try with the example notebooks and do like the immediacy of just selecting some layers as well though (but locking this selection in place would also be helpful). Maybe this widget could be something that expands depending on what is needed and that we have some very intuitive functionality activated by default?
Also great work on all of the plotter updates, trying it for the first time was really cool! Also I don't really know where we can have a general discussion about the new updates that you are implementing since there is nowhere to add a discussion in the project tab?
@Cryaaa thanks for the feedback! Layer navigation is definitely something to think about in depth 🤔
For better interaction: We could, for instance, add the selected clusters to the features of the selected layers so that when a different layer is selected and the previous layer selected again, the already drawn clusters would be "remembered". If you'd then select a single cluster layer out of the previous multi-layer selection, you'd see exactly your previously selected points.
Expanding the plotter widget with relevant functionality for the arrangement/management of multiple layers is actually a cool idea. I was originally leaning towards a separate widget, but we could still write it as one and then show/unshow it in the clusters plotter widget whenever multiple layers are selected.
The catch here is really the arrangement: Unfortunately, simply using the gallery view doesn't work in every usecase. For an image with a labels layer on top, using the gallery view would put them side by side instead of leaving them on top of each other :/ That's why, in the example sample data, I use the translate attribute of the layers to make sure that images and labels stay with each other.
Anyway, just my two cents. I'm off to parental leaving again :)
For better interaction: We could, for instance, add the selected clusters to the features of the selected layers so that when a different layer is selected and the previous layer selected again, the already drawn clusters would be "remembered". If you'd then select a single cluster layer out of the previous multi-layer selection, you'd see exactly your previously selected points.
I like that idea a lot and with the new way of defining clusters by selecting the identity, the user can avoid overwriting other clusters if you make changes to only one layer.
Expanding the plotter widget with relevant functionality for the arrangement/management of multiple layers is actually a cool idea. I was originally leaning towards a separate widget, but we could still write it as one and then show/unshow it in the clusters plotter widget whenever multiple layers are selected.
Completely agree with this, once we have a single widget we can then think about where we add or show it.
The catch here is really the arrangement: Unfortunately, simply using the gallery view doesn't work in every usecase. For an image with a labels layer on top, using the gallery view would put them side by side instead of leaving them on top of each other :/ That's why, in the example sample data, I use the
translateattribute of the layers to make sure that images and labels stay with each other.
I see, that would be more difficult to solve I guess, do you know if there is any interest in having a gallery view, by layer type functionality in napari, or having some kind of subgrouping for the gallery view? but yeah solving that problem ourselves would be a bit finicky but maybe worth it to investigate high throughput data.
Anyway, just my two cents. I'm off to parental leaving again :)
Enjoy your time off with your kid! :)
Bumping this back up: I just realized that napari provides the stride option when swapping the viewer into grid mode (right-click on grid-mode-icon). In a list of n layers, it basically puts the first stride layers on top of each other, assuming that they belong together.
This is pretty close to arranging images nicely. The only thing required to make use of this, is to order layers correctly, e.g.
Image layer1Labels layer1Image layer2Labels layer2Image layer3Labels layer3- etc
To still be able to select all labels at a click rather than having to pick them one by one would be to omit un-supported layers when gathering the features rather than simply returning.