Skip to content

Commit

Permalink
fix: Use consistent skull-stripping pre- and post- SDC
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Dec 19, 2024
1 parent 910c232 commit 3833723
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import nibabel as nb
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe
from niworkflows.func.util import init_enhance_and_skullstrip_bold_wf
from niworkflows.func.util import init_enhance_and_skullstrip_bold_wf, init_skullstrip_bold_wf
from niworkflows.interfaces.header import ValidateImage
from niworkflows.interfaces.nitransforms import ConcatenateXFMs
from niworkflows.interfaces.utility import KeySelect
Expand Down Expand Up @@ -553,7 +553,8 @@ def init_bold_fit_wf(
)
unwarp_wf.inputs.inputnode.metadata = layout.get_metadata(bold_file)

# fmt:off
skullstrip_bold_wf = init_skullstrip_bold_wf()

workflow.connect([
(inputnode, fmap_select, [
('fmap_ref', 'fmap_ref'),
Expand All @@ -578,28 +579,28 @@ def init_bold_fit_wf(
(unwarp_wf, ds_coreg_boldref_wf, [
('outputnode.corrected', 'inputnode.boldref'),
]),
(unwarp_wf, ds_boldmask_wf, [
('outputnode.corrected_mask', 'inputnode.boldmask'),
(unwarp_wf, skullstrip_bold_wf, [
('outputnode.corrected', 'inputnode.in_file'),
]),
(skullstrip_bold_wf, ds_boldmask_wf, [
('outputnode.mask_file', 'inputnode.boldmask'),
]),
(fmap_select, func_fit_reports_wf, [('fmap_ref', 'inputnode.fmap_ref')]),
(fmap_select, summary, [('sdc_method', 'distortion_correction')]),
(fmapreg_buffer, func_fit_reports_wf, [
('boldref2fmap_xfm', 'inputnode.boldref2fmap_xfm'),
]),
(unwarp_wf, func_fit_reports_wf, [('outputnode.fieldmap', 'inputnode.fieldmap')]),
])
# fmt:on
]) # fmt:skip
else:
# fmt:off
workflow.connect([
(enhance_boldref_wf, ds_coreg_boldref_wf, [
('outputnode.bias_corrected_file', 'inputnode.boldref'),
]),
(enhance_boldref_wf, ds_boldmask_wf, [
('outputnode.mask_file', 'inputnode.boldmask'),
]),
])
# fmt:on
]) # fmt:skip
else:
config.loggers.workflow.info('Found coregistration reference - skipping Stage 3')
regref_buffer.inputs.boldref = precomputed['coreg_boldref']
Expand Down

0 comments on commit 3833723

Please sign in to comment.