[Insight-users] to understand quaternion versor and matrix in VersorRigid3DTransform

Serena Fabbri fabbri at u.washington.edu
Fri Mar 20 14:45:44 EDT 2009


Hi All,

I have some questions about VersorRigid3DTransform, in particular about the versor and the matrix in the output.
I am registering T2 and T1 image.

FIX IMAGE: T2 
size=(392, 512, 160)
spacing=(0.5, 0.5, 1)mm

MOVING IMAGE: T1
size=(176, 256, 160)
spacing=(1, 1, 1)mm

I use
VersorRigid3DTransform
itkMattesMutualInformationImageToImageMetric
itkVersorRigid3DTransformOptimizer



I find this output:


Result =
  versor X      = -0.00431463
  versor Y      = -0.00118787
  versor Z      = 0.00404881

  Translation X = -9.59506
  Translation Y = -14.2873
  Translation Z = 1.52361

  Iterations    = 81
  Metric value  = -0.204678


Matrix = 
0.999964 -0.00808722 -0.00241064
0.00810772 0.99993 0.00861949
0.00234077 -0.00863873 0.99996

Offset = 
[-8.36679, -15.7562, 2.40158]


The versor is a three first component of Quaternion.

In 
http://en.wikipedia.org/wiki/Versor
quaternion is:
q = cos(T/2) + u sin(T/2)

where u is a unit vector.

I have calculated the norm of my versor and it is 
||versor||= 6.0349e-03
so it is not 1 !!!

1) so...what is the correct interpretation of versor in ITK?

2) In the Luis Ibanez email (Apr 7 2007) , he writes that the quaternion is:

        q0 = Ax * sin( T / 2 )
        q1 = Ay * sin( T / 2 )
        q2 = Az * sin( T / 2 )
        q3 =      cos( T / 2 )

where (Ax,Ay,Az) are the components of the axis
of rotation and T is the angle of rotation.
Versors are composed of only the components

           q0,q1,q2


I am rotating around z axes so my A components are 0 0 1 and I get
q2 = sinT/2 
and I guess q2 = versorZ so my final rotation angle is 0.464  degrees 
Is this the rotation angle?

3)Is the rotation matrix  the matrix in slide n. 61 of
  http://www.itk.org/CourseWare/Training/QuaternionsI.pdf   ?

or it is the follow matrix:
(to be cleare I am rotating around z axes)

M=  cosT  sinT 0
    -sinT  cosT 0
       0     0  1

because If you read the ITKSoftwareGuide pag.372, to calculate the final rotation angle, it is sufficiently to do arcsin(sinT).


Thanks a lot for all explanation.


Serena Fabbri







More information about the Insight-users mailing list