Skip to content

Commit 8b0838a

Browse files
authored
Merge pull request #166 from oesteban/enh/N4-num_threads
[ENH] Give access to num_threads of N4BiasFieldCorrection
2 parents 66c126d + 1e62f2f commit 8b0838a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

niworkflows/anat/skullstrip.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from nipype.interfaces import utility as niu
77
from nipype.pipeline import engine as pe
88

9-
def afni_wf(name='AFNISkullStripWorkflow', unifize=False):
9+
10+
def afni_wf(name='AFNISkullStripWorkflow', unifize=False, n4_nthreads=1):
1011
"""
1112
Skull-stripping workflow
1213
@@ -26,8 +27,11 @@ def afni_wf(name='AFNISkullStripWorkflow', unifize=False):
2627
outputnode = pe.Node(niu.IdentityInterface(
2728
fields=['bias_corrected', 'out_file', 'out_mask', 'bias_image']), name='outputnode')
2829

29-
inu_n4 = pe.Node(ants.N4BiasFieldCorrection(dimension=3, save_bias=True),
30-
name='CorrectINU')
30+
inu_n4 = pe.Node(
31+
ants.N4BiasFieldCorrection(dimension=3, save_bias=True, num_threads=n4_nthreads),
32+
n_procs=n4_nthreads,
33+
name='inu_n4')
34+
3135
sstrip = pe.Node(afni.SkullStrip(outputtype='NIFTI_GZ'), name='skullstrip')
3236
sstrip_orig_vol = pe.Node(afni.Calc(
3337
expr='a*step(b)', outputtype='NIFTI_GZ'), name='sstrip_orig_vol')

0 commit comments

Comments
 (0)