Skip to content

Commit 34edca0

Browse files
committed
feat: Disable session in FS subject ID in legacy mode
1 parent 753a436 commit 34edca0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fmriprep/workflows/base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ def init_single_subject_wf(
410410
(about, ds_report_about, [('out_report', 'in_file')]),
411411
]) # fmt:skip
412412

413+
if config.workflow.fs_legacy_id:
414+
config.loggers.workflow.info(f'Using legacy FreeSurfer subject ID: sub-{subject_id}')
415+
if config.workflow.subject_anatomical_reference == 'sessionwise' and session_id is not None:
416+
msg = 'Session-wise anatomical reference is incompatible with legacy FreeSurfer subject IDs.'
417+
config.loggers.workflow.error(msg)
418+
raise RuntimeError(msg)
419+
workflow.disconnect(bids_info, create_fs_id, [('session', 'session_id')])
420+
413421
# Set up the template iterator once, if used
414422
template_iterator_wf = None
415423
select_MNI2009c_xfm = None

0 commit comments

Comments
 (0)