def _mri_subject_has_bem(subject, subjects_dir=None):
 subjects_dir = get_subjects_dir(subjects_dir, raise_error=True)
 pattern = bem_fname.format(subjects_dir=subjects_dir, subject=subject, name='*-bem')
 fnames = glob(pattern)
 return bool(len(fnames))

def _mri_subject_has_bem ( subject , subjects_dir = None ) : subjects_dir = get_subjects_dir ( subjects_dir , raise_error = True ) pattern = bem_fname . format ( subjects_dir = subjects_dir , subject = subject , name = '*-bem' ) fnames = glob ( pattern ) return bool ( len ( fnames ) )
check whether an mri subject has a file matching the bem pattern .