mdesco/dipy — pull request #3 by MrBago (2013-02-25 21:05:15+00:00)
Title: RF - have mrtrix/fibernav basis take sh_order as argument and have dipy

Here are the changes I propose to the sph basis pull request, a short summery bellow:

theta/phi

I realized that theta and phi were being used inconsistently within dipy and shm specifically. This was mostly my fault (and I still managed to get confused by it). I believe I've fixed it so that theta is always the polar angle and phi is the azimuthal angle. This is consistent with dipy.core.sphere.

mrtrix basis

I assumed the line, `neg_ones = -1 * np.ones(sh.shape) ** (m + 1)` should have read `neg_ones = (-1 * np.ones(sh.shape)) ** (m + 1)` and proceed according, please let me know if that is not the case. I also fit a function to coefficients using dwi2SH from mrtrix and saved the function, coefficients and sphere in dipy.data so we could use those to test that in-fact the mrtrix basis was consistent.

A little bit of re-factoring.
I also re-wrote `real_sph_harm` to be more consistent with both `real_sph_harm_fibernav` and `real_sph_harm_mrtrix`. I modified the latter two to take sh_order as an argument and return the basis, m, and n. I believe this is the right approach because changing the ordering of m, n would mean that the basis is no longer consistent with mrtrix/fibernav so we shouldn't give the user that choice.

Let me know if you guys spot any bugs or typos.
Thanks
Bago

@arokem, @Garyfallidis, @stefanv