@@ -338,7 +338,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
338338"""
339339
340340 inputnode = pe .Node (niu .IdentityInterface (
341- fields = ['bold_file' , 'sbref_file' , ' subjects_dir' , 'subject_id' ,
341+ fields = ['bold_file' , 'subjects_dir' , 'subject_id' ,
342342 't1_preproc' , 't1_brain' , 't1_mask' , 't1_seg' , 't1_tpms' ,
343343 't1_aseg' , 't1_aparc' ,
344344 't1_2_mni_forward_transform' , 't1_2_mni_reverse_transform' ,
@@ -347,11 +347,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
347347 inputnode .inputs .bold_file = bold_file
348348 if sbref_file is not None :
349349 from niworkflows .interfaces .images import ValidateImage
350- val_sbref = pe .Node (ValidateImage (), name = 'val_sbref' )
351- val_sbref .inputs .in_file = sbref_file
352- workflow .connect ([
353- (val_sbref , inputnode , [('out_file' , 'sbref_file' )]),
354- ])
350+ val_sbref = pe .Node (ValidateImage (in_file = sbref_file ), name = 'val_sbref' )
355351
356352 outputnode = pe .Node (niu .IdentityInterface (
357353 fields = ['bold_t1' , 'bold_t1_ref' , 'bold_mask_t1' , 'bold_aseg_t1' , 'bold_aparc_t1' ,
@@ -420,6 +416,10 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
420416
421417 # Generate a tentative boldref
422418 bold_reference_wf = init_bold_reference_wf (omp_nthreads = omp_nthreads )
419+ if sbref_file is not None :
420+ workflow .connect ([
421+ (val_sbref , bold_reference_wf , [('out_file' , 'inputnode.sbref_file' )]),
422+ ])
423423
424424 # Top-level BOLD splitter
425425 bold_split = pe .Node (FSLSplit (dimension = 't' ), name = 'bold_split' ,
@@ -538,8 +538,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
538538 # MAIN WORKFLOW STRUCTURE #######################################################
539539 workflow .connect ([
540540 # Generate early reference
541- (inputnode , bold_reference_wf , [('bold_file' , 'inputnode.bold_file' ),
542- ('sbref_file' , 'inputnode.sbref_file' )]),
541+ (inputnode , bold_reference_wf , [('bold_file' , 'inputnode.bold_file' )]),
543542 # BOLD buffer has slice-time corrected if it was run, original otherwise
544543 (boldbuffer , bold_split , [('bold_file' , 'in_file' )]),
545544 # HMC
0 commit comments