[Mrtrix-discussion] Aligning tracks and masks

Jackson Smith jackson.smith at dpag.ox.ac.uk
Fri Oct 31 03:59:13 PDT 2014


Dear MRtrix users,

I would like to plot tracks with respect to the seed mask. I would especially like to show where tracks originate within the seed mask. However, I am having trouble obtaining a precise alignment.

I've seen Donald's reply to "DISCREPANCY in voxel2world matrices between mrtrix and spm". He describes how to load tracks alongside images. I've followed his steps with a set of my own tracks, using the transform and dimensions of a seed mask image.

Then I plotted the very first vertex of each track to see where it fell within the seed mask. The mask, I loaded in Matlab using the following steps:

% Read in the mask.
seed = read_mrtrix( 'seed_mask.mif' ) ;

% Find the x-y-z index i.e. subscript index for each
% voxel in the mask. It is a binary mask. Voxels in the
% mask are marked with 1, and background voxels are 0.
i = find( 0 < seed.data(:) ) ;
[ s.x , s.y , s.z ] = ind2sub( seed.dim , i ) ;

My understanding is that MRtrix indexing starts at 0. Therefore, I subtract 1 from s.x, s.y, and s.z to get the lower left-hand corner at the back of each voxel, in units of voxel indeces. Note, the layout is '+0,+1,+2' meaning that indexing should move left to right, posterior to anterior, and inferior to superior along the x, y, and z axes.

But when I plot the starting vertices of each track onto an outline of the seed voxels, I find that they are slightly misaligned. Note that tracking was done without interpolating the seed mask.

A solution appears to be that I must subtract 1.5 from the subscripts in s.x, s.y, and s.z rather than just 1. This works very well. But I do not know where the extra 0.5 has come from. I'm happy that it works, but unsettled that I don't know why. Could anyone please explain the extra 0.5?

Kind regards,
Jackson

---------------------------
Dept of Phys, Anat and Gen
University of Oxford
Sherrington Bld, Parks Rd
Oxford, OX1 3PT
United Kingdom

Tel: 01865 282 549
jackson.smith at dpag.ox.ac.uk
---------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20141031/9c2f5ddb/attachment.html>


More information about the Mrtrix-discussion mailing list