Hi,
This is likely to be all about what you assume the centre of rotation is.
For FSL the matrices all take the centre of rotation to be about the *voxel* origin (0,0,0) which is in the corner of the image.
When you invoke avscale with a specified image, it will recalculate things using the centre of the image as the centre of rotation.
If you want to create FSL-compliant matrices in your simulation then you need to have the translations in units of mm and the centre of rotation at the centre of the (0,0,0) voxel.
All the best,
Mark
On 21 Sep 2012, at 23:52, wfubmc email <[log in to unmask]> wrote:
> Deal FSLers,
>
> I am new to FSL, I've been trying to use FLIRT to perform very simple 2D alignment. I have simulated data using the Shepp-Logan phantom and FLIRT works really well. However, when I retrieve the translation and rotation matrix using avscale, the numbers don't match my simulation parameters.
>
> For instance, given a reference image, align it with the same reference image, perform avscale on the affine matrix, I get
>
> 1.0000 -0.0001 0 0.0080
> 0.0001 1.0000 0 -0.0081
> 0 0 1.0000 0.0000
> 0 0 0 1.0000
>
> as one would expect.
>
> If I apply an arbitrary 45 degree rotation and no translation to the source image and co-register with the same reference image, I get
>
> 0.7078 -0.7064 0 126.7990
> 0.7064 0.7078 0 -52.3091
> 0 0 1.0000 0
> 0 0 0 1.0000
>
> If I understand it correctly, the last column is my Tx, Ty, Tz and I am getting unreasonable numbers. If I do avscale amat.mat ref.img,
>
> 0.707768 -0.706445 0.000000 -2.132357
> 0.706445 0.707768 0.000000 3.269733
> 0.000000 0.000000 1.000000 0.000000
> 0.000000 0.000000 0.000000 1.000000
>
> Can someone explain to me why am i getting different translation numbers when I added the additional ref.img at the end? The only time the translation factors looked correct (based on simulation) is when I apply no rotation.
>
> All simulations are done in matlab, that is, i provide no FoV or voxel size information. The correction results looked fantastic, just the translation numbers didn't appear to be right. Any help is much appreciated!
>
> HT
|