What is the coordinate system for .trk outputs?

118 views
Skip to first unread message

Henry Braun

unread,
Apr 1, 2022, 2:09:58 PM4/1/22
to DSI Studio
I am trying to write a utility script to convert *.trk outputs saved from DSI studio into the space of the original diffusion nifti, so they can be opened in Slicer and appear correctly registered.  The example I have is saved such that the right/anterior/inferior corner is the origin and coordinates increase when moving to the right, anterior, and superior directions.  That is, the L-R and A-P coordinate values are all negative.  The scaling is in units of voxels, not mm.

My question is, are DSI studio outputs always saved this way?  If not, what determines how they are saved?  Thanks!

Frank Yeh

unread,
Apr 1, 2022, 2:18:47 PM4/1/22
to dsi-s...@googlegroups.com
DSI Studio uses the right-anterior-inferior corner as the (0,0,0), and
coordinates increases at LPS in the voxel unit.
The coordinates are thus positive.

Henry Braun

unread,
Apr 4, 2022, 1:35:34 PM4/4/22
to DSI Studio
The attached tracts.trk.gz file was generated in DSI studio and contains all tracts entirely in the (-, -, +) octant. I verified this in both Slicer and using nibabel in Python. The attached B0_headeronly.nii.gz contains the Nifti header info for a B0 volume from the series used to produce the tracts (voxel data have been zeroed out).  I am pretty confident I'm not mis-stating what was done.  Have I found a bug?
B0_headeronly.nii.gz
tracts.trk.gz

Frank Yeh

unread,
Apr 4, 2022, 3:13:03 PM4/4/22
to dsi-s...@googlegroups.com
I loaded the tracts in DSI Studio and saved it again as the attached
file. Is it still in the (-,-,+) octant?
> --
> You received this message because you are subscribed to the Google Groups "DSI Studio" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dsi-studio/1b93fcbd-3c7d-4261-a377-f13b25fba8den%40googlegroups.com.
tract.trk.gz

Henry Braun

unread,
Apr 5, 2022, 7:25:18 PM4/5/22
to DSI Studio
No; it's now in the (+, +, +) octant.  I will try to figure out exactly what was done to generate the one I originally sent you.  If I can successfully reproduce the behavior I'll let you know exactly what I did. Thanks for your help!
Henry

Henry Braun

unread,
Apr 5, 2022, 7:28:14 PM4/5/22
to DSI Studio
One more small question: Does DSI Studio follow the TrackVis convention of the origin pointing to a voxel corner rather than center?

Frank Yeh

unread,
Apr 5, 2022, 7:29:37 PM4/5/22
to dsi-s...@googlegroups.com
DSI Studio uses the voxel center.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dsi-studio/405bce88-9bb6-414f-81a2-d08979fcf48fn%40googlegroups.com.

Frank Yeh

unread,
Apr 5, 2022, 7:30:31 PM4/5/22
to dsi-s...@googlegroups.com
It is likely that you may need to update DSI Studio to the most recent version.

The update should fix this issue.

Best,
Frank

Henry Braun

unread,
Apr 12, 2022, 2:02:09 PM4/12/22
to DSI Studio
The colleague who gave me the problem data was using the 2021-08-30 build of DSI Studio.  I met with him today and we reproduced the problem, upgraded the software, and failed to reproduce with the upgraded version.  It looks like the problem was definitely a recently fixed bug.
Henry

Frank Yeh

unread,
Apr 12, 2022, 2:21:32 PM4/12/22
to dsi-s...@googlegroups.com
Thanks for the information and sorry again for the bug in the previous versions.
Is there any remaining problem that I could fix? (or any suggestions?)
Frank
> To view this discussion on the web visit https://groups.google.com/d/msgid/dsi-studio/bfa2e0eb-e4d5-453c-9e49-c4074699ebd4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages