[Neuroimaging] Help: A problem with affine in Dipy
mrbago at gmail.com
Fri Dec 30 19:58:23 EST 2016
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
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
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
Hope that helps,
On Fri, Dec 30, 2016 at 1:18 PM Judd <18758264356 at 163.com> wrote:
> 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
> ). 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,
> *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?
> Neuroimaging mailing list
> Neuroimaging at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Neuroimaging