Skip to content

Commit

Permalink
Add logger for FastSurfer check
Browse files Browse the repository at this point in the history
Add logger for the check_fastsurfer function to indicate if evidence of FastSurfer surface recon was used to generate the given subjects_dir
  • Loading branch information
pcamach2 authored Apr 23, 2022
1 parent 1377f4c commit 9b6251f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion smriprep/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

0 comments on commit 9b6251f

Please sign in to comment.