[Neuroimaging] [DIPY] Question about whole tracks *.trk registration using SLR

Perea Camargo, Rodrigo Dennis RPEREACAMARGO at mgh.harvard.edu
Mon Oct 23 19:30:03 EDT 2017


Hi Eleftherios and Dipy Community,

I believe my registration is working properly (yay, thanks!). Now I have the following issues.


  1.  After looking at some documentation, I tried to save the moved streamlines using the following code:
```
sname= ‘move_trk.trk’
sname = dname + sname1
from nibabel.streamlines import save
from nibabel.streamlines import  Tractogram
save(Tractogram(centroids2, affine_to_rasmm=cur_matrix),cname)

```
I was able to save the moved streamlines but when I load them up in dsi_studio, they do not overlap with each other (as the window.show(ren) shows). I believe the problem might be with the 2nd argument when using save() [ affine_to_rasmm=??].

So my question is, how can I save the streamlines to be in the same space as the ref_sstr? I tried different matrices provided by the initial vox_to_ras in the ref_sstr or the mov_sstr rather than an identity matrix but this doesn’t seem to solve my question :/


  1.  Given that this will work, I am now confused on how could I apply this transformation and extract diffusivity metrics (e.g. FA, AxD, RD, etc…) in the registered space to a template? Should I apply a  matrix transformation to my niftii images?

Thanks in advance,

Rodrigo




From: Neuroimaging <neuroimaging-bounces+rpereacamargo=mgh.harvard.edu at python.org> on behalf of Eleftherios Garyfallidis <elef at indiana.edu>
Reply-To: Neuroimaging analysis in Python <neuroimaging at python.org>
Date: Sunday, October 15, 2017 at 10:29 PM
To: Neuroimaging analysis in Python <neuroimaging at python.org>
Subject: Re: [Neuroimaging] [DIPY] Question about whole tracks *.trk registration using SLR

Hi Rodrigo,

Apologies for the delay. But hey I got a solution for you! I hope you are excited :)
Look at this gist
https://gist.github.com/Garyfallidis/51e34aab47de99eafa887b2b818384ea

This code shows how to do step by step whole brain SLR and I made it work with the
specific datasets that you gave me.

The specific datasets don't need exactly a whole brain SLR because the one brain has much
fewer structures than the other brain but still SLR is robust to incomplete datasets such as these.

Give it a go and give us feedback! :)

All the best,
Eleftherios

p.s. Notice that to load the streamlines I used a more recent API than what you originally used. Make sure you have a recent version of dipy and nibabel.

On Mon, Sep 25, 2017 at 9:50 AM Perea Camargo, Rodrigo Dennis <RPEREACAMARGO at mgh.harvard.edu<mailto:RPEREACAMARGO at mgh.harvard.edu>> wrote:
Hi Eleftherios,
I am included both *.trk files in here: http://www.nmr.mgh.harvard.edu/~rdp20/drop/trk_slf/
IIT2mean.trk was a template TRK downloaded from the tract_querier example (http://tract-querier.readthedocs.io/en/latest/ ) and ADRC_TMP_wholeBrain.trk.gz was generated using dsi_studio (http://dsi-studio.labsolver.org/)

Thanks again,

Rodrigo



On Sep 21, 2017, at 3:46 PM, Eleftherios Garyfallidis <elef at indiana.edu<mailto:elef at indiana.edu>> wrote:

Hi Rodrigo,

Whole brain SLR is a great idea! Thank you for your question.  :)

Have in mind that nibabel.trackvis is the old API. Use nibabel.streamlines.load instead.

Can you please share with me (off the list) your trk files so that I can correct your
script?

A wild guess is that you are not loading the streamlines correctly.

Did you use DIPY to create those trks or another software?

Also, another suggestion is to run QuickBundles first to reduce the size of your
datasets. I mean before starting the SLR.

Here is a sample script (in one of my branches).
https://github.com/Garyfallidis/dipy/blob/recobundles/dipy/workflows/align.py

We are working on making something similar available asap in master.

Best,
Eleftherios



On Thu, Sep 21, 2017 at 1:36 AM Perea Camargo, Rodrigo Dennis <RPEREACAMARGO at mgh.harvard.edu<mailto:RPEREACAMARGO at mgh.harvard.edu>> wrote:
Hi Eleftherios & DIPY community,
I am trying to register two whole brain tracts as shown in your recent publication using the streamline-based linear registration. I am diving into Dipy now and I might have some problems loading the files or registering them.
Following your example ( http://nipy.org/dipy/examples_built/bundle_registration.html#example-bundle-registration), there are 2 issues that may arise when I try it.

1) How to load *.trk files is not shown in your example (it looks like you added to cingulum bundles from your dataset using the dipy.data value…) So I follow this tutorial (http://nipy.org/dipy/examples_built/streamline_formats.html ) to load the streamline and hdr but I am not sure if this is the format SLF() wants it in.

2) So then I try using the srr.optimize( ) function but I get the following problems (check below).

I hope you can help me.
Rodrigo


Here is my Jupyter notebook with the errors I found (any help will be greatly appreciate it):







The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
_______________________________________________
Neuroimaging mailing list
Neuroimaging at python.org<mailto:Neuroimaging at python.org>
https://mail.python.org/mailman/listinfo/neuroimaging
<PastedGraphic-1.png><PastedGraphic-1.png>_______________________________________________

Neuroimaging mailing list
Neuroimaging at python.org<mailto:Neuroimaging at python.org>
https://mail.python.org/mailman/listinfo/neuroimaging
_______________________________________________
Neuroimaging mailing list
Neuroimaging at python.org<mailto: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/20171023/922468ab/attachment-0001.html>


More information about the Neuroimaging mailing list