Hi - yes, avscale gives you most of this (doesn't separate rotation from
shearing).
Cheers.
On Tue, 25 May 2004, Bernd Didinger wrote:
> Hi,
>
> I've got another question concerning this issue:
> Is it possible to compute the absolute values for translation (in mm),
> rotation (in degrees), shearing (in degrees) and scaling
> out of the homogeneus transformation matrix ?
>
> Thanks for help,
>
> Bernd Didinger.
>
>
> luis hernandez-garcia wrote:
> > thanks a lot
> >
> > -L
> >
> > On May 24, 2004, at 6:28 PM, Mark Jenkinson wrote:
> >
> >> Hi,
> >>
> >>> Amatrix = load ('original2standard')
> >>> xyz2 = Amatrix * [ x y z 0]'
> >>>
> >>> The actual questions:
> >>> 1) Should the xyz2 coordinates should be the coordinates for the
> >>> same structure after the transformation (ie- registered.img)?
> >>
> >> Yes, that's right.
> >>
> >>> 2) is the frame of reference for that rotation the same as the one
> >>> in the reference image, the original image (ie- origin, voxel
> >>> sizes...), or is it relative to the first voxel in the file?
> >>
> >> The coordinates are all in mm, not voxels, with 0,0,0 located at the
> >> voxel in the lower-left corner of the image (that is, the first voxel
> >> in
> >> the img file) So, to get mm coordinates from voxel coordinates, just
> >> multiply by the appropriate voxel dimensions (in mm).
> >>
> >>> 3) I should also be able to invert the transformation matrix and go
> >>> back and forth between the spaces, no?
> >>
> >> Yep, as everything is in mm, all you need to do is invert the matrix.
> >>
> >>> 4) Do all these things hold true in the case of 12DOF
> >>> transformations? I'm thinking they should ...
> >>
> >> Yes, it holds for all DOF.
> >>
> >>> 5) what is the .xfm file for?
> >>
> >> They are MEDx transforms (for historical reasons...)
> >>
> >>> I'm sorry if this is a newbie question...I've been trying to test
> >>> these
> >>> questions on a synthetic image made up of a few dots but I'm getting
> >>> weird results. Maybe I'm using the functions wrong ...
> >>
> >> Your problems are probably to do with your choice of coordinate
> >> unit (mm vs voxels) and coordinate centre/origin. Once these are
> >> consistent things should work OK.
> >>
> >> All the best,
> >> Mark
> >>
> >>
> >>
> >>
> >>> thanks a lot
> >>>
> >>> -Luis
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> ( http://www.eecs.umich.edu/~hernan )
>
Stephen M. Smith DPhil
Associate Director, FMRIB and Analysis Research Coordinator
Oxford University Centre for Functional MRI of the Brain
John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK
+44 (0) 1865 222726 (fax 222717)
[log in to unmask] http://www.fmrib.ox.ac.uk/~steve
|