Hi - hopefully these queries are covered in MJ's draft coordinate
summary doc:
http://users.fmrib.ox.ac.uk/~mark/files/coordtransforms.pdf
Cheers.
On 15 Jul 2009, at 03:32, Kristen Klemenhagen wrote:
> Greetings FSL list-
>
> I am trying to create my own transformation matrix for a specialized
> application and have run into some problems. Here is what we are
> trying to
> do: given the coordinates of the maximum and minimum value voxels in
> an
> individual subject's 3D image, we want to perform a rotation/
> translation on
> the whole structure to align the line that passes between the max
> and min
> with an axis (say the z axis).
>
> We are trying to do this because individuals in our study show a
> similar
> pattern along this max-min axis, but the orientation of this axis in
> anatomical space is variable enough between individuals that a
> standard
> group analysis of MNI registered images is not appropriate for
> answering our
> research question.
>
> We might be approaching this the wrong way, but based on the previous
> discussions on this list, I understand that the transformation .mat
> file
> contains a 3x3 submatrix describing transformation movements and with
> scaling factors on the diagonal, and the 4th column represents x, y, z
> translations. I have successfully written text files (that ApplyXFM
> will
> accept) that translate voxels along x y or z. I thought it would be
> as easy
> as substituting the appropriate 3x3 submatrix to handle rotation,
> but this
> is where I am having problems.
>
> Using this method from a Matlab Central discussion, I tried to get
> the 3x3
> matrix necessary to align the subject's max-min axis with the z axis:
>
> A=[x1, y1, z1; x2, y2, z2; x3, y3, z3]; %initial data points
> B=[0 0 0; 0 0 1; 0 0 2]'; %target data points (max/min distance=2
> in this
> example)
> [Ra,D]=eig(A*A');
> [Rb,D]=eig(B*B');
> R=Rb*Ra'; %rotation matrix
>
> Putting the result of this computation into a .mat file with 0,0,0,1
> in the
> 4th column and 0, 0, 0, 1 in the 4th row does not give the results
> that I
> want. I know I have several problems. First, since 0,0,0 is the
> lower left
> of the first image in the FSL coordinate system, this may not be the
> right
> place to try to align the structures within the FOV. Second, I've
> looked at
> makerot and avscale and I am still not sure if my units are correct or
> incorrect. Our voxels are 2x2x2 mm. I saw a suggestion in the
> archive that
> you multiply the 4th column by your voxel size to convert to mm, but
> I'm not
> sure how to apply that to this situation. And is the 3x3 matrix R
> produced
> above even close to the correct numbers that I need for the
> rotation? We
> don't want any scaling or warping, just a reorientation along the z
> axis (or
> wherever is best - as long as we can align all of the individuals in
> the
> study). I'm also unsure if the center of rotation is the same in the
> Matlab
> calculation and in ApplyXFM.
>
> Thanks in advance for any suggestions or guidance,
> Kristen
>
---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director, Oxford University FMRIB Centre
FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
+44 (0) 1865 222726 (fax 222717)
[log in to unmask] http://www.fmrib.ox.ac.uk/~steve
---------------------------------------------------------------------------
|