Skip to content
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

Faster spherical harmonics #413

Merged
merged 6 commits into from Sep 16, 2014
Merged

Conversation

Garyfallidis
Copy link
Contributor

Thanx @ChantalTax, @pv and @stefanv for helping with this. Here is a faster implementation of spherical harmonics. This should make the calculation of real spherical harmonics and complex spherical harmonics faster everywhere in dipy.

Let me know what you think! This is now 100X faster. :D

def spherical_harmonics(m, n, theta, phi):
r""" Compute spherical harmonics

This may take scalar or array arguments. The inputs will be broadcasted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks awesome to me. My only comment is an English thing: I believe this should be simply broadcast

http://www.oed.com/view/Entry/23508?redirectedFrom=broadcasted#eid13325489

Also - what exactly do you mean by "inputs will be broadcast against each other"? theta and phi will be made to conform if they can be broadcast to each other's shape?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used what it was in the documentation of scipy.special.sph_harm
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.special.sph_harm.html

I think it is fine to say broadcasted. Even if it is not in some dictionaries. It is commonly used.

@MrBago
Copy link
Contributor

MrBago commented Sep 5, 2014

Any thoughts about pushing this upstream to scipy? Is there any reason that the larger scipy community would not want to benefit from this awesomeness? Or is this already in the latest scipy and I don't know about it?

@arokem
Copy link
Contributor

arokem commented Sep 6, 2014

BTW - any idea why Travis is seg-faulting on this one? Seems like just a
glitch - I don't get that on my machine.

On Fri, Sep 5, 2014 at 5:01 PM, Ariel Rokem arokem@gmail.com wrote:

Seems like that's already happening. See @stefanv's comments on gh-404.

On Fri, Sep 5, 2014 at 3:01 PM, MrBago notifications@github.com wrote:

Any thoughts about pushing this upstream to scipy? Is there any reason
that the larger scipy community would not want to benefit from this
awesomeness?


Reply to this email directly or view it on GitHub
#413 (comment).

@arokem
Copy link
Contributor

arokem commented Sep 6, 2014

Seems like that's already happening. See @stefanv's comments on gh-404.

On Fri, Sep 5, 2014 at 3:01 PM, MrBago notifications@github.com wrote:

Any thoughts about pushing this upstream to scipy? Is there any reason
that the larger scipy community would not want to benefit from this
awesomeness?


Reply to this email directly or view it on GitHub
#413 (comment).

@Garyfallidis
Copy link
Contributor Author

Hey guys,

With the last commits I now address all your comments. I test sph_harm and in spherical_harmonics I check if scipy version is higher that 0.15.0.

Enjoy the speed! Merge if you think is good so we can test the recalibration with real data!
:)

@@ -37,6 +37,7 @@
from dipy.core.onetime import auto_attr
from dipy.reconst.cache import Cache

import scipy.version as SCIPY_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be scipy.version.version.

@Garyfallidis
Copy link
Contributor Author

Ok thx @MrBago! Ready here!

@Garyfallidis
Copy link
Contributor Author

What are we waiting for here? Can we merge this and then finalize Chantal's PR too. @MrBago, @arokem ?

arokem added a commit that referenced this pull request Sep 16, 2014
@arokem arokem merged commit 924519a into dipy:master Sep 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants