From 9b6251ff4f1c71f80b80a24a40651cb09a93fd38 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:30:49 -0500 Subject: [PATCH] Add logger for FastSurfer check Add logger for the check_fastsurfer function to indicate if evidence of FastSurfer surface recon was used to generate the given subjects_dir --- smriprep/utils/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smriprep/utils/misc.py b/smriprep/utils/misc.py index a0988269af..a4d234e202 100644 --- a/smriprep/utils/misc.py +++ b/smriprep/utils/misc.py @@ -96,7 +96,7 @@ def fs_isRunning(subjects_dir, subject_id, mtime_tol=86400, logger=None): logger.warn(f'Removed "IsRunning*" files found under {subj_dir}') return subjects_dir -def check_fastsurfer(subjects_dir, subject_id): +def check_fastsurfer(subjects_dir, subject_id, logger=None): """ Checks FreeSurfer subjects dir for presence of files in mri/ with names indicating processing with FastSurfer, and returns a boolean fastsurfer_bool to indicate that FastSurfer is being used instead of Freesurfer. @@ -133,6 +133,8 @@ def check_fastsurfer(subjects_dir, subject_id): return fastsurfer_bool, subjects_dir else: fastsurfer_bool = True + if logger: + logger.warn(f'Evidence of FastSurfer processing found in {subj_dir}') noCCseglabel = Path(subj_dir / 'mri/aseg.auto_noCCseg.label_intensities.txt') noCCseglabel.touch(exist_ok=False) return fastsurfer_bool, subjects_dir