feat(paint): add Fill Holes segmentation process#898
Merged
Conversation
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
39f4866 to
b9054c2
Compare
Fill Holes fills enclosed background regions in a segment group on a slice. Options select current-slice vs whole-volume and all-segments vs the selected segment. Only background voxels are filled, so existing segments are never overwritten. Fill Holes is the default process.
Group process-control layout cleanup with annotation sidebar alignment and panel tab width fixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Fill Holes, a third paint "process" alongside Fill Between and Smooth. It
finds background regions fully enclosed by segmentation on a 2D slice and fills them
in — a common cleanup after painting leaves interior gaps. Fill Holes is the first
option in the process list and the default selection.
Behavior
the slice border is a hole.
even when fully enclosed.
view's axis).
by the lowest label for determinism). Locked segments are never grown.
UX
The Preview step's Original/Processed control toggles in place — clicking either
button flips the view, so you can compare without moving the pointer. The active button
still indicates which view you're on.
Implementation
core/tools/paint/fillHoles.ts— pure, dependency-free flood fill (unit-testable,worker-ready), run in a web worker (
fillHoles.worker.ts) so whole-volume fills don'tblock the UI, matching Gaussian Smooth.
store/tools/fillHoles.ts— resolves the IJK slice axis from the active 2D view andthe segment group's parent image, and the current slice from the view's slice
config; requires an active 2D view.
ProcessAlgorithmcontract; no changes to the processframework's preview/apply/cancel flow.
processes.tsregistry, so the selector and controls render from one table instead ofper-type copy-paste.
Shared fixes (benefit all paint processes)
Review surfaced bugs in the shared process flow, fixed here so Fill Between and Smooth
benefit too:
(previously
confirmProcesscommitted the original scalars).blocked by (or limited to) a single active segment.
Testing
no-mutation, deterministic tie-break, locked-segment protection, whole-volume on a
non-default axis, single-slice.
toggle), verified against a production build in Chrome.
Manual QA
Load a dataset, create a segment group, paint a shape with an interior gap, then
Paint → Process → Fill Holes. Try each Slices/Segments combination, Preview, then
Apply or Cancel.
Out of scope
active view's axis only).