Hi Zrinca
To find the position of a voxel after transformation here are two things
you will need to do:
(1) convert the mm->mm transformation produced by mcflirt into a voxel->
voxel transformation
and
(2) apply this new transformation to the voxel location of interest
In order to do (1) you will need to compute T_v = S_inv * XFM * S
where XFM is the matrix computed by mcflirt, S is the vox->mm scaling
matrix which, if your voxel dimensions are (a,b,c), will be
[a 0 0 0
0 b 0 0
0 0 c 0
0 0 0 1]
S_inv is simply its inverse (i.e. with the reciprocals along the leading
diagonal and zero elsewhere)
(2) can be achieved by using img2imgcoord, one of the command-line
utilities included with FLIRT. More information can be found by typing
img2imgcoord
on your FSL machine.
Hope this helps
Peter
> Hello,
> I am back to comparing transformation matrices from mcflirt and air and
> I have a question... oh, well...
>
> from some previous postings, I understand that fsl uses different
> coordinate system for "voxel" and for "mm". voxels are described with
> respect to image storage and the origin, or (0,0,0) voxel is the first
> (corner) voxel in the dataset. The mm coordinates are voxel coordinates
> multiplied by voxel dimensions. Also, transformation matrices are always
> given with respect to mm coordinates. But, the origin of mm coordinates
> (at least with regards to transformation matrices output by mcflirt) is
> not set to (0,0,0) voxel, but to the "center of mass" of the image.
>
> So, in other words, if I wanted to find a position of a voxel after
> transformation I would have to do the following:
> 1. transform old voxel coordinates into mm coordinates:
> old_mm=T*old_vox; 2. transform old mm coordinates into new mm
> coordinates: new_mm=XFM*old_mm
>
> where XFM is the transformation matrix from the .mat file. But what is
> T? Is it possible to find out what is the center of mass that mcflirt
> uses for each transformation?
>
> I believe that is the piece that I am missing in order to compare air
> and fsl transformations, because it seems that the only difference in
> the matrices is that air transformation matrices are always with respect
> to the first voxel in the dataset.
>
> Thanks!
> zrinka
--
Lecturer in Engineering Science, Exeter College
FMRIB Analysis Group, University of Oxford
http://www.fmrib.ox.ac.uk/~prb
|