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
Dipy.align.reslice: either swallow the scipy warning or rework to avoid it #1107
Comments
Yes: I like option 2 better too. Presumably changing this line? https://github.com/nipy/dipy/blob/master/dipy/align/reslice.py#L71 to the following?
|
Changing to
|
Yes. I must have gotten that wrong. @jchoude : what would you suggest here? |
So I would suggest against changing it back to a 2D array, since that will increase computation time of |
Sorry for the delay. I don't mind leaving it as a 1D array. However, what was not clear to me was the potential difference in behavior between Scipy 0.17.1 and 0.18 when supplying a 1D array, exactly in the same doc that @dimrozakis pointed out. Currently, our behavior is consistent, since the offset that we pass is always np.zeros(3,). We might simply need to ensure that we don't change the offset, else the result might not be consistent between versions of scipy. |
When calling dipy.align.reslice and use scipy 0.17.1, we get the following UserWarning:
This is caused by a change in behavior from Scipy, between 0.17.1 and 0.18, as explained in Scipy's doc.
For us, there won't be any consequence, since the behavior won't change, because we do not use the
offset
parameter. However, the warning might be misleading or simply distracting for end users, and it will still be present in scipy 0.18. That means that it will pollute our logs for a long time.Two ideas:
1- Swallow the warning by using something like this (as was suggested in issue #641 )
2- Simply reformat the matrix we send as a diagonal matrix, which will provide exactly the same behavior, without the warning.
I would go for option 2, but would like to have some other advice before proceeding @Garyfallidis @arokem
The text was updated successfully, but these errors were encountered: