Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deselect clusters #291

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Deselect clusters #291

wants to merge 12 commits into from

Conversation

thorstenwagner
Copy link
Collaborator

This is my attempt for an implementation to deselected clusters (#289):

If you keep control pressed and click on a cluster, it gets deleted.

vokoscreenNG-2023-12-18_16-11-03

@thorstenwagner thorstenwagner changed the title Delete selected clusters Deselect clusters Dec 18, 2023
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (db9aea7) 77.33% compared to head (0217a51) 76.57%.

Files Patch % Lines
napari_clusters_plotter/_Qt_code.py 22.22% 21 Missing ⚠️
napari_clusters_plotter/_plotter.py 28.57% 5 Missing ⚠️
napari_clusters_plotter/_plotter_utilities.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   77.33%   76.57%   -0.76%     
==========================================
  Files          16       16              
  Lines        1897     1921      +24     
==========================================
+ Hits         1467     1471       +4     
- Misses        430      450      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thorstenwagner thorstenwagner linked an issue Dec 18, 2023 that may be closed by this pull request
Copy link
Contributor

@stefanhahmann stefanhahmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this looks definitely like a cool feature to be added to the clusters plotter.

However, I checked out this branch and tried the feature in a Windows environment and could not get it to work.

For a test data test, I followed this workflow with Napari built-ins:

Workflow Segment and Measurements

Then I tried to generate 2 clusters with Shift + Mouse Drag (which works as always) and then tried to delete only 1 cluster with Control + Left Click, which delete all clusters and not only the cluster I was pointing to:

Deselect cluster not working

Am I doing something wrong?

@thorstenwagner
Copy link
Collaborator Author

Hi! Thanks for testing. The implementation is only done for histograms, not for point clouds

@stefanhahmann
Copy link
Contributor

Hi! Thanks for testing. The implementation is only done for histograms, not for point clouds

Okay. Good to know.

I tested with histograms and there it works as expected. The only thing, I would suggest: when using Ctrl + Click outside any cluster, it would find it more intuitive, if nothing changes, instead of the deletion of all clusters. The latter is the standard behavior, when just clicking. In a File Explorer (e.g. in Windows), if you select multiple files/folders with Ctrl + Click and then click in an empty area, the selection of files/folder does not change (i.e. is not cleared). I would recommend to follow to this pattern, since it might be intuitive to users, since they are used to this pattern.

From a user perspective, it would of course be nice to have the same behavior also in point scatter plots. Users may interpret it otherwise not as a missing feature for the scatter plot, but as a bug and report it as such.

Regarding the code: I do not feel confident enough to give feedback regarding the code.

@thorstenwagner
Copy link
Collaborator Author

Hi!

Now nothing happens when control is pressed. Good point!

I agree that it should also work for point scatter plots. However, the current implementation depends on the histograms. We can implement a more generalized mechanism, by saving the individual paths for the lassos, but the current implementation depends on the histogram overlay and is not easy to generalize.

@thorstenwagner
Copy link
Collaborator Author

thorstenwagner commented Jan 15, 2024

Any chances to see that merged without the additional implementation for scatter + histograms? As far as I can see this would require a bigger refactoring.

@Cryaaa
Copy link
Collaborator

Cryaaa commented Jan 15, 2024

Hey @thorstenwagner,
I am unsure if we should add this feature here if it is only a histogram specific one. I generally love the functionality but we are currently also planning a rehaul of the code structure and maybe it just might be better to add a more generalized version then.. maybe @zoccoler and @jo-mueller can also chime in?

@thorstenwagner
Copy link
Collaborator Author

Hey @thorstenwagner, I am unsure if we should add this feature here if it is only a histogram specific one. I generally love the functionality but we are currently also planning a rehaul of the code structure and maybe it just might be better to add a more generalized version then.. maybe @zoccoler and @jo-mueller can also chime in?

Its a very useful but not critical feature for me. So its fine for me if we add this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deselect clusters when control is pressed
3 participants