[Neuroimaging] [dipy] Import csd model precomputed by mrtrix

Samuel St-Jean stjeansam at gmail.com
Wed May 25 20:12:57 EDT 2016


Their wiki explains it, a sqrt(2) to normalize is used in mrtrix3, so
multiplying your coefficients with that and using the mrtrix2 functions
should do it.

Although dipy only does single shell, so conclude with consideration that
the algorithm is different from mrtrix3. Also, csd is a bad signal
predictor (but good for angle estimation), see the sparc dmri challenge
paper for example.
On May 26, 2016 07:55, "Ariel Rokem" <arokem at gmail.com> wrote:

>
>
> On Wed, May 25, 2016 at 4:41 PM, Bago <mrbago at gmail.com> wrote:
>
>> I believe they did change their basis (please correct me if I'm wrong but
>> I believe they went from a non-normalized SH basis to a normalized SH
>> basis).
>>
>>
> So they have the same basis as dipy now, but the coefficients appear in a
> different order? That should make life even easier!
>
>
>> Also projecting onto a sphere is one way to _estimate_ the coefficients
>> in a different basis. The cleaner way is to just re-order the coefficients
>> and apply the appropriate scaling. If both basis are normalized (which dipy
>> is) the scaling should be 1 or -1.
>>
>>
> Fair point, but to be just a little bit facetious: given enough points on
> the sphere and knowledge of the target maximal order of the coefficients,
> wouldn't estimating be the same as transforming? Works for the FFT, I
> believe :-)
>
> Bago
>>
>> On Wed, May 25, 2016 at 3:31 PM Ariel Rokem <arokem at gmail.com> wrote:
>>
>>> On Wed, May 25, 2016 at 1:09 PM, Bago <mrbago at gmail.com> wrote:
>>>
>>>> Hi Paolo,
>>>>   mrtrix and dipy define the SH basis slightly differently, so the
>>>> precomputed FOD values need to be adjusted if you want to skip the fit step
>>>> and initialize the Fit object directly. IRC we don't currently have the
>>>> code to do that, but it would be something we'd like to incorporate.
>>>>
>>>> Did they change their basis set when they transitioned to mrtrix3? We
>>> do have these functions:
>>>
>>> https://github.com/nipy/dipy/blob/master/dipy/reconst/shm.py#L852-L923
>>>
>>> That should work with the previous version of mrtrix (mrtrix2?). You can
>>> use these to transform between coefficient sets:
>>>
>>>     sf = sh_to_sf(mrtrix_coeffs, sphere, sh_order, basis_type='mrtrix')
>>>     dipy_coeffs = sf_to_sh(sf, sphere, sh_order, basis_type=None) # This
>>> defaults to the dipy basis set
>>>
>>> and then use the CSD model object to predict:
>>>
>>>     from dipy.reconst.csdeconv import  ConstrainedSphericalDeconvModel
>>>     csd_model = ConstrainedSphericalDeconvModel(gtab, response,
>>> sh_order=sh_order) # Note: you still need to calculate the response
>>> function!
>>>     pred_signal = csd_model.predict(dipy_coeffs, gtab, S0)
>>>
>>> I think that something like this should work (but I haven't tried it
>>> myself).
>>>
>>>
>>>> I have a WIP version of the multi-shell CSD model on a separate branch,
>>>> I plan on merging it but wasn't intending to get to that for a few months.
>>>> If you'd like to look at before then I can push the branch up to github.
>>>>
>>>> Sounds interesting! I'd love to see what you have so far!
>>>
>>> Cheers,
>>>
>>> Ariel
>>>
>>>
>>>> Bago
>>>>
>>>> On Wed, May 25, 2016 at 2:31 AM Paolo Avesani <avesani at fbk.eu> wrote:
>>>>
>>>>> I would like to take advantage of the "predict" method of
>>>>> reconstruction models in dipy. The goal is to assess the quality of results.
>>>>>
>>>>> I have already computed the reconstruction models using mrtrix3 and
>>>>> stored the ODF files. For this reason I would need to initialize the csd
>>>>> model by importing the data from ODF stored by mrtrix3.
>>>>>
>>>>> The questions are manifold:
>>>>> - may I initialize the csd model by providing the precomputed values
>>>>> and skipping the "fit" step?
>>>>> - may I import the value of precomputed model from a file stored by
>>>>> mrtrix3?
>>>>> - is the csd model in dipy compliant with the output of multi-shell
>>>>> csd model computed by mrtrix3?
>>>>>
>>>>> I hope my questions and my goal is formulated clearly.
>>>>> Thanks for your support.
>>>>> Paolo
>>>>>
>>>>> _______________________________________________
>>>>> Neuroimaging mailing list
>>>>> Neuroimaging at python.org
>>>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>>>
>>>>
>>>> _______________________________________________
>>>> Neuroimaging mailing list
>>>> Neuroimaging at python.org
>>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>>
>>>> _______________________________________________
>>> Neuroimaging mailing list
>>> Neuroimaging at python.org
>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>
>>
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
>>
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20160526/414716d2/attachment.html>


More information about the Neuroimaging mailing list