dipy / dipy

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.
https://dipy.org
Other
707 stars 438 forks source link

Conversion from MRTrix SH basis to dipy #1782

Closed scott-trinkle closed 5 years ago

scott-trinkle commented 5 years ago

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.

gabknight commented 5 years ago

The is a relevant issue on this here: #392 .

mrtrix 0.2.x basis is supported in dipy. If I understand correctly the basis in 0.3.x only have a normalization factor compared to 0.2.x.