Repository navigation
fix(scripts): bring debug_track.py up to the current track flow; fix the mem_nuc_contour key - #466
Merged
Merged
Conversation
…the mem_nuc_contour key debug_track.py failed at import: resolve_z_slice was removed in #424, and the script also used z_range, the old run_ultrack signature, hardcoded dataset paths and the stale function key biahub.cli.track.mem_nuc_contour. The script now reads a biahub track config (-c) and one position (-i), tracks that FOV in memory the way biahub track does (labels or foreground+contour for ultrack; tracksdata/hoct/trackastra on the segment labels), and opens napari. Nothing is written into the plate. The commented example in settings/example_track_settings.yml used the same stale key; it is now biahub.track.mem_nuc_contour. Closes #458
ieivanov
approved these changes
Nov 10, 2026
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.
Closes #458 (option 1: update the script, fix the key in both places).
Problem
scripts/debug_track.pyfailed at import on main:resolve_z_slicewas removed in #424. Beyond that, the script was written for the pre-#424 flow:z_rangein the config (now rejected, since track doesn't select Z), the oldrun_ultrack(cfg, fg, contour, scale, path)signature, a foreground+contour-only path (the default is nowsegmentation_method: labels), hardcoded dataset paths, and the stale keybiahub.cli.track.mem_nuc_contour.scripts/is excluded from ruff, so none of this was caught.Change
scripts/debug_track.py, rewritten as a thin wrapper over the library:python scripts/debug_track.py -c track.yml -i <plate>.zarr/B/1/000000 [--input-images-path …] [--database-dir …] [--n-workers N].biahub track(yaml_to_model(…, TrackingSettings)) and resolves the first nullinput_imagespath the same way.output_mode(check_input_dimensionality), so a 3D plate with 2D tracking points you tobiahub project.track_one_positionuses:load_labels(labels mode) or_load_and_preprocess+detect_foreground_segmentation(foreground+contour), thenrun_ultrack. tracksdata / hoct / trackastra go throughlink_fixed_labels.--database-diris given.settings/example_track_settings.yml: the commented example now usesbiahub.track.mem_nuc_contour(the key inCUSTOM_FUNCTIONS).Tested
On a synthetic 4-frame plate (3 moving disks,
labels/nuclei), with napari stubbed (no display):segmentation_method: labels→ 3 tracks over 4 timepoints; viewer getslabels/nuclei,tracks_nucleiand the tracks layer.segmentation_method: foreground_contourwithbiahub.track.mem_nuc_contour→ 3 tracks over 4 timepoints.labels/nucleiafterwards.ruff check/ruff format --check(repo config,--no-force-exclude) pass, andtests/test_example_settings.pypasses (32).