Skip to content

feat(gui): add data clean-up menu (duplicates, pixel dust, empty traces)#88

Merged
dustenhubbard merged 1 commit into
mainfrom
feat/data-cleanup-menu
Jul 21, 2026
Merged

feat(gui): add data clean-up menu (duplicates, pixel dust, empty traces)#88
dustenhubbard merged 1 commit into
mainfrom
feat/data-cleanup-menu

Conversation

@dustenhubbard

Copy link
Copy Markdown
Owner

First attempt at upstream #67's data-cleanup menu (fork-first; NOT submitted upstream — #67 is multi-assignee, coordinate after Dev review). Also the agreed strategy for Copy-to-sections collisions.

New 'Clean up' submenu under Series (folds in the existing Remove duplicate traces):

  • Remove duplicate traces: same-section, same-object-name, coincident geometry (exact or IoU >= 0.95 adjustable); tags merged onto survivor.
  • Remove pixel-dust traces: closed traces with 0 < area <= threshold (default 0.01 um^2, adjustable), shown in a REVIEW LIST (reuses the smoothing-dialog review widget) before deletion.
  • Remove empty traces: no points / zero area / zero-length open (disjoint from pixel-dust).

All three: single-undo via the series-states path, progress bar, locked objects skipped, confirm/review before deleting. Duplicate detection scoped per object name so distinct overlapping objects are never flagged. 11 new tests; full suite 1243 passed, 5 pre-existing xfails.

Open design questions carried to the maintainer's Dev review (see below).

🤖 Generated with Claude Code

Add a "Clean up" submenu under the Series menu (issue #67) grouping three
series-wide data-maintenance operations, each a single undoable action with a
progress bar via the existing enumerateSections/SeriesStates path:

- Remove duplicate traces (pre-existing op, folded into the submenu): same
  object name AND geometrically coincident on the same section (exact points or
  IoU overlap above a threshold, default 0.95). Never merges distinct objects.
- Remove pixel-dust traces: small closed traces at or below a user-chosen area
  threshold (um^2, computed like the object/trace tables), presented in a
  reviewable list (PixelDustDialog) so the user inspects and deselects before
  anything is deleted. Deletion reuses deleteMalformedTraces (signature match).
- Remove empty traces: degenerate geometry only (no points, zero-area closed,
  zero-length open), removed after a count-stating confirmation.

Locked objects are left untouched (the review-list delete path refuses them).
Generalizes MalformedContoursDialog with an overridable column/heading spec so
PixelDustDialog reuses its selection/navigation/delete/export behaviour.

Tests: tests/test_data_cleanup.py exercises each op end-to-end on shapes1.jser
with synthetic traces, including threshold edges, locked skipping, the
distinct-object false-positive guard, and single-undo restoration across
multiple sections. Full suite green (1243 passed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LiM1igjbwUJfVBgR7Y31Kp
@dustenhubbard
dustenhubbard enabled auto-merge (squash) July 21, 2026 23:49
@dustenhubbard
dustenhubbard merged commit a291e88 into main Jul 21, 2026
1 check passed
@dustenhubbard
dustenhubbard deleted the feat/data-cleanup-menu branch July 21, 2026 23:50
dustenhubbard added a commit that referenced this pull request Jul 23, 2026
…es) (#88)

Add a "Clean up" submenu under the Series menu (issue #67) grouping three
series-wide data-maintenance operations, each a single undoable action with a
progress bar via the existing enumerateSections/SeriesStates path:

- Remove duplicate traces (pre-existing op, folded into the submenu): same
  object name AND geometrically coincident on the same section (exact points or
  IoU overlap above a threshold, default 0.95). Never merges distinct objects.
- Remove pixel-dust traces: small closed traces at or below a user-chosen area
  threshold (um^2, computed like the object/trace tables), presented in a
  reviewable list (PixelDustDialog) so the user inspects and deselects before
  anything is deleted. Deletion reuses deleteMalformedTraces (signature match).
- Remove empty traces: degenerate geometry only (no points, zero-area closed,
  zero-length open), removed after a count-stating confirmation.

Locked objects are left untouched (the review-list delete path refuses them).
Generalizes MalformedContoursDialog with an overridable column/heading spec so
PixelDustDialog reuses its selection/navigation/delete/export behaviour.

Tests: tests/test_data_cleanup.py exercises each op end-to-end on shapes1.jser
with synthetic traces, including threshold edges, locked skipping, the
distinct-object false-positive guard, and single-undo restoration across
multiple sections. Full suite green (1243 passed).
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.

1 participant