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: Dilate BOLD mask by 2 voxels to prevent over-aggressive masking degrading T2* map estimation #2986

Merged
merged 1 commit into from
Apr 26, 2023
Merged
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
8 changes: 6 additions & 2 deletions fmriprep/workflows/bold/t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def init_bold_t2s_wf(

"""
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from niworkflows.interfaces.morphology import BinaryDilation

workflow = Workflow(name=name)
workflow.__desc__ = """\
Expand All @@ -105,15 +106,18 @@ def init_bold_t2s_wf(

LOGGER.log(25, 'Generating T2* map and optimally combined ME-EPI time series.')

dilate_mask = pe.Node(BinaryDilation(radius=2), name='dilate_mask')

t2smap_node = pe.Node(
T2SMap(echo_times=list(echo_times)),
name='t2smap_node',
mem_gb=2.5 * mem_gb * len(echo_times),
)
# fmt:off
workflow.connect([
(inputnode, t2smap_node, [('bold_file', 'in_files'),
('bold_mask', 'mask_file')]),
(inputnode, dilate_mask, [('bold_mask', 'in_mask')]),
(inputnode, t2smap_node, [('bold_file', 'in_files')]),
(dilate_mask, t2smap_node, [('out_mask', 'mask_file')]),
(t2smap_node, outputnode, [('optimal_comb', 'bold'),
('t2star_map', 't2star_map')]),
])
Expand Down