Skip to content

Commit ac0e8e5

Browse files
committed
attempt to fix #3201
1 parent de72651 commit ac0e8e5

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

fmriprep/workflows/base.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def init_single_subject_wf(subject_id: str):
269269
subject_data=subject_data,
270270
anat_only=config.workflow.anat_only,
271271
subject_id=subject_id,
272+
anat_derivatives=anatomical_cache if anatomical_cache else None,
272273
),
273274
name='bidssrc',
274275
)
@@ -338,9 +339,24 @@ def init_single_subject_wf(subject_id: str):
338339
skull_strip_fixed_seed=config.workflow.skull_strip_fixed_seed,
339340
)
340341

342+
# allow to run with anat-fast-track on fMRI-only dataset
343+
if anatomical_cache and not subject_data['t1w']:
344+
workflow.connect([
345+
(bidssrc, bids_info, [(('bold', fix_multi_T1w_source_name), 'in_file')]),
346+
(anat_fit_wf, summary, [('outputnode.t1w_preproc', 't1w')]),
347+
(anat_fit_wf, ds_report_summary, [('outputnode.t1w_preproc', 'source_file')]),
348+
(anat_fit_wf, ds_report_about, [('outputnode.t1w_preproc', 'source_file')]),
349+
])
350+
else:
351+
workflow.connect([
352+
(bidssrc, bids_info, [(('t1w', fix_multi_T1w_source_name), 'in_file')]),
353+
(bidssrc, summary, [('t1w', 't1w')]),
354+
(bidssrc, ds_report_summary, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
355+
(bidssrc, ds_report_about, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
356+
])
357+
341358
workflow.connect([
342359
(inputnode, anat_fit_wf, [('subjects_dir', 'inputnode.subjects_dir')]),
343-
(bidssrc, bids_info, [(('t1w', fix_multi_T1w_source_name), 'in_file')]),
344360
(bidssrc, anat_fit_wf, [
345361
('t1w', 'inputnode.t1w'),
346362
('t2w', 'inputnode.t2w'),
@@ -350,10 +366,8 @@ def init_single_subject_wf(subject_id: str):
350366
(bids_info, anat_fit_wf, [(('subject', _prefix), 'inputnode.subject_id')]),
351367
# Reporting connections
352368
(inputnode, summary, [('subjects_dir', 'subjects_dir')]),
353-
(bidssrc, summary, [('t1w', 't1w'), ('t2w', 't2w'), ('bold', 'bold')]),
369+
(bidssrc, summary, [('t2w', 't2w'), ('bold', 'bold')]),
354370
(bids_info, summary, [('subject', 'subject_id')]),
355-
(bidssrc, ds_report_summary, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
356-
(bidssrc, ds_report_about, [(('t1w', fix_multi_T1w_source_name), 'source_file')]),
357371
(summary, ds_report_summary, [('out_report', 'in_file')]),
358372
(about, ds_report_about, [('out_report', 'in_file')]),
359373
]) # fmt:skip

0 commit comments

Comments
 (0)