[Insight-users] RE: MultiResMIRegistration example
Lydia Ng
lng@insightful.com
Fri, 14 Feb 2003 10:19:36 -0800
Christina,
You are quite correct.
The final parameters consist of 7 parameters:
The first four are the quaternion and the last three are the
translation.
Let q =3D (q1,q2,q3,q4) be the quaternion. It is related to an =
axis-angle
relationship as follows:
Let Axis =3D n =3D (n1,n2,n3) and Angle =3D a,
then q =3D (n1 sin(a/2), n2 sin(a/2), n3 sin(a/2), cos(a/2) )
You can also look at the actually vnl code that converts a quaternion to
a rotation matrix at:
http://www.itk.org/cgi-bin/cvsweb.cgi/Insight/Code/Numerics/vxl/vnl/vnl_
quaternion.txx?annotate=3D1.1.1.2&cvsroot=3DInsight
and the function rotation_matrix().
This website might be helpful if you want to understand quaternions:
http://skal.planet-d.net/demo/matrixfaq.htm
but keep in mind there quaternion representation is slightly different
permutation.
Another thing you should keep in mind is that inside the application to
first thing it does is to place the origin at the center of the image -
this is done to help convergence. So the "final parameters" are with
respect to this origin placing.
While the "overall transform" is with respect to the origin back in
(0,0,0) pixel.
- Lydia
> -----Original Message-----
> From: Christina Lee [mailto:dreamie222@yahoo.com]
> Sent: Friday, February 14, 2003 9:44 AM
> To: Lydia Ng
> Subject: RE: MultiResMIRegistration example
>=20
> Lydia,
>=20
> Thanks for your reply. However, I do have an
> additional question regarding the 'final parameters'.
> If I remember correctly, the first four (the
> quaternion) consist of the rotational info, whereas
> the last three equal translation. I guess I don't
> quite understand how the quaternion is derived & how
> it is related to the overall transform matrix.
>=20
> Christina
>=20
> --- Lydia Ng <lng@insightful.com> wrote:
> > Hi Christina,
> >
> > The MultiResMIRegistration program does 3D
> > multi-modality *rigid* registration.
> >
> > Let M =3D "overall transform matrix" and T =3D "overall
> > transform translation", then
> > we have
> >
> > y =3D M * x + T
> >
> > where
> > x =3D position in the fixed image (taking into account
> > the fixed image spacing as specified
> > in the input parameter file) and
> > y =3D corresponding position in the moving image (also
> > taking into account the moving image spacing as
> > specified in the input parameter file.
> >
> > The matrix M should be a pure rotation matrix.
> >
> > Does this help?
> >
> > - Lydia
> >
> > PS: I am also forwarding this reply to
> > insight-users@public.kitware.com as the response
> > might also be useful to other users.
> >
> > -----Original Message-----
> > From: Christina Lee [mailto:dreamie222@yahoo.com]
> > Sent: Fri 2/14/2003 8:41 AM
> > To: Lydia Ng; luis.ibanez@kitware.com
> > Cc:
> > Subject: MultiResMIRegistration example
> >
> >
> >
> > Hi Lydia & Luis,
> >
> > I have a quick question about the overall transform
> > matrix outputted by the MultiResMIRegistration
> > program.
> > Does that tranform matrix include both rotations &
> > translations? And does it take account of voxel
> > differences (or spacings) of the two images?
> >
> > Thanks,
> >
> > Christina
> >
> > Final parameters: [-0.0378283, -0.00839379,
> > 0.0137514,
> > 0.999154, 11.6141, -8.60712, -5.3134]
> >
> > Overall transform matrix:
> > 0.999481 0.0281146 0.015733
> > -0.0268445 0.99676 -0.0758234
> > -0.0178138 0.0753617 0.996997
> >
> > Overall transform offset:
> > -3.26713 -4.81888 -17.0997
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Shopping - Send Flowers for Valentine's Day
> > http://shopping.yahoo.com
> >
> >
> >
>=20
>=20
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com