Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Does convert_sh_to_legacy work as intended ? #2676

Closed
DelinteNicolas opened this issue Nov 10, 2022 · 1 comment
Closed

Does convert_sh_to_legacy work as intended ? #2676

DelinteNicolas opened this issue Nov 10, 2022 · 1 comment

Comments

@DelinteNicolas
Copy link
Contributor

Description

I was converting ODFs files, saved using spherical harmonics (SH), from the MRtrix3 format (Tournier) to DIPY (Descoteaux) and had issue with this function. It currently flips the SH coefficients when m is odd and <0 : out_sh_coeffs = sh_coeffs * np.where(m < 0, (-1.)**m, 1.).
However, I noticed that the coeffifient that I needed to flip to get a working files were the 'even' m numbers. As mentionned in the DIPY theory (https://dipy.org/documentation/1.4.0./theory/sh_basis/) : "the effect of this change is a sign flip for the SH functions of even degree m<0".

If I understand correctly, shouldn't the code line be replaced with out_sh_coeffs = sh_coeffs * np.where(m < 0, -1*(-1.)**m, 1.) ?

With:
DIPY==1.5.0
MRtrix==3.0.2

@skoudoro
Copy link
Member

Yes, it worked as intended.

In your case, you might want to use convert_sh_to_full_basis instead.

@CHrlS98 can tell you more when he has time.

@dipy dipy locked and limited conversation to collaborators Nov 10, 2022
@skoudoro skoudoro converted this issue into discussion #2677 Nov 10, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants