Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Integrates the optional neuroLIT Lesion Inpainting Tool (LIT) into the FastSurfer pipeline so that lesion-aware processing can be triggered via --lesion_mask, including Docker preloading of LIT checkpoints and updated documentation.
Changes:
- Add
--lesion_masksupport inrun_fastsurfer.shto runlit-inpaintingbefore segmentation andlit-postprocessingafter segmentation/surfaces, with special handling for--no_biasfield. - Add
neurolitas a Python dependency and preload LIT models in the Docker image with deterministicXDG_DATA_HOME. - Add documentation pages/updates describing LIT usage, examples, outputs, and module overview entries.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Docker/Dockerfile | Pins XDG_DATA_HOME and pre-downloads LIT models during image build. |
| run_fastsurfer.sh | Adds --lesion_mask flag and runs LIT inpainting/postprocessing around the existing pipeline. |
| pyproject.toml | Adds neurolit dependency for LIT CLIs. |
| doc/scripts/lit.rst | New script documentation page explaining LIT integration and outputs. |
| doc/scripts/index.rst | Adds lit.rst to scripts documentation index. |
| doc/scripts/RUN_FASTSURFER.md | Documents the new --lesion_mask CLI option. |
| doc/overview/modules/index.rst | Adds LIT to module overview index. |
| doc/overview/modules/LIT.md | New module overview page describing LIT and its outputs. |
| doc/overview/intro.rst | Mentions LIT as a FastSurfer capability in the intro overview. |
| doc/overview/OUTPUT_FILES.md | Documents LIT-related outputs and file locations. |
| doc/overview/EXAMPLES.md | Adds a new end-to-end example for running FastSurfer with --lesion_mask. |
| README.md | Mentions neurolit/LIT in modules list and adds the LIT citation. |
| FastSurferCNN/data_loader/conform.py | Hardens dtype-name handling in is_conform() logging/check labeling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
298
to
+321
| @@ -317,8 +318,11 @@ ENV PYTHONPATH=/fastsurfer:/opt/freesurfer/python/packages \ | |||
| RUN <<EOF | |||
| source /venv/bin/activate | |||
| cd /fastsurfer | |||
| mkdir -p "$XDG_DATA_HOME" | |||
Comment on lines
+961
to
+962
| lit_mask_output="${lit_out_dir}/inpainting_mask.nii.gz" | ||
| lit_inpainting_result="${lit_out_dir}/inpainting_volumes/inpainting_result.nii.gz" |
|
|
||
| | directory | filename | module | description | | ||
| |:----------|----------|--------|-------------| | ||
| | inpainting/inpainting_volumes | inpainting_mask.nii.gz | lit | copy of the input lesion mask in FastSurfer image space (after any optional dilation) | |
| Examples | ||
| -------- | ||
| The documentation includes [6 detailed Examples](doc/overview/EXAMPLES.md) on how to use FastSurfer. | ||
| The documentation includes [6 detailed Examples](doc/overview/EXAMPLES.md) on how to use FastSurfer. |
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
This PR adds optional neuroLIT integration to FastSurfer for lesion-aware runs via
--lesion_mask.What changes
lit-inpaintingbefore VINN segmentation when--lesion_maskis providedlit-postprocessingafter segmentation / recon-surf to restore lesion-aware outputs and reports--keepgeomto neuroLIT in native-image mode--no_biasfieldbehavior by skipping only the segstats that are unsupported by the available inputs instead of crashingXDG_DATA_HOMEforneurolitTesting
neurolitwheel install and standalone CUDA inpainting passed--no_biasfieldpassed1.0x1.0x1.2--keepgeom --seg_onlyintegration passed and preserved image size / voxel size through the inpainted and downstream FastSurfer outputs--surf_only --lesion_maskcase fails early with a clear error if prior inpainting outputs are missing