DIPY is the paragon 3D/4D+ imaging library in Python. Contains generic methods for spatial normalization, signal processing, machine learning, statistical analysis and visualization of medical images. Additionally, it contains specialized methods for computational anatomy including diffusion, perfusion and structural imaging.
MRtrix3 changed their SH basis moving from versions (0.2.x) to (0.3.x) (details here).
The difference between the MRtrix3 and Dipy SH bases now just has to do with the ordering of the coefficients, and a somewhat complicated (-1)^m factor.
I wrote a quick function that will reorder mrtrix3 SH images into the Dipy basis, so that I can import FODs/etc. computed with mrtrix3 into python for further processing and visualization using Dipy.
Here is a jupyter notebook I made including the function and a quick toy example validating that both softwares expand the same data onto the same coefficients after the mrtrix3 coefficients are converted into the Dipy basis.
I'm happy to make a PR to include this in "dipy/reconst/shm.py" if it would be useful, otherwise I thought I'd just post it here for others to find as needed.
MRtrix3 changed their SH basis moving from versions (0.2.x) to (0.3.x) (details here).
The difference between the MRtrix3 and Dipy SH bases now just has to do with the ordering of the coefficients, and a somewhat complicated (-1)^m factor.
I wrote a quick function that will reorder mrtrix3 SH images into the Dipy basis, so that I can import FODs/etc. computed with mrtrix3 into python for further processing and visualization using Dipy.
Here is a jupyter notebook I made including the function and a quick toy example validating that both softwares expand the same data onto the same coefficients after the mrtrix3 coefficients are converted into the Dipy basis.
I'm happy to make a PR to include this in "dipy/reconst/shm.py" if it would be useful, otherwise I thought I'd just post it here for others to find as needed.