Repository navigation
Conversation
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
shapekit_anchor_graph, an opt-in vertebrae engine based on my warm-up solution. It cleans the 24 vertebra masks using the anatomical order of the vertebrae and the contact between them. When the case CT is on the same grid, it also refines the bone surface. The default engine (shapekit_songlin) and all other engines are unchanged.On 8 held-out VerSe'19 scans it was not clearly better than the raw SuPreM prediction. It gave the best whole-spine Dice of the 7 engines in the repo, but
it fixed no numbering errors. See Evaluation.
Not to be confused with #14 (
shapekit_anchor), which is a separate engine.How it works
The engine works on a crop around the spine and never resamples:
spine. 3. Split-bone merge. One bone split across two labels is merged into one label. The resulting gap is flagged, not renumbered.
Every voxel change is logged in the report, and the engine asserts that no change goes unlogged.
Changes
You can also set
vertebrae_engine: shapekit_anchor_graphinconfig.yaml.vertebrae_anchor_graph_report.jsonper case, with status,ct_used, per-label metrics before and after, every change with its location and reason,flags, runtime and the engine SHA256.
engine_failedand the batch continues.main.pystill logs "Successfullyprocessed" for that case, so check
statusin the report.Testing
python -m pytest tests -q: 73 passed, 15 of them new. No existing test was changed.write_emptyand the default saver behaviour;main.pyrun.Evaluation
All 7 vertebra engines in the repo were run on identical inputs with default settings: the 6
--vertebrae_engineoptions andutils/postprocessing_vertebrae.pyfrom #23. The raw SuPreM prediction is the control. The rules were fixed before any engine output existed.Held-out ground truth: 8 VerSe'19 validation scans.
swin_unetr_totalsegmentator_vertebrae.pth.Demo cases (in-sample: I developed the engine on them).
Limits of this evaluation:
The full report (frozen protocol, per-scan results and scripts) is available on request.
Scale
CPU only, one case per worker.
main.py --vertebrae_only --cpu_count 1: 358 s and a peak of 11.7 GB. The other engines peaked at 4.1–12.2 GB.Measure memory on a few cases before raising
--cpu_count.