@@ -314,6 +314,7 @@ def init_bold_wf(
314314
315315 if boldref_out or echos_out :
316316 ds_bold_native_wf = init_ds_bold_native_wf (
317+ source_file = bold_series ,
317318 bids_root = str (config .execution .bids_dir ),
318319 output_dir = fmriprep_dir ,
319320 bold_output = boldref_out ,
@@ -372,9 +373,14 @@ def init_bold_wf(
372373 for node in workflow .list_node_names ():
373374 if node .split ('.' )[- 1 ].startswith ('ds_report' ):
374375 workflow .get_node (node ).inputs .base_directory = fmriprep_dir
375- workflow .get_node (node ).inputs .source_file = bold_file
376376 return workflow
377377
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+
378384 # Resample to anatomical space
379385 bold_anat_wf = init_bold_volumetric_resample_wf (
380386 metadata = all_metadata [0 ],
@@ -404,18 +410,19 @@ def init_bold_wf(
404410 ('outputnode.bold_minimal' , 'inputnode.bold_file' ),
405411 ('outputnode.motion_xfm' , 'inputnode.motion_xfm' ),
406412 ]),
413+ (bold_fit_wf , merge_bold_sources , [('outputnode.coreg_boldref' , 'in2' )]),
407414 ]) # fmt:skip
408415
409416 # Full derivatives, including resampled BOLD series
410417 if nonstd_spaces .intersection (('anat' , 'T1w' )):
411418 ds_bold_t1_wf = init_ds_volumes_wf (
419+ source_file = bold_file ,
412420 bids_root = str (config .execution .bids_dir ),
413421 output_dir = fmriprep_dir ,
414422 multiecho = multiecho ,
415423 metadata = all_metadata [0 ],
416424 name = 'ds_bold_t1_wf' ,
417425 )
418- ds_bold_t1_wf .inputs .inputnode .source_files = bold_series
419426 ds_bold_t1_wf .inputs .inputnode .space = 'T1w'
420427
421428 workflow .connect ([
@@ -431,6 +438,7 @@ def init_bold_wf(
431438 ('outputnode.bold_file' , 'inputnode.bold' ),
432439 ('outputnode.resampling_reference' , 'inputnode.ref_file' ),
433440 ]),
441+ (merge_bold_sources , ds_bold_t1_wf , [('out' , 'inputnode.source_files' )]),
434442 ]) # fmt:skip
435443
436444 if spaces .cached .get_spaces (nonstandard = False , dim = (3 ,)):
@@ -446,13 +454,13 @@ def init_bold_wf(
446454 name = 'bold_std_wf' ,
447455 )
448456 ds_bold_std_wf = init_ds_volumes_wf (
457+ source_file = bold_file ,
449458 bids_root = str (config .execution .bids_dir ),
450459 output_dir = fmriprep_dir ,
451460 multiecho = multiecho ,
452461 metadata = all_metadata [0 ],
453462 name = 'ds_bold_std_wf' ,
454463 )
455- ds_bold_std_wf .inputs .inputnode .source_files = bold_series
456464
457465 workflow .connect ([
458466 (inputnode , bold_std_wf , [
@@ -492,6 +500,7 @@ def init_bold_wf(
492500 ('outputnode.bold_file' , 'inputnode.bold' ),
493501 ('outputnode.resampling_reference' , 'inputnode.ref_file' ),
494502 ]),
503+ (merge_bold_sources , ds_bold_std_wf , [('out' , 'inputnode.source_files' )]),
495504 ]) # fmt:skip
496505
497506 if config .workflow .run_reconall and freesurfer_spaces :
0 commit comments