Skip to content

Commit 3e95ba3

Browse files
committed
using afni.Automask instead of MaskTool
1 parent 91eb67b commit 3e95ba3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CPAC/func_preproc/func_motion.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,20 @@ def calc_motion_stats(wf, cfg, strat_pool, pipe_num, opt=None):
8888
"inputspec.motion_correct",
8989
)
9090

91-
try:
91+
if strat_pool.check_rpool("space-bold_desc-brain_mask"):
9292
wf.connect(
9393
*strat_pool.get_data("space-bold_desc-brain_mask"),
9494
gen_motion_stats,
9595
"inputspec.mask",
9696
)
97-
except:
98-
mask_bold = pe.Node(interface=afni.MaskTool(), name=f"mask_bold_{pipe_num}")
99-
mask_bold.inputs.outputtype = "NIFTI_GZ"
97+
else:
98+
automask = pe.Node(interface=afni.Automask(), name=f"automask_bold_{pipe_num}")
99+
automask.inputs.dilate = 1
100+
automask.inputs.outputtype = "NIFTI_GZ"
101+
100102
node, out = strat_pool.get_data("desc-preproc_bold")
101-
wf.connect(node, out, mask_bold, "in_file")
102-
wf.connect(mask_bold, "out_file", gen_motion_stats, "inputspec.mask")
103+
wf.connect(node, out, automask, "in_file")
104+
wf.connect(automask, "out_file", gen_motion_stats, "inputspec.mask")
103105

104106
wf.connect(
105107
*strat_pool.get_data("desc-movementParameters_motion"),

0 commit comments

Comments
 (0)