Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use consistent skull-stripping pre- and post- SDC #3415

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading