Skip to content
johncolby edited this page Apr 16, 2011 · 12 revisions

When TrackVis opens a file, it will automatically convert the orientation to LPS, meaning that the x, y, and z coordinates will be increasing towards the left, posterior, and superior sides of the brain, respectively. Here we’ve moved the slice planes to the right/anterior/inferior sides to show that the slice numbers are all low:

When tract groups are exported from TrackVis, they will retain this LPS ordering. This can cause a potential mix up when the tract group is imported to MATLAB, which (for now) uses the voxel ordering as it is in the original DTI volume. For example, subject1 was originally stored as LAS, which is flipped in the y direction compared to any of the LPS .trk outputs from TrackVis. along-tract-stats will attempt to reverse any flips done to the tract groups, so that they will overlay nicely with the original voxel volumes. Here we see that in MATLAB the y-axis is now increasing towards the anterior side, but that the tract group has been flipped to match:

However, one important side effect of this is that any voxel/mm coordinates entered into MATLAB need to be in the MATLAB coordinates, rather than the TrackVis coordinates (i.e., for subject1, in LAS and not LPS). For instance, say I’m trying to pick a good pt_start for the ILF/IFO, and would like it to be the center of the most posterior coronal slice, I should pick [192/2 0 55/2].

As with any new processing pipeline, it is also useful to start out by doing some orientation tests on an image with known laterality. A couple things I like to check are that:

  • The tract group shows up in the right place (i.e. matches TrackVis) when displaying in MATLAB using trk_plot.
  • Simple descriptive statistics in MATLAB (using trk_stats) closely match those from TrackVis.
  • A new version of the tract group can be saved back out using trk_write, loaded with no error into TrackVis, and displayed to match the original version without any flips/etc.