Hi Martin,
That matrix is guaranteed to map the voxels outside of your FOV.
The translation values in the fourth column always need to
be the opposite sign to the main diagonal value, since at the
moment your new x coordinate (for instance) is given by:
xnew = -1*xold - 99.618134
As the coordinate conventions in flirt always use scaled voxel
coordinates (voxel coord * voxel dimension) they are always
positive, hence your xnew will be negative here and so outside
the FOV.
I don't know how you got this matrix, but it seems that you are
using the origin in some way, however, the coordinates that
flirt deals with internally (and relate to the matrix) do not care
about the origin value, and actually ignore it. The mm coordinates
shown by fslview do use the origin, but not the flirt matrices.
If all you want to do is swap image dimensions, I suggest you
use avwswapdim instead, as this is what it is designed to do.
Also, you can see what the equivalent matrix it uses is by
leaving off the output image name, in which case it will display
the flirt matrix on the screen.
All the best,
Mark
Martin Kavec wrote:
>Hi,
>
>I have an Analyze image in world coordinates with origin (-100, -164, 106),
>Avwhd shows these values too. This image is in (right, posterior, inferior)
>coordinate system. I have instruction on how to build the matrix to transform
>this image into (left, posterior, superior) coordinates. The matrix looks as
>follows:
>
>-1 0 0 -99.618134
> 0 1 0 -164.396378
> 0 0 -1 -110.499744
> 0 0 0 1
>
>However, running
>
>flirt -in Stack.hdr -applyxfm -init sp_T_op.mat -out Stack_sp.hdr -paddingsize
>0.0 -interp trilinear -ref Stack.hdr
>
>maps all the pixels outside the image, as it is blank. Assuming that the
>instructions on how to create the matrix are correct, is there something else
>I should keep in mind and do before applying the matrix using flirt?
>
>Thanks.
>
>Martin
>
>
|