Skip to content

Commit

Permalink
Removes fastsurfer_bool
Browse files Browse the repository at this point in the history
Removes currently unused fastsurfer_bool variable
  • Loading branch information
pcamach2 authored Apr 23, 2022
1 parent f301f3a commit f90738a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions smriprep/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ def fs_isRunning(subjects_dir, subject_id, mtime_tol=86400, logger=None):
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.
For development purposes, this also touches files that are expected outputs of Freesurfer,
but not produced by default in FastSurfer.
this also touches files that are expected outputs of Freesurfer, but not produced by default in FastSurfer.
Parameters
----------
Expand All @@ -113,7 +110,6 @@ def check_fastsurfer(subjects_dir, subject_id, logger=None):
Returns
-------
fastsurfer_bool : Boolean
subjects_dir : os.PathLike or None
Expand All @@ -124,17 +120,16 @@ def check_fastsurfer(subjects_dir, subject_id, logger=None):
return subjects_dir
subj_dir = Path(subjects_dir) / subject_id
if not subj_dir.exists():

return subjects_dir

fastsurferfiles = tuple(subj_dir.glob("mri/*deep*mgz"))
if not fastsurferfiles:
fastsurfer_bool = False
return fastsurfer_bool, subjects_dir
return 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
return subjects_dir

0 comments on commit f90738a

Please sign in to comment.