[Insight-users] MultiResMIRegistration Example

Luis Ibanez luis.ibanez@kitware.com
Tue, 09 Apr 2002 23:51:44 -0400


Dhananjay,

This example uses the MultiResolution framework
which was nicely implemented by Lydia Ng (@Insigthful).


This framework creates two pyramid representations of the fixed
and moving images.  The idea behind this structure is that instead
of using the full resolution of the images you can get a rough
approximation of the registration by first using reduced (subsampled )
versions of the two images.

Let's say that your images are 512x512x200.  It will take a good
deal of time just to evaluate the metric for this pair of images.

If instead you subsample the images to (for example):

  Level 0) 64x64x25
  Level 1) 128x128x50
  Level 2) 256x256x100
  Level 3) 512x512x200


Using the level (0) you will run the metric 8^3 times faster.
(assuming that evaluate the Mutualinformation metric with
a number of samples proportional to the number of pixels)

This initial registration, will be quite approximate but also
quite fast. Taking the transform resulting from this first level
as initial position, the algorithm proceed to perform a registration
using the images at the next level (Level 1) { this time running 8
times slower than level(0) }.  A more precise registration will be
obtained and again the resulting transform is used as initial value
for the next level (level (2)) ... and so on until you recover the
original  resolution of the images.

As explained in the ReadMe.pdf file in the source directory
of the example:

 Lines 11 of the input file specify the number of levels you want
to use in your pyramid. Line 12 specify the shrinking (subsampling)
factors that you want to use for the zero level (the most reduced
resolution)  along each dimension of the image (x,y,z).   Note that
usually  Z   is not subsampled because the typical volumes are
acquired at a lower resolution along Z and further subsampling can
result in undesirable losses of information. The factor between levels
is assumed to be 2. This is a given when the subsampling  is done
using wavelets decomposition. In this particular example the
subsampling is done using an intermediate gaussian blurring.
(subsampling always has to be preceed by smoothing in order to
maintain the hope of respecting Shannon's sampling theorem)

Line 13 specifies the shrinking (subsampling) factor for the moving
image.  The reason for having different shrinking factor on the moving
and fixed images is that MutualInformation is typically applied to
multimodal registration so you may expect the two images to be
acquired at different resolutions.  ( the example is registering PET
against CT !!).

Each level of the pyramid executes a full registration process.
The criterion for stopping the registration is usually a maximum
number of iterations in the optimizer.  For this reason Line 14 defines
the number of iterations that you want to set as maximum at each
level.   Normally we can expect that the first levels of the pyramid
will converge rapidly while the higher (high resolution) levels will
need more iterations... in practice you may want to experiment with
different combinations.  Stopping too early the lower levels will penalize
the next level by forcing it to be initialized far from its optimal 
position.


Line 9 define a permutation of axis. This is done to align the
anatomical axis of the image. Imagine that for example the PET
image was acquired with the cranio-caudal axis along X, while
the CT image was acquired with the cranio-caudal axis along Y.
It is not worth to run a registration process to align these two axis,
so this is solved by an initial "manual" preparation of the images.

Line 10 also allows to flip axis after the permutations have been
performed. This facilitate to commute left-right on an image.
This is necesary but you have to be careful !

The most common medical error in surgery is to confuse left-right !!
so make sure that you can justify to a Lawer that you really have a
good reason to flip this image and extract the left kidney        :-/

Line 15 defines learning rates:  This example uses a version
of the GradientDescent optimization algorithm. The length
of steps in this version is regulated by a "learning-rate" it
allows to control how far you jump from one position of the
parameter space to the next.  Big jumps will result in fast
optimizations but unstable behaviors. Small jumps will give
you stable optimization at a slower rate.... in practice... you
have to play a bit with the values to find a sweet-spot
combination.

We have found that a large part of the magic of any algorithm
comes from the fine tuning of its parameters....

Line 16 defines a scale factor for the translation parameters.
This is related with the transform used in this example: AffineTransform.
The affine transfom supports Translations, Rotations, Shearing and
Scaling.   Typically the numerical value of the coefficients representing
Translations is much larger that the numerical value of parameters
representing rotations or scales.  Rotations coefficients are typically 
[0,1],
scales coefficients [0.5,2] while Translation often goes as high as half 
the
pixel size of the image.  It is easy to get translations of 100 or so.  

The optimizers however treat all the coefficients on the  same parametric
space making that this numerical differences distort the effect of the
optimization. For example, rotation coefficient will not be modifed 
until the
translation has been resolved at a 1 pixel precision. In order to 
compensate
for this scale difference, you can specify a scaling correction for the 
Translation
parameters with respect to the other parameters in the Affine transform.

Half the pixel size of the larger image dimension is probably a good value.
(e.g. in the 512x512x200 example: 256 could be a reasonable factor) That
makes the scaled translation to be in the [0,1] range.


--

Please let us know if you find thing that we can improve in  the
documentation of the classes and / or examples.


  Thanks

   Luis


======================================

Dhananjay Kulkarni wrote:

>Hi,
>Thanks for the help.
>I was able to run the example . however I am not able to understand the
>meaning of the parameters in the parameter file.
>Is there any documentation available which will allow me understand the
>target and the reference parameters in a better manner? I would like to know
>how these parameters affect the output and their role in registration.
>
>e.g Shrink factor of the target and the reference.
>
>Thanks again,
>Dhananjay Kulkarni.
>
>
>_______________________________________________
>Insight-users mailing list
>Insight-users@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-users
>