-
Notifications
You must be signed in to change notification settings - Fork 437
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
BF: fixed problem with NANs in odfdeconv #407
Conversation
@@ -450,6 +450,9 @@ def odf_deconv(odf_sh, R, B_reg, lambda_=1., tau=0.1, r2_term=False): | |||
Distributions | |||
.. [3] Descoteaux, M, PhD thesis, INRIA Sophia-Antipolis, 2008. | |||
""" | |||
if np.sum(np.isnan(odf_sh)) > 0: |
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.
You might also go with:
if np.any(np.isnan(odf_sh)):
I find that slightly clearer
Do you understand under what conditions |
Yeah, it's division by zero. When the odf_sh is divided by Z. |
Cool - maybe add a comment on the first line of the function, right before On Wed, Aug 13, 2014 at 12:06 PM, Eleftherios Garyfallidis <
|
I think it speaks by itself no? |
I don't think so, which is why I asked (but I am generally quite slow). I suggest something like:
Did I get that right? |
Nearly, there @arokem. This affects only the Sharpening Deconvolution transform not the CSD. Happy? |
BF: fixed problem with NANs in odfdeconv
Yes - very happy |
Added tests and fix for calculation of odf_deconv when NANs are present.
This was identified by Dr. Jan Schreiber as reported in the mailing list. See discussion here: http://mail.scipy.org/pipermail/nipy-devel/2014-August/010419.html