Improved CC & AC/PC editing#846
Conversation
There was a problem hiding this comment.
⚠️ Human review recommended
It changes core geometric alignment and segmentation mapping behavior (midplane transforms + edited-segmentation remapping), which warrants domain-specific validation beyond what can be safely inferred from diff review alone.
Pull request overview
This PR extends the FastSurfer Corpus Callosum (CC) module with an expert-facing workflow for (1) manual correction of upright CC segmentations and (2) optionally supplying AC/PC voxel landmarks to condition processing and refine midsagittal-plane alignment, along with documentation updates to describe the new workflows and outputs.
Changes:
- Add support for manual upright CC edits (
*.upright.manedit.mgz) and recompute CC-derived outputs, including generatingcallosum.CC.orig.manedit.mgzfor downstream inpainting. - Add expert CLI support for manually supplied AC/PC voxel coordinates and adjust midplane alignment to contain those landmarks.
- Update CLI help and documentation for native/Docker/Singularity expert workflows and new/updated output files/metadata.
File summaries
| File | Description |
|---|---|
| run_fastsurfer.sh | Wires --qc_snap to emit an upright reference volume, enforces upright CC edit usage, and forwards upright manedit segmentation into fastsurfer_cc.py. |
| doc/scripts/fastsurfer_cc.rst | Documents expert AC/PC landmark input and the upright CC manual-edit workflow (including container examples). |
| doc/overview/OUTPUT_FILES.md | Adds callosum.CC.orig.manedit.mgz and clarifies when upright_volume.mgz is produced. |
| doc/overview/modules/CC.md | Documents new JSON metadata fields describing landmark and segmentation sources. |
| doc/overview/EDITING.md | Adds end-to-end CC upright edit instructions for the top-level run_fastsurfer.sh --edits workflow. |
| CorpusCallosum/utils/mapping_helpers.py | Adds mapping of edited upright hard segmentations back to original space with regenerated subdivision labels and fornix handling. |
| CorpusCallosum/utils/editing.py | New utilities for path suffixing, AC/PC validation, and robust loading/validation of manual upright segmentations. |
| CorpusCallosum/registration/midsagittal_plane_alignment.py | Extends midplane transform resolution to optionally incorporate supplied AC/PC landmark constraints. |
| CorpusCallosum/registration/landmarks.py | New landmark-based midplane adjustment logic plus diagnostics emission. |
| CorpusCallosum/README.md | Expands expert quickstart with native/Docker/Singularity commands and mentions landmark/manual-edit support. |
| CorpusCallosum/fastsurfer_cc.py | Adds expert CLI args (--segmentation_manedit, --ac_coords, --pc_coords), conditional model loading, and manual-edit reprocessing/mapping behavior. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 0
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
For human reviewers:
|
Summary
Manual-edit behavior
Manual segmentations use label 192 for the corpus callosum and optionally label 250 for the fornix.
This can be done through run_fastsurfer.sh --edits, finding the cc.upright.manedit.mgz or through the fastsurfer_cc.py script.
Validation