[Insight-users] RE: On MultiResMIRegistration

Lydia Ng lng@insightful.com
Mon, 18 Nov 2002 08:51:15 -0800


Hi Valli,

Sorry to hear you are having troubles, it kind of hard
to figure out what's going on remotely.

A few questions for you.

1) Are the images you are using signed short?=20
When you inspect the output pgms does the=20
fixed and moving images look ok?

2) What did you use to obtain your moving image?
Did that transformation take the spacing into account?
This is important as the ITK registration the parameters
are with respect to patient coordinates as oppose to
image coordinates.

- Lydia


> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez@kitware.com]
> Sent: Saturday, November 16, 2002 7:25 AM
> To: valli gummadi
> Cc: Lydia Ng; insight-users@public.kitware.com
> Subject: Re: On MultiResMIRegistration
>=20
>=20
>=20
> Hi Valli,
>=20
>=20
> If you notice that increasing the number of iterations
> results in quite different matrices, this may indicate
> that the optimization is unstable.
>=20
>=20
> Here are several recommendations
> (and probably Lydia can give us a sounder advice too):
>=20
>=20
> 1) You may want to trace the evolution of the optimization
>     process. In order to do so, you may take advantage of
>     Obsever/Event mechanism in ITK. The optimizer invoke
>     IterationEvent at every iteration. You can create and
>     Observer and register it with the optimizer in order
>     to get feedback at every iteration. This will allow you
>     to monitor how the transform is changing in the parameter
>     space. With this insight you may be in a better position
>     to determine if the optimization is needing more iterations,
>     or a larger learning rate, or a smaller learning rate.
>=20
>     You can find an example of an Observer in the file
>=20
>     Insight/Testing/Code/Algorithms/itkCommandIterationUpdate.h
>=20
>     This class (deriving from itk::Command) is watching for
>     iteration events in optimizers and printing the set of
>     parameters at every iteration. Please note that with an
>     affine transform in 3D the set of paramters is just the
>     dump of the matrix coefficients followed by the translation
>     components. You will see then 12 numbers. the first 9 will
>     be the matrix coefficients (row by row), the last three will
>     be the translation components (x,y,z).
>=20
>     When the optimization is well behaved these numbers should
>     evolve in a monotonic way, without much oscilations.
>=20
>=20
> 2) Because you are usin a multiresolution approach, there is
>     some freedom in how much iterations you want to performe
>     at each level of the pyramid and what learning rate for each
>     one.
>=20
>     I will recomend you to start tunning the low resolution
>     level first (and don't even look at the other). Make sure
>     that you find a combination of parameters where the first
>     level converges. The final result of the first level doesn't
>     have to be very precise (e.g. your 1.75 degrees angle) but
>     rather should be going consistently to the same value and
>     stay stable even if you increase the iterations for this
>     particular level.
>=20
>     Once you got the lower level to converge, don't touch its
>     parameters, just proceed to analyze the second level.
>     Play again with the learning rate and number of iterations
>     on this level until you get a consistent convergence.
>     (that is, more iterations will not change the result).
>=20
>     More repeating this procedure level by level until you get
>     to the high resolution level.  You may expect the transform
>     at each level to get closer and closer to the theoretical
>     value (1.75 degrees rotation around X).
>=20
>=20
>=20
> 3) Be careful though when judging how different a rotation
>     matrix is from another. It is hard to interpret a matrix
>     directly from the coefficients. A much reliable way of
>     comparision is to convert the matrix in to an itk::Versor
>     (which is just a unit Quaternion), Versors manage only
>     the rotational part of a quaternion and keep the scale
>     to unit.
>=20
>     By converting the matrix to a Versor you could easily
>     compare the axis around which the rotation is happening
>     and the angle of such rotation.
>=20
>=20
> 4) You could start easier by not using a full AffineTransform
>     but rather a Rigid3D transform. This will reduce the number
>     of parameters in the optimization from 12 to 7. That is,
>     the optimizer will be exploring a 7-dimensional space instead
>     of a 12-dimensional one.
>=20
>=20
> ----
>=20
>=20
> Unfortunately Registration is not a black box (nor is Segmentation)
> to which you can just feed images and extract results blindly.
>=20
>=20
> We could imagine in the future, to plug and smart class on top
> of the Multiresolution Registration to implement a strategy for
> convergence. That will releive you from being there trying to
> fine tune parameters.  Probably a soft-computing approach
> could be appropriated for this. [Ssoft-computing is this combination
> of Neural-Networks, Fuzzy Loging and Evolutionary algorithms,
> they are quite efficient in adapting to new situations....]
>=20
>=20
> ---
>=20
>=20
>=20
> Please let us know if you have further questions,
>=20
>=20
>     Thanks
>=20
>=20
>       Luis
>=20
>=20
> =
=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
>=20
> valli gummadi wrote:
>=20
> > Dear Mr.Luis,
> >        When I increased the number of iterations i could get the=20
> > following matrix.
> > Matrix:
> > 0.999999  -0.000407  0.001650
> > 0.000470  0.999254  -0.038604
> > -0.001633  0.038604  0.999253
> > Offset Values:
> > -0.111432  -0.675801  -3.244812
> >=20
> > I have taken 4 levels.
> > iterations are 2500,1000,1000,10.
> > learning rates are 1e-6,1e-5,5e-6,1e-6.
> >=20
> > When i try to increase the iterations further,matrix values=20
> are totally=20
> > different from the expected values.In the transformation matrix
> > -0.03864 is closer to the -sin(1.75).But,additional=20
> rotations are taking=20
> > place in other axis.Why this is ocuuring.Please give some=20
> suggestions=20
> > regarding this.
> >=20
> > Regards,
> > Valli.
> >=20
> >=20
> >=20
>=20
>=20
>=20
>=20
>=20