@@ -338,15 +338,16 @@ 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' ,
345345 't1_2_fsnative_forward_transform' , 't1_2_fsnative_reverse_transform' ]),
346346 name = 'inputnode' )
347347 inputnode .inputs .bold_file = bold_file
348348 if sbref_file is not None :
349- inputnode .inputs .sbref_file = sbref_file
349+ from niworkflows .interfaces .images import ValidateImage
350+ val_sbref = pe .Node (ValidateImage (in_file = sbref_file ), name = 'val_sbref' )
350351
351352 outputnode = pe .Node (niu .IdentityInterface (
352353 fields = ['bold_t1' , 'bold_t1_ref' , 'bold_mask_t1' , 'bold_aseg_t1' , 'bold_aparc_t1' ,
@@ -415,6 +416,10 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
415416
416417 # Generate a tentative boldref
417418 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+ ])
418423
419424 # Top-level BOLD splitter
420425 bold_split = pe .Node (FSLSplit (dimension = 't' ), name = 'bold_split' ,
@@ -533,8 +538,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
533538 # MAIN WORKFLOW STRUCTURE #######################################################
534539 workflow .connect ([
535540 # Generate early reference
536- (inputnode , bold_reference_wf , [('bold_file' , 'inputnode.bold_file' ),
537- ('sbref_file' , 'inputnode.sbref_file' )]),
541+ (inputnode , bold_reference_wf , [('bold_file' , 'inputnode.bold_file' )]),
538542 # BOLD buffer has slice-time corrected if it was run, original otherwise
539543 (boldbuffer , bold_split , [('bold_file' , 'in_file' )]),
540544 # HMC
0 commit comments