@@ -338,15 +338,16 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
338
338
"""
339
339
340
340
inputnode = pe .Node (niu .IdentityInterface (
341
- fields = ['bold_file' , 'sbref_file' , ' subjects_dir' , 'subject_id' ,
341
+ fields = ['bold_file' , 'subjects_dir' , 'subject_id' ,
342
342
't1_preproc' , 't1_brain' , 't1_mask' , 't1_seg' , 't1_tpms' ,
343
343
't1_aseg' , 't1_aparc' ,
344
344
't1_2_mni_forward_transform' , 't1_2_mni_reverse_transform' ,
345
345
't1_2_fsnative_forward_transform' , 't1_2_fsnative_reverse_transform' ]),
346
346
name = 'inputnode' )
347
347
inputnode .inputs .bold_file = bold_file
348
348
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' )
350
351
351
352
outputnode = pe .Node (niu .IdentityInterface (
352
353
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,
415
416
416
417
# Generate a tentative boldref
417
418
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
+ ])
418
423
419
424
# Top-level BOLD splitter
420
425
bold_split = pe .Node (FSLSplit (dimension = 't' ), name = 'bold_split' ,
@@ -533,8 +538,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
533
538
# MAIN WORKFLOW STRUCTURE #######################################################
534
539
workflow .connect ([
535
540
# 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' )]),
538
542
# BOLD buffer has slice-time corrected if it was run, original otherwise
539
543
(boldbuffer , bold_split , [('bold_file' , 'in_file' )]),
540
544
# HMC
0 commit comments