[Insight-users] Re: Question

Lydia Ng lng at insightful . com
Thu, 30 May 2002 09:23:29 -0700


Buu,

 > Final parameters: 0.0047598  -0.00330879  0.00411093  0.999975=20
1.04916  -8.86594  -0.0830282

The final parameters is the parameters for the rigid transform
represented by a unit quaterion (the first 4 numbers) and
translation (the last three numbers).

The relationship between a "quaternion" (q0,q1,q2,q3) and
"axis (n0,n1,n2) and angle (t)" is

(q0,q1,q2,q3) =3D (n0 sin(t/2), n1 sin(t/2), n3 sin(t/2), cos(t/2))

Note that the transform maps
a point from the *fixed* image to a point in the *moving* image.

-Lydia =20

-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
Sent: Wednesday, May 29, 2002 9:11 PM
To: Buu Tien Phan; insight-users@public.kitware.com
Subject: [Insight-users] Re: Question




Hi Buu,

If your are using the BrainWeb images
ftp://public.kitware.com/pub/itk/Data/BrainWeb/
as input, you have to change the pixel type in the
MultiResMIRegistration example, the default type in
the example is: "signed short" and the BrainWeb
images in the ftp server are of pixel type:
"unsigned char".


Note that the first thing that the MultiResMI example
does is to convert the input images to float and
normalize them. The subsequent computations for
registration are done on float images.


Please edit the file:

    Examples/MultiResMIRegistration/MIRegistrationApp.h

and in line 43: replace

    typedef signed short InputPixelType;

by

    typedef unsigned char InputPixelType;

(This line number is for the BetaRelease,
so that should match in your installation.)

This PixelType is propagated by typedefs through all the
example, so there is only one line to change. Recompile
the example and run it with the input file that we sent you.
We have run the example with these images and this input file
both after compiled in Debug and Release modes and we obtain
a correct output on the .raw image and the PGM slices.

--

About the "Final Parameters" in the output of the example:

These parameters printed in the output are the parameters
of the Affine Transform used for the registration.

An Affine transform in 3D is composed of a matrix M (3x3) and
a Translation vector T. A point P gets transformed by the
operation:

                  P'  =3D  M . P + T

The matrix M applies rotations, shearing and scaling,
while T just translate the point.  In order to understand
the parameters you may want to take a look at the
itkAffineTransform.txx file in Code/Common.

Look in particular in the GetParameters() and SetParameters()
methods. In 3D the first 9 parameters are the coefficients
of the matrix and the last 3 are the coefficients of the
translation vector.




Please let us know if you encounter any problems changing
the pixel type on the example, or during the execution.


Thanks

     Luis


PS. Please try to get Service Pack 5 for VC++ installed !




=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Buu Tien Phan wrote:
 >
 > I still have problem with the out put of
 > MultiResMIRegistration example. I have installed a new Insight =
version
 > (beta). Also I have Service Pack 3 installed in my computer ( I will
 > have SP 5 next week). Now I go to another option which is changing
 > "signed short" to "unsigned char". However, I have been unable to =
find
 > where this line is in the example. Could you indicate where these =
lines
 > are in the example? Last time, you gave me the number but it was not
 > correct.
 >
 >
 > Also, when we run the example, the application print out some values.
 > The "Final parameters" line have some values. I am not sure what they
 > mean. I am sending the "info.txt" file printed when running the =
example.
 >
 >
 >
 > Thank you very much for your help.
 >
 >
 >
 >
 >
 > Buu Phan
 >
 >
 > =
------------------------------------------------------------------------
 >
 > Target filename: brainweb1e1a10f20.raw
 > Big Endian: 1
 > Image Size: [181, 217, 181]Image Spacing: 1 1 1
 >
 > Reference filename: brainweb1e1a10f20Rot10Tx15.raw
 > Big Endian: 1
 > Image Size: [181, 217, 181]Image Spacing: 1 1 1
 >
 > Number of levels: 4
 > Target shrink factors: 4 4 4
 > Reference shrink factors: 4 4 4
 > Number of iterations: 2500 2500 2500 2500
 > Learning rates: 0.0001 1e-005 5e-006 5e-007
 > Translation scales: 100 100 100 100
 >
 > Registered image filename: registered.raw
 > Big Endian: 1
 >
 > Dump PGM files: 1
 > PGM directory: PGM
 >
 > Reading in target.
 > Reading in reference.
 > Normalizing the target.
 > Mean: -4039.59 StdDev: 10126.4
 > Normalizing the reference.
 > Mean: -4129.57 StdDev: 10085.4
 > Setting up the registrator.
 > Start the registration.
 > Final parameters: 0.0047598  -0.00330879  0.00411093  0.999975=20
1.04916  -8.86594  -0.0830282
 > Transforming the reference.
 > Writing registered image to registered.raw.
 > Writing PGM files of the target.
 > Writing PGM files of the reference.
 > Writing PGM files of the registered image.
 >





_______________________________________________
Insight-users mailing list
Insight-users@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-users