-
Notifications
You must be signed in to change notification settings - Fork 53
[ENH] Give access to num_threads of N4BiasFieldCorrection #166
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
Conversation
Defaults to 1 (keep current behavior). N4BiasFieldCorrection is part of ANTs and the number of threads are controlled in the same way you'd do with antsRegistration.
niworkflows/anat/skullstrip.py
Outdated
@@ -23,7 +23,8 @@ def afni_wf(name='AFNISkullStripWorkflow'): | |||
outputnode = pe.Node(niu.IdentityInterface( | |||
fields=['bias_corrected', 'out_file', 'out_mask', 'bias_image']), name='outputnode') | |||
|
|||
inu_n4 = pe.Node(ants.N4BiasFieldCorrection(dimension=3, save_bias=True), | |||
inu_n4 = pe.Node(ants.N4BiasFieldCorrection( | |||
dimension=3, save_bias=True, num_threads=n4_nthreads), num_threads=n4_nthreads, | |||
name='CorrectINU') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node
takes an n_procs
parameter, not num_threads
. Also PEP8 fix for white space:
inu_n4 = pe.Node(
ants.N4BiasFieldCorrection(dimension=3, save_bias=True, num_threads=n4_nthreads),
n_procs=n4_threads,
name='inu_n4')
And should we be copying the header, as in fmriprep? Maybe it would make sense to move that here, and thread in the n4_threads
?
niworkflows/anat/skullstrip.py
Outdated
ants.N4BiasFieldCorrection(dimension=3, save_bias=True, num_threads=n4_nthreads), | ||
n_procs=n4_nthreads, | ||
name='inu_n4') | ||
orig_hdr = pe.Node(CopyHeader(), name='orig_hdr') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orig_hdr
has no in_file
input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, just noticed (f57c315)
Very prompt fix. |
We could avoid issues like the above by pulling the whole |
That would create a circular dependency between both. IMHO, the permanent solution to this would be to include the feature (with a proper boolean switch) in the |
I read this as "moving" |
Oh, ok, my bad. |
Let's make it easier: nipy/nipype#2034 EDIT: I'll roll back this PR, so that it only works on the number of threads. |
Defaults to 1 (keep current behavior). N4BiasFieldCorrection is part
of ANTs and the number of threads are controlled in the same way you'd
do with antsRegistration.