Skip to content

Fix aniso#810

Merged
m-reuter merged 7 commits into
devfrom
fix-aniso
May 7, 2026
Merged

Fix aniso#810
m-reuter merged 7 commits into
devfrom
fix-aniso

Conversation

@m-reuter
Copy link
Copy Markdown
Member

@m-reuter m-reuter commented May 6, 2026

Fixes:

  • write invocation of run_fastsurfer to log files (was overwritten by version.py, now writes into the seg and build logs)
  • bug where segmentations were cropped when using keepgeom in special cases.
  • CC can now draw its result back into aparc+aseg.dkt if both images are native geometry
  • CC now can also fill WM and background voxels for those cases (due to internal re-orientation to soft LIA in a new wrapper)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses two pipeline robustness issues: (1) preserving run_fastsurfer.sh invocation details in log files without being overwritten by version.py, and (2) preventing unintended cropping/shift during “soft” reorientation/keep-geometry workflows (notably affecting anisotropic/native-geometry segmentations).

Changes:

  • Log the fully shell-escaped run_fastsurfer.sh invocation into the segmentation log and append it to the build log generated by version.py.
  • Fix/guard “soft” target-orientation reorientation to fall back to a discrete flip/reorder (no interpolation) when appropriate, plus add regression tests for non-cubic and keepgeom-like cases.
  • Add --keepgeom/--native_image support to paint_cc_into_pred.py and route CC post-processing through a temporary LIA space when needed.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/image/test_orientation_transform.py Adds regression tests ensuring soft reorientation roundtrips exactly without cropping for non-cubic/keepgeom-like inputs.
run_fastsurfer.sh Records a properly quoted invocation string in logs; passes --keepgeom through to CC inpainting when native geometry is requested.
FastSurferCNN/version.py Small refactor in read_and_close_version type handling (currently introduces a runtime issue).
FastSurferCNN/data_loader/conform.py Improves soft reorientation path to prefer discrete transforms when no interpolation is required; minor formatting/type-check refactors (currently introduces runtime issues).
CorpusCallosum/utils/visualization.py Refactors isinstance check (currently introduces a runtime issue).
CorpusCallosum/shape/mesh.py Refactors isinstance check (currently introduces a runtime issue).
CorpusCallosum/registration/midsagittal_plane_alignment.py Minor refactor (list-comp to generator unpacking).
CorpusCallosum/paint_cc_into_pred.py Adds --keepgeom CLI flag; allows non-LIA inputs in keepgeom mode and performs correction in temporary LIA orientation with mapping back.
CorpusCallosum/fastsurfer_cc.py Minor refactor (list-comp to generator unpacking).
CorpusCallosum/data/read_write.py Refactors isinstance check (currently introduces a runtime issue).
.gitignore Ignores /checkpoints/**.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread FastSurferCNN/version.py
Comment thread FastSurferCNN/data_loader/conform.py
Comment thread FastSurferCNN/data_loader/conform.py
Comment thread FastSurferCNN/data_loader/conform.py
Comment thread CorpusCallosum/data/read_write.py
Comment thread CorpusCallosum/utils/visualization.py
Comment thread CorpusCallosum/shape/mesh.py
@m-reuter m-reuter merged commit a67c456 into dev May 7, 2026
7 checks passed
@m-reuter m-reuter deleted the fix-aniso branch May 7, 2026 12:13
@m-reuter m-reuter added this to the FastSurfer v2.5 Release milestone May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants