Skip to content

Commit

Permalink
Write out boldref-space brain mask.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed May 18, 2024
1 parent ca6006c commit 6b8ea44
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
# BOLD workflows
from .hmc import init_bold_hmc_wf
from .outputs import (
init_ds_boldmask_wf,
init_ds_boldref_wf,
init_ds_hmc_wf,
init_ds_registration_wf,
Expand Down Expand Up @@ -467,13 +468,20 @@ def init_bold_fit_wf(
desc='coreg',
name='ds_coreg_boldref_wf',
)
ds_boldmask_wf = init_ds_boldmask_wf(
bids_root=layout.root,
output_dir=config.execution.fmriprep_dir,
desc='brain',
name='ds_boldmask_wf',
)

# fmt:off
workflow.connect([
(hmcref_buffer, fmapref_buffer, [("boldref", "boldref_files")]),
(fmapref_buffer, enhance_boldref_wf, [("out", "inputnode.in_file")]),
(fmapref_buffer, ds_coreg_boldref_wf, [("out", "inputnode.source_files")]),
(ds_coreg_boldref_wf, regref_buffer, [("outputnode.boldref", "boldref")]),
(ds_boldmask_wf, regref_buffer, [('outputnode.boldmask', 'boldmask')]),
(fmapref_buffer, func_fit_reports_wf, [("out", "inputnode.sdc_boldref")]),
])
# fmt:on
Expand Down Expand Up @@ -557,8 +565,8 @@ def init_bold_fit_wf(
(unwarp_wf, ds_coreg_boldref_wf, [
('outputnode.corrected', 'inputnode.boldref'),
]),
(unwarp_wf, regref_buffer, [
('outputnode.corrected_mask', 'boldmask'),
(unwarp_wf, ds_boldmask_wf, [
('outputnode.corrected_mask', 'inputnode.boldmask'),
]),
(fmap_select, func_fit_reports_wf, [("fmap_ref", "inputnode.fmap_ref")]),
(fmap_select, summary, [("sdc_method", "distortion_correction")]),
Expand All @@ -574,8 +582,8 @@ def init_bold_fit_wf(
(enhance_boldref_wf, ds_coreg_boldref_wf, [
('outputnode.bias_corrected_file', 'inputnode.boldref'),
]),
(enhance_boldref_wf, regref_buffer, [
('outputnode.mask_file', 'boldmask'),
(enhance_boldref_wf, ds_boldmask_wf, [
('outputnode.mask_file', 'inputnode.boldmask'),
]),
])
# fmt:on
Expand Down

0 comments on commit 6b8ea44

Please sign in to comment.