2727import nibabel as nb
2828from nipype .interfaces import utility as niu
2929from nipype .pipeline import engine as pe
30- from niworkflows .func .util import init_enhance_and_skullstrip_bold_wf
30+ from niworkflows .func .util import init_enhance_and_skullstrip_bold_wf , init_skullstrip_bold_wf
3131from niworkflows .interfaces .header import ValidateImage
3232from niworkflows .interfaces .nitransforms import ConcatenateXFMs
3333from niworkflows .interfaces .utility import KeySelect
@@ -553,7 +553,8 @@ def init_bold_fit_wf(
553553 )
554554 unwarp_wf .inputs .inputnode .metadata = layout .get_metadata (bold_file )
555555
556- # fmt:off
556+ skullstrip_bold_wf = init_skullstrip_bold_wf ()
557+
557558 workflow .connect ([
558559 (inputnode , fmap_select , [
559560 ('fmap_ref' , 'fmap_ref' ),
@@ -578,28 +579,28 @@ def init_bold_fit_wf(
578579 (unwarp_wf , ds_coreg_boldref_wf , [
579580 ('outputnode.corrected' , 'inputnode.boldref' ),
580581 ]),
581- (unwarp_wf , ds_boldmask_wf , [
582- ('outputnode.corrected_mask' , 'inputnode.boldmask' ),
582+ (unwarp_wf , skullstrip_bold_wf , [
583+ ('outputnode.corrected' , 'inputnode.in_file' ),
584+ ]),
585+ (skullstrip_bold_wf , ds_boldmask_wf , [
586+ ('outputnode.mask_file' , 'inputnode.boldmask' ),
583587 ]),
584588 (fmap_select , func_fit_reports_wf , [('fmap_ref' , 'inputnode.fmap_ref' )]),
585589 (fmap_select , summary , [('sdc_method' , 'distortion_correction' )]),
586590 (fmapreg_buffer , func_fit_reports_wf , [
587591 ('boldref2fmap_xfm' , 'inputnode.boldref2fmap_xfm' ),
588592 ]),
589593 (unwarp_wf , func_fit_reports_wf , [('outputnode.fieldmap' , 'inputnode.fieldmap' )]),
590- ])
591- # fmt:on
594+ ]) # fmt:skip
592595 else :
593- # fmt:off
594596 workflow .connect ([
595597 (enhance_boldref_wf , ds_coreg_boldref_wf , [
596598 ('outputnode.bias_corrected_file' , 'inputnode.boldref' ),
597599 ]),
598600 (enhance_boldref_wf , ds_boldmask_wf , [
599601 ('outputnode.mask_file' , 'inputnode.boldmask' ),
600602 ]),
601- ])
602- # fmt:on
603+ ]) # fmt:skip
603604 else :
604605 config .loggers .workflow .info ('Found coregistration reference - skipping Stage 3' )
605606 regref_buffer .inputs .boldref = precomputed ['coreg_boldref' ]
0 commit comments