[Neuroimaging] Help: A problem with affine in Dipy

Bago mrbago at gmail.com
Fri Dec 30 19:58:23 EST 2016


Hi Judd,

Could you clarify what "it doesn't work" means?

"Trackvis", the visualization software, expects the streamlines to be in a
specific "point space" in order to visualize correctly. If you're having
trouble viewing your points co-aligned with your FA file, it's because the
points are being saved in the wrong point space. Take a look at the end of
the example,
http://nipy.org/dipy/examples_built/streamline_tools.html#example-streamline-tools,
and try saving the streamlines using the same method. (Make sure you build
the trackvis header and use "move_streamlines").

If you've done that and the streamlines are displaying correctly in
Trackvis but you're still having trouble using the utils module, then look
for the function `dipy.tracking.utils.affine_for_trackvis`. That function
should return the correct affine for the "trackvis point
space". Alternatively you can try out the new steamline API in
nibabel.streamlines,
http://nipy.org/nibabel/reference/nibabel.streamlines.html#nibabel.streamlines.load.
This API should make it easier to load trk files into NIFTI RAS+ point
space so that your image and streamlines share a real world coordinate
system.

Hope that helps,
Bago

On Fri, Dec 30, 2016 at 1:18 PM Judd <18758264356 at 163.com> wrote:

> Hello:
>     My name is Judd, And I'm from China(Maybe English isn't well, sorry!).
> Recently, I was try an example in Dipy Gallery(Connectivity Matrices, ROI
> Intersections and Density Maps
> http://nipy.org/dipy/examples_built/streamline_tools.html#example-streamline-tools
> ). And my test file is my own fiber and FA file which save by nibabel
> like this:
> *nib.trackvis.write(csd_sl_fname, csd_streamlines_trk, hdr,
> points_space='voxel')*
> *nib.save(FA_img, FA_file)*
>
> but when I use these file, it doesn't work, and I realized FA file and
> fiber file isn't in the same position. So I think it may be some trouble in
> *affine, *but I don't know How to change position by affine(I use dipy
> code change by affine, but still wrong). Did you have a formula or paper
> about affine?
>
>
>
> Thanks!!
>
>
> Judd
>
>
>  2016.12.27
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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/20161231/65dc699f/attachment.html>


More information about the Neuroimaging mailing list