Skip to content

Speed up multi-ROI deletion in the GUI#1420

Open
chenyenchung wants to merge 1 commit into
MouseLand:mainfrom
chenyenchung:fast-multi-delete
Open

Speed up multi-ROI deletion in the GUI#1420
chenyenchung wants to merge 1 commit into
MouseLand:mainfrom
chenyenchung:fast-multi-delete

Conversation

@chenyenchung
Copy link
Copy Markdown

This a proof-of-concept change associated with #1419 .

  • Add batch deletion utilities in cellpose/gui/delete_utils.py to normalize ROI IDs and relabel masks in a single pass.
  • Update cellpose/gui/gui.py so multi-ROI deletion uses the batch path, while single-ROI deletion remains the same.
  • Preserve existing GUI-side effects, including ROI count updates, saved-set updates, and deletion tracking.
  • Add regression tests in tests/test_gui_delete_utils.py to verify that the batch path behaves in the same way as the original deletion behavior in both 2D and 3D cases.
  • Treat invalid or duplicate ROI IDs as no-ops.

Testing

  • Added a fixed-case regression test.
  • Added randomized 2D and 3D equivalence tests against the legacy deletion path.
  • Added a no-op test for invalid ROI IDs.

Comment thread cellpose/gui/gui.py Outdated
@chenyenchung chenyenchung force-pushed the fast-multi-delete branch 2 times, most recently from edd99bc to 4ccfa5f Compare March 27, 2026 20:32
@chenyenchung
Copy link
Copy Markdown
Author

Rebased the commit to the current main.

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.

2 participants