From c9a8b80883167e1008e7d7c1d2f745370a7bf9dc Mon Sep 17 00:00:00 2001 From: ClePol Date: Mon, 27 Apr 2026 11:28:00 +0200 Subject: [PATCH 1/4] Clarify no_biasfield HypVINN documentation --- README.md | 2 +- doc/scripts/RUN_FASTSURFER.md | 2 +- run_fastsurfer.sh | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d51224131..4cd859f80 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Modules (all run by default): - outputs a hypothalamic subsegmentation including 3rd ventricle, c. mammilare, fornix and optic tracts. - a T1w image is highly recommended ([notes on input images](#requirements-to-input-images)), supports high-res (up to 0.7mm, but experimental beyond that). - allows the additional passing of a T2w image with `--t2 `, which will be registered to the T1w image (see `--reg_mode` option). - - calculates volume statistics corrected for partial volume effects based on the T1w image (skipped if `--no_biasfield` is passed). + - calculates summary statistics based on the T1w image; biasfield-corrected inputs are recommended for best results. ### Surface reconstruction - approximately 60-90 minutes, `--surf_only` runs only [the surface part](recon_surf/README.md). diff --git a/doc/scripts/RUN_FASTSURFER.md b/doc/scripts/RUN_FASTSURFER.md index 62108e322..9e869749a 100644 --- a/doc/scripts/RUN_FASTSURFER.md +++ b/doc/scripts/RUN_FASTSURFER.md @@ -40,7 +40,7 @@ Optional arguments * `--no_hypothal`: Skip the hypothalamus segmentation. * `--no_cc`: Skip the segmentation and analysis of the corpus callosum. * `--cereb_segfile`: Name of the cerebellum segmentation file. If not provided, this intermediate DL-based segmentation will not be stored, but only the merged segmentation will be stored (see --main_segfile ). Requires an ABSOLUTE Path! Default location: \$SUBJECTS_DIR/\$sid/mri/cerebellum.CerebNet.nii.gz -* `--no_biasfield`: Deactivate the biasfield correction and calculation of partial volume-corrected statistics in the segmentation modules. +* `--no_biasfield`: Deactivate the biasfield correction and calculation of partial volume-corrected statistics in the segmentation modules. HypVINN still runs, but biasfield-corrected inputs are recommended. * `--native_image` or `--keepgeom`: **Only supported for `--seg_only`**, segment in native image space (keep orientation, image size and voxel size of the input image), this also includes experimental support for anisotropic images (no extreme anisotropy). ### Surface pipeline arguments diff --git a/run_fastsurfer.sh b/run_fastsurfer.sh index b3b6185d5..b10067317 100755 --- a/run_fastsurfer.sh +++ b/run_fastsurfer.sh @@ -168,8 +168,8 @@ SEGMENTATION PIPELINE: image will be saved. Requires an ABSOLUTE Path! Default location: \$SUBJECTS_DIR/\$sid/mri/orig.mgz. - --no_biasfield Create a bias field corrected image and enable the - calculation of partial volume-corrected stats-files. + --no_biasfield Deactivate bias field correction and the calculation of + partial volume-corrected stats-files. --norm_name Name of the biasfield corrected image Default location: \$SUBJECTS_DIR/\$sid/mri/orig_nu.mgz @@ -223,11 +223,11 @@ SEGMENTATION PIPELINE: HYPOTHALAMUS MODULE (HypVINN): --no_hypothal Skip the hypothalamus segmentation. - --no_biasfield This option implies --no_hypothal, as the hypothalamus - sub-segmentation requires biasfield-corrected images. + --no_biasfield Biasfield-corrected inputs are recommended for the + hypothalamus sub-segmentation, but not required. --t2 *Optional* T2 full head input (does not have to be bias - corrected, a mandatory biasfield correction step is - performed). Requires an ABSOLUTE Path! + corrected; FastSurfer preprocesses it before HypVINN). + Requires an ABSOLUTE Path! --reg_mode Ignored, if no T2 image is passed. Specifies the registration method used to register T1 From 214fc425abca2a8bfc2257454104410ac785c5f3 Mon Sep 17 00:00:00 2001 From: ClePol Date: Mon, 27 Apr 2026 11:29:50 +0200 Subject: [PATCH 2/4] Pass conformed T2 to HypVINN when biasfield is disabled --- run_fastsurfer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_fastsurfer.sh b/run_fastsurfer.sh index b10067317..12e36933b 100755 --- a/run_fastsurfer.sh +++ b/run_fastsurfer.sh @@ -1290,7 +1290,7 @@ then echo " with the hypothal module!" } | tee -a "$seg_log" cmd+=("$t1") - if [[ -n "$t2" ]] ; then cmd+=(--t2 "$t2") ; fi + if [[ -n "$t2" ]] ; then cmd+=(--t2 "$norm_name_t2") ; fi fi echo_quoted "${cmd[@]}" | tee -a "$seg_log" "${wrap[@]}" "${cmd[@]}" # no tee, directly logging to $seg_log From 609da623354f0f666b2f665ce926c79af91c877f Mon Sep 17 00:00:00 2001 From: ClePol Date: Mon, 27 Apr 2026 11:50:58 +0200 Subject: [PATCH 3/4] Check asegdkt module flag explicitly --- run_fastsurfer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_fastsurfer.sh b/run_fastsurfer.sh index 12e36933b..d5e721bf6 100755 --- a/run_fastsurfer.sh +++ b/run_fastsurfer.sh @@ -1045,7 +1045,7 @@ then fi fi - if [[ "$run_asegdkt_module" ]] + if [[ "$run_asegdkt_module" == "true" ]] then mask_name_manedit=$(add_file_suffix "$mask_name" "manedit") if [[ -e "$mask_name_manedit" ]] ; then mask_name="$mask_name_manedit" ; fi From 5bbd833ea2e50f307c6f764993f415c80f2cb130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BCgler?= Date: Wed, 29 Apr 2026 12:34:35 +0200 Subject: [PATCH 4/4] Review changes --- README.md | 2 +- doc/scripts/RUN_FASTSURFER.md | 2 +- run_fastsurfer.sh | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4cd859f80..02ff81d6b 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Modules (all run by default): - outputs a hypothalamic subsegmentation including 3rd ventricle, c. mammilare, fornix and optic tracts. - a T1w image is highly recommended ([notes on input images](#requirements-to-input-images)), supports high-res (up to 0.7mm, but experimental beyond that). - allows the additional passing of a T2w image with `--t2 `, which will be registered to the T1w image (see `--reg_mode` option). - - calculates summary statistics based on the T1w image; biasfield-corrected inputs are recommended for best results. + - calculates summary statistics based on the biasfield-corrected T1w image (skipped if `--no_biasfield` is passed). ### Surface reconstruction - approximately 60-90 minutes, `--surf_only` runs only [the surface part](recon_surf/README.md). diff --git a/doc/scripts/RUN_FASTSURFER.md b/doc/scripts/RUN_FASTSURFER.md index 9e869749a..5c2a37179 100644 --- a/doc/scripts/RUN_FASTSURFER.md +++ b/doc/scripts/RUN_FASTSURFER.md @@ -40,7 +40,7 @@ Optional arguments * `--no_hypothal`: Skip the hypothalamus segmentation. * `--no_cc`: Skip the segmentation and analysis of the corpus callosum. * `--cereb_segfile`: Name of the cerebellum segmentation file. If not provided, this intermediate DL-based segmentation will not be stored, but only the merged segmentation will be stored (see --main_segfile ). Requires an ABSOLUTE Path! Default location: \$SUBJECTS_DIR/\$sid/mri/cerebellum.CerebNet.nii.gz -* `--no_biasfield`: Deactivate the biasfield correction and calculation of partial volume-corrected statistics in the segmentation modules. HypVINN still runs, but biasfield-corrected inputs are recommended. +* `--no_biasfield`: Deactivate the biasfield correction and calculation of partial volume-corrected statistics in the segmentation modules. HypVINN does run but expects that biasfields are corrected externally. * `--native_image` or `--keepgeom`: **Only supported for `--seg_only`**, segment in native image space (keep orientation, image size and voxel size of the input image), this also includes experimental support for anisotropic images (no extreme anisotropy). ### Surface pipeline arguments diff --git a/run_fastsurfer.sh b/run_fastsurfer.sh index d5e721bf6..b379a820a 100755 --- a/run_fastsurfer.sh +++ b/run_fastsurfer.sh @@ -224,10 +224,11 @@ SEGMENTATION PIPELINE: HYPOTHALAMUS MODULE (HypVINN): --no_hypothal Skip the hypothalamus segmentation. --no_biasfield Biasfield-corrected inputs are recommended for the - hypothalamus sub-segmentation, but not required. - --t2 *Optional* T2 full head input (does not have to be bias - corrected; FastSurfer preprocesses it before HypVINN). - Requires an ABSOLUTE Path! + hypothalamus sub-segmentation. This option implies images + were corrected externally. + --t2 *Optional* T2 full head input (must be externally biasfield + corrected when called with --no_biasfield). Requires an + ABSOLUTE Path! --reg_mode Ignored, if no T2 image is passed. Specifies the registration method used to register T1