Skip to content
This repository was archived by the owner on Nov 11, 2026. It is now read-only.

workflows: drop --joint-end; growth-plate trace checks warn - #613

Merged
haowjy merged 2 commits into
mainfrom
jimyao/loosen
Nov 5, 2026
Merged

haowjy merged 2 commits into
mainfrom
jimyao/loosen

Conversation

@haowjy

@haowjy haowjy commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Changelog

  • Changed: the growth-plate trace checks (points off the tibia, gaps over the plate, jumps between sections, eroded marks, the width points, ROI-1 cutting through bone) now warn instead of stopping the IIOC and metaphysis steps. The worker either fixes the trace or raises a To check item.
  • Removed: tibia_frame.py --joint-end. The joint end is the tibia's end that faces the femur.

Why

#608 set the rule: a script refuses only when it cannot write a valid result. A check that judges the result warns, and the worker decides. This PR applies that rule to the growth-plate trace checks, whose limits were set on a few runs. One of them, the off-tibia check, stops 12 of the 45 lab hand traces (workflows/mouse-oa/.context/TODO.md). --joint-end had become redundant: after #608 the script used the end it detected over the flag.

Design decisions

  1. The annotation checks return their sentence, or None, and the caller decides what to do with it. iioc.py and metaphysis_roi.py warn (warn_on). plate_snap.py still refuses a snap that breaks a rule the worker's own curves met: the snap is an optional tool, and the worker keeps their curves. This replaces plate_snap.py's passes(), which caught SystemExit to probe the old refusers.
  2. An empty femur label now refuses in tibia_frame.py. Without the flag, the joint end comes only from where the femur lies.
  3. Still refusing: merge_labels.py's runaway-track check, since writing that merge would hand a big bone's voxels to a small structure's label. It already has --max-big-share as the way past it. It's noted in the TODO. Faces that cross, an empty ROI-3, and grid mismatches also still refuse.

Walkthrough

A trace problem no longer stops IIOC

  1. Setup: this branch.
  2. Run iioc.py with a growth_plate_curves point off the tibia.
  3. Expect: the script writes ROI-1 and its values, and the printed line's warnings names the section.

What changed

  • annotations.py: refuse_off_tibia, refuse_gaps and refuse_jumps become check_* functions that return the problem sentence. Adds warn_on. eroded_marks warns.
  • iioc.py: refuse_width_points and refuse_cut_sides become check_* functions that warn. The calls are wrapped in warn_on.
  • metaphysis_roi.py: the calls are wrapped in warn_on.
  • plate_snap.py: uses the returned sentences; passes() is deleted.
  • tibia_frame.py: --joint-end is removed; check_bone returns the detected end.
  • Docs: oa-protocol.md, the docstrings, mouse-oa/.context/TODO.md, decisions.md.

Risk and where to look

  • Breaks or changes: new runs only. A worker that passes --joint-end (from an old habit; no doc names it any more) gets an argparse error naming the flag. A live run uses its own workflow snapshot, so it isn't affected.
  • Where to look: the plate_snap.py condition, not check(ann…) and (problem := check(new…)), and every caller of the renamed functions.

Knowledge layers, docs and deletions

  • Docs: as listed above.
  • Deleted: --joint-end, plate_snap.passes, and the second-pass TODO item.

Contract changes

None.

Verification

  • Ran: sh workflows/test.sh (ruff, then 212 passed); ruff --fix sorted the imports.
  • Saw: the renamed functions have no callers left under their old names (checked with grep across workflows/).

Left out

  • merge_labels.py's track check: workflows/mouse-oa/.context/TODO.md.

haowjy and others added 2 commits November 4, 2026 20:26
tibia_frame.py finds the joint end from where the femur lies, so the flag
is gone. The trace checks in annotations.py and iioc.py return or warn
with their sentence instead of exiting; plate_snap.py uses the returned
sentence directly instead of catching SystemExit.

Co-Authored-By: Claude <noreply@anthropic.com>
@haowjy
haowjy marked this pull request as ready for review November 5, 2026 01:30
@haowjy
haowjy merged commit 15055bb into main Nov 5, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant