[Mrtrix-discussion] Evaluate SH in MRview

Ariel Rokem arokem at gmail.com
Thu Jan 3 22:02:05 PST 2013


Hi Donald,

Would you mind posting somewhere the actual numbers that comprise the basis
set used by mrtrix (up to some reasonable order), so that we can test to
make sure that we are getting it right in code that we are writing that
derives from the mrtrix results? Thanks!

Ariel



On Thu, Jan 3, 2013 at 2:55 PM, Donald Tournier <d.tournier at brain.org.au>wrote:

> Hi Peter,
>
> As René mentioned, the SH basis in MRtrix is not orthonormal - something
> that I hope will be fixed in a future major release. That said, I'm not
> sure this is the problem you're having, it wouldn't cause a pure rotation.
>
> I'm struggling to understand the figure you sent through. The ODF doesn't
> look like it was displayed using MRtrix - what software was used for that,
> and what SH basis did it assume? What does the ODF look like when you
> display it using MRtrix's disp_profile command? Also, which directions are
> the peaks actually pointing along? The effect of the non-orthonormality of
> the basis will be different for peaks aligned along z than for peaks in the
> x-y plane, causing a differential scaling in this case. Also, you said the
> directions estimated by find_SH_peaks are correct, but they clearly don't
> match the ODF lobes as displayed. If so, and the ODF was not displayed
> using MRtrix, then I would suspect that whatever routine you use for
> display is at fault. Using disp_profile would at least verify that MRtrix
> is consistent with itself (i.e. the ODF lobes it displays should point
> along the directions estimated by find_SH_peaks).
>
> Finally, If you're going to change the code in MRtrix, you'll need to know
> that there are a number of functions that compute SH functions, each coded
> up slightly differently (for performance reasons) - that said, they are all
> in the same file, so it's not difficult to modify them all.
>
> Hope that helps,
>
> Donald.
>
>
> On 4 January 2013 01:22, Peter Neher <p.neher at dkfz-heidelberg.de> wrote:
>
>>  Hi René,
>>
>> thank you for your reply! Unfortunately that did not fix my problem. I
>> attached an image of the ODF I get with my method (negative Lobes are dark
>> blue). The red lines indicate the peaks extracted from the SH coefficient
>> file using "find_SH_peaks". These peaks are correct but the ODF is somehow
>> rotated. The ODF should actually represent a simple 90° crossing of two
>> fibers corresponding to the two peaks.
>>
>> Here a code snippet of my SH basis calculation. Maybe someone can
>> directly identify the issue:
>>
>> j=0;
>> for (int l=0; l<=ShOrder; l=l+2)
>>     for (m=-l; m<=l; m++)
>>      {
>>         // evaluation of legendre polynome
>>         float mag =
>> sqrt((double)(2*l+1)/(4.0*M_PI)*factorial<double>(l-abs(m))/factorial<double>(l+abs(m)))
>> * legendre_p<double>(l,abs(m),cos(sphCoords(0)));
>>
>>         if (m<0)
>>             m_ShBasis(j) = sqrt(2.0)*mag*cos(-m*sphCoords(1));
>>         else if (m==0)
>>             m_ShBasis(j) = mag;
>>         else
>>             m_ShBasis(j) = pow(-1.0, m)*sqrt(2.0)*mag*sin(m*sphCoords(1));
>>
>>         j++;
>>     }
>>
>> I also tried it without the sqrt(2.0) and pow(-1.0, m) terms, but that
>> does not change anything.
>>
>> Best,
>> Peter
>>
>> On 01/03/2013 01:01 PM, René Besseling wrote:
>>
>> Hi Peter,
>>
>> I ran into this before; it has to do with the MRtrix SH basis being
>> orthogonal but not orthonormal, see the following quote from an e-mail from
>> Donald.
>>
>> Best regards and happy new year to you too,
>>
>> René
>>
>> Quote Donald:
>>  "To answer your question: the matlab code does use an orthonormal
>> basis, but MRtrix unfortunately does not. Main reason is that I didn't
>> bother checking that the basis was orthonormal in the MRtrix code until
>> relatively recently, and it's now too late to change it without making all
>> current data sets ambiguous (i.e. how do you know whether a data set uses
>> the orthonormal basis or not?). I have since changed the matlab code
>> though, which is why there is a difference.
>>
>>  It's pretty easy to convert between them: the m=0 terms are not
>> affected, while the m!=0 terms are all scaled by a factor of sqrt(2) in
>> MRtrix compared with Matlab. Easy to fix, but very annoying I have to
>> admit."
>>
>>
>>  On Thu, Jan 3, 2013 at 12:54 PM, Peter Neher <p.neher at dkfz-heidelberg.de
>> > wrote:
>>
>>> Hi everyone and happy new year!
>>>
>>> I am trying to import the SH coefficient file (output of csdeconv) into
>>> my own program but the ODFs are not displayed correctly. The same method
>>> worked fine for the FSL coefficient files so I guess you are calculating
>>> the SH basis in a different way (the file format seems to be the same as
>>> the FSL file format). MRview renders the ODFs correctly, so I wanted to
>>> compare may code to the MRview code. Can you tell me the location in the
>>> source code where I can find your calculation and evaluation of the SH
>>> basis?
>>>
>>> Best,
>>> Peter
>>> _______________________________________________
>>> Mrtrix-discussion mailing list
>>> Mrtrix-discussion at www.nitrc.org
>>> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>>>
>>
>>
>> --
>> Dipl.-Inform. Peter Neher
>> German Cancer Research Center
>> (DKFZ, Deutsches Krebsforschungszentrum in der Helmholtz-Gemeinschaft, Stiftung des öffentlichen Rechts)
>> Division of Medical and Biological Informatics
>> Im Neuenheimer Feld 280, D-69120 Heidelberg
>>
>> Phone: 49-(0)6221-42-3552, Fax: 49-(0)6221-42-2345
>> E-Mail: p.neher at dkfz-heidelberg.de, Web: www.dkfz.de
>>
>> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
>>
>>
>> _______________________________________________
>> Mrtrix-discussion mailing list
>> Mrtrix-discussion at www.nitrc.org
>> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>>
>>
>
>
> --
> *Dr Jacques-Donald Tournier
> *
> Research Fellow
>
> The Florey Institute of Neuroscience and Mental Health
> Melbourne Brain Centre - Austin Campus
> 245 Burgundy Street
> Heidelberg  Vic  3084
> Ph:  +61 3 9035 7033
> Fax:  +61 3 9035 7307
> www.florey.edu.au
>
>
> _______________________________________________
> Mrtrix-discussion mailing list
> Mrtrix-discussion at www.nitrc.org
> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20130103/8bc91e60/attachment-0001.html


More information about the Mrtrix-discussion mailing list