@@ -314,6 +314,7 @@ def init_bold_wf(
314
314
315
315
if boldref_out or echos_out :
316
316
ds_bold_native_wf = init_ds_bold_native_wf (
317
+ source_file = bold_series ,
317
318
bids_root = str (config .execution .bids_dir ),
318
319
output_dir = fmriprep_dir ,
319
320
bold_output = boldref_out ,
@@ -372,9 +373,14 @@ def init_bold_wf(
372
373
for node in workflow .list_node_names ():
373
374
if node .split ('.' )[- 1 ].startswith ('ds_report' ):
374
375
workflow .get_node (node ).inputs .base_directory = fmriprep_dir
375
- workflow .get_node (node ).inputs .source_file = bold_file
376
376
return workflow
377
377
378
+ # Pass along BOLD reference as a source file for provenance
379
+ merge_bold_sources = pe .Node (
380
+ niu .Merge (2 ), name = 'merge_bold_sources' , run_without_submitting = True
381
+ )
382
+ merge_bold_sources .inputs .in1 = bold_series
383
+
378
384
# Resample to anatomical space
379
385
bold_anat_wf = init_bold_volumetric_resample_wf (
380
386
metadata = all_metadata [0 ],
@@ -404,18 +410,19 @@ def init_bold_wf(
404
410
('outputnode.bold_minimal' , 'inputnode.bold_file' ),
405
411
('outputnode.motion_xfm' , 'inputnode.motion_xfm' ),
406
412
]),
413
+ (bold_fit_wf , merge_bold_sources , [('outputnode.coreg_boldref' , 'in2' )]),
407
414
]) # fmt:skip
408
415
409
416
# Full derivatives, including resampled BOLD series
410
417
if nonstd_spaces .intersection (('anat' , 'T1w' )):
411
418
ds_bold_t1_wf = init_ds_volumes_wf (
419
+ source_file = bold_file ,
412
420
bids_root = str (config .execution .bids_dir ),
413
421
output_dir = fmriprep_dir ,
414
422
multiecho = multiecho ,
415
423
metadata = all_metadata [0 ],
416
424
name = 'ds_bold_t1_wf' ,
417
425
)
418
- ds_bold_t1_wf .inputs .inputnode .source_files = bold_series
419
426
ds_bold_t1_wf .inputs .inputnode .space = 'T1w'
420
427
421
428
workflow .connect ([
@@ -431,6 +438,7 @@ def init_bold_wf(
431
438
('outputnode.bold_file' , 'inputnode.bold' ),
432
439
('outputnode.resampling_reference' , 'inputnode.ref_file' ),
433
440
]),
441
+ (merge_bold_sources , ds_bold_t1_wf , [('out' , 'inputnode.source_files' )]),
434
442
]) # fmt:skip
435
443
436
444
if spaces .cached .get_spaces (nonstandard = False , dim = (3 ,)):
@@ -446,13 +454,13 @@ def init_bold_wf(
446
454
name = 'bold_std_wf' ,
447
455
)
448
456
ds_bold_std_wf = init_ds_volumes_wf (
457
+ source_file = bold_file ,
449
458
bids_root = str (config .execution .bids_dir ),
450
459
output_dir = fmriprep_dir ,
451
460
multiecho = multiecho ,
452
461
metadata = all_metadata [0 ],
453
462
name = 'ds_bold_std_wf' ,
454
463
)
455
- ds_bold_std_wf .inputs .inputnode .source_files = bold_series
456
464
457
465
workflow .connect ([
458
466
(inputnode , bold_std_wf , [
@@ -492,6 +500,7 @@ def init_bold_wf(
492
500
('outputnode.bold_file' , 'inputnode.bold' ),
493
501
('outputnode.resampling_reference' , 'inputnode.ref_file' ),
494
502
]),
503
+ (merge_bold_sources , ds_bold_std_wf , [('out' , 'inputnode.source_files' )]),
495
504
]) # fmt:skip
496
505
497
506
if config .workflow .run_reconall and freesurfer_spaces :
0 commit comments