# [vtkusers] Internal vtkLandmarkTransform matrix

Markus Heller markus.heller at charite.de
Fri Feb 16 12:11:05 EST 2001

```Hi George,

what you get back is a rotation matrix, including some
scaling, which describes how to get from source to
the target object.
There are, however,  many different ways to perform
successive rotations, which, when taken together,
yield the result which is represented by the matrix
returned from the Landmarks transform.
Because for rotations, the order does matter,
it's up to you to decide in which order you want your
rotations to happen.
Say Mx describes a rotation of alpha degrees about the x-axis,
My a rotation of beta degree about y,-axis, and  Mz a rotation
of gamma degree about z-axis.  You could then go on and
decide that you want to perform successive rotations
about x, y, and z. Check you math book on how those 3
matrices would look like (or the VTK book).
Simply multiply the 3 matrices, Mz*My*Mx
and you get a new matrix with may sums/products
of sin's and cos' of alpha, beta, gamma.
You can then start to calculate the first angle from two
entries of the matrix - if you see the matrix, it'll be clear
which one's you have to take.

It is important to note, that if the coordinate system you start with
is denoted by KS_0,  after the first rotation around x of KS_0 occured,
a rotation about y is the a rotation about the y-axis of the rotated
system ,KS_1, not abous the y-axis of KS_0 ....

Hope this helps a little ....

Markus

George Kamucha wrote:

> Hi all,
> I am using the vtksbIterativeClosestPointTransform to obtain a
> registration transform between two data sets. When I  provide a rotation
> or a translation to one data set in a particular direction (either a
> long X, Y or Z), I am able to analyse the resulting transformations from
> the internal LandmarkTransform matrix, and the program is working
> wonderfully.  But when I use a data set which has to be rotated along
> all the three axis in the registration process, I obtain a matrix which
> I have not been able to resolve in order to obtain the particular
> rotations along the three axis:  X, Y and Z . The translation is
> straight forward but how can I get these other parameters? In essence,
> what is the order of rotation in the vtkLandmarkTransform matrix? Please
> assist.
>
> Regards
>
> George
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>