From e3b16b2bf923a045aaee94292d045c5c2463ff75 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 10 Apr 2023 11:28:08 -0400 Subject: [PATCH] FIX: Dilate BOLD mask by 2 voxels to allow for over-aggressive masking --- fmriprep/workflows/bold/t2s.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fmriprep/workflows/bold/t2s.py b/fmriprep/workflows/bold/t2s.py index 997c1ecef..2d3a26053 100644 --- a/fmriprep/workflows/bold/t2s.py +++ b/fmriprep/workflows/bold/t2s.py @@ -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__ = """\ @@ -105,6 +106,8 @@ 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', @@ -112,8 +115,9 @@ def init_bold_t2s_wf( ) # 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')]), ])