Allow accepting a different refinement iteration per component#46
Merged
Conversation
IMM and OMM converge differently, so a single global "iteration to
accept" forced the same choice on both. Replace the single spinbox with
one step spinbox per component, discovered from the *_refined_iter{N}
surfaces on disk, and dispatch one `accept_refinement --component X <step>`
call per component. accept_refinement's cleanup is scoped to each
basename, so accepting one component never deletes another's iterations.
- Per-component rows rebuilt on config load, after a run, and via a new
Refresh button; default to the final (converged) iteration, range spans
available iterations, prior selections preserved across refreshes.
- Accept validates each choice exists, confirms all choices, and reports
per-component failures; disabled when no refined surfaces exist.
- Tests for discovery/ranges/defaults, selection preservation, empty-state
disable, and one --component CLI call per component.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a "Preview Iterations" button to the refinement tab's Accept
section that loads each *_refined_iter{N}.surface.vtp (plus iter0, the
original) as napari surface layers. The existing per-component accept
spinbox doubles as the scrubber: changing it toggles which iteration's
layer is visible, so the shown mesh is exactly what Accept promotes.
- main.py builds MeshViewer before RefinementWidget and passes it in;
mesh_viewer=None (headless/tests) hides the preview buttons.
- Reuses mesh_viewer._load_mesh_file for VTK loading + 3D switch.
- _refresh_accept_components clears stale preview layers first, since
accept deletes all but the chosen iteration.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refined *.surface.vtp files carry a noisy per-vertex scalar array; the Mesh Viewer auto-colored previews by it (speckled viridis), which is useless for judging shape. Add a flat=True mode to _load_mesh_file that skips scalar auto-coloring (marks the layer initialized, omits source_vtp_path) and shows a matte gray surface — ambient occlusion still gives depth. Preview layers now load flat. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Different tomograms can now pick different iterations; accept calls pass --tomogram and --component, and the UI lists one spinbox per surface basename. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid parsing every iteration for every surface up front; cache meshes for scrubbing and use single-surface mode when surface count exceeds the threshold. Co-authored-by: Cursor <cursoragent@cursor.com>
Resume now syncs experiment UI from config and discovery uses the config work_dir so Accept Iteration surfaces appear when refinement files exist. Co-authored-by: Cursor <cursoragent@cursor.com>
Scan config work_dir (including relative results/), exp_dir, and results/; handle work_dir field pointing at the experiment folder; log scanned paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
SummaryMesh Refinement tab: accept and preview iterations per tomogram×surface (not one pick per component globally). Lazy napari preview for large datasets. Fixes surface discovery after experiment resume. Changes-One accept spinbox per surface (TE1_IMM, TE2_OMM, …); scoped accept_refinement calls |
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.
IMM and OMM converge differently, so a single global "iteration to accept" forced the same choice on both. Replace the single spinbox with one step spinbox per component, discovered from the *_refined_iter{N} surfaces on disk, and dispatch one
accept_refinement --component X <step>call per component. accept_refinement's cleanup is scoped to each basename, so accepting one component never deletes another's iterations.