[Insight-users] Multi-resolution deformable registration

Luis Ibanez luis . ibanez at kitware . com
Thu, 27 Nov 2003 22:11:33 -0500


Hi Corinne,


A) When you use the multi-resolution option you should set
    the paramters in the following lines:


% ---------------------------------------------------------
% Parameters for the single- or multi-resolution techniques
% ---------------------------------------------------------
1	% Number of levels in the multi-res pyramid (1 = single-res)
1	% Highest level to use in the pyramid
  1 1    	% Scaling at lowest level of pyramid


Let's say that you want a pyramid of three levels with images that
are scaled by 1X, 2X, 4X. Note that the pyramid is preset for
generating power of 2 for the scaling. That is, every level is
alway half size of the previous one.

The data that you need to setup in the configuration file
will look like:


% ---------------------------------------------------------
% Parameters for the single- or multi-resolution techniques
% ---------------------------------------------------------
3	% Number of levels in the multi-res pyramid (1 = single-res)
3	% Highest level to use in the pyramid
  4 4    	% Scaling at lowest level of pyramid


    You will find details on how these parameters are used
    in the registration process by looking at the code in

        Insight/Code/Algorithms/itkFEMRegistrationFilter.txx

    on the method  MultiResSolve() line 1812.
    Just like Tchaikovsky's symphony,... pure coincidence  :-)




B) The code that parses the configuration file for the
    deformable FEMRegistration algorithm is available in

    Insight/Code/Algorithms/itkFEMRegistrationFilter.txx

    in the method  ReadConfigFile() lines 336-543.

    The configuration file line concerning your question

    "0 0.99  % Similarity metric (0=mean sq, 1 = ncc,
                       2=pattern int,> 3=MI, 5=demons)

    is parsed in code lines 427-430.

    The first code is an identified of the image metric
    used for comparing the matching between block of the
    fixed and moving images. You will find descriptions
    of this metrics in the SoftwareGuide

    http://www . itk . org/ItkSoftwareGuide . pdf

    Section 8.9, pdf-pages 308-313.

    If you are doing same-modality registration you should
    be fine with 0= mean squares metric.

    If your are doing multi-modality registration you should
    go with 3= Mutual Information (MI).

    The second value on the line = 0.99 is actually not being
    used. It was intended to normalize the gradients of the
    metrics. The reason for doing so is that the metrics have
    different dynamic ranges. For example mean squares goes
    from zero to any positive value, Mutual Information goes
    from zero to one, Normalized correlation goes from -1 to zero.

    There is room for improvement in this region of the code...

    In the meantime, simply ignore the second parameter.



C) About the encoding of the deformation field, this also
    have room for improvement. I agree with you in that it
    should carry over the origin and spacing of the fixed
    image.

    This has just been fixed by adding the lines

    m_Field->SetSpacing( m_FixedImage->GetSpacing() );
    m_Field->SetOrigin( m_FixedImage->GetOrigin() );

    to the method InitializeField() in itkFEMRegistrationFilter.txx
    lines 1055.



D) The displacement field also should be output in a single
    multi-component image with format

        XYZXYZXYZ....

    instead of the current approach of sending N images
    each one with one of the vector components of the deformation
    field.

    If we output the image as above, you could use the free
    and open source program ParaView (www.paraview.org) in order
    to visualize the displacement vector field.

    Curiously enough, it is easier to write the multi-component
    image than to write the separate components.  The code has
    just been added by creating the new method

    WriteDisplacementFieldMultiComponent()

    It invocation was also added to the DeformableRegistration1.cxx
    example in Insight/Examples/Registration

    Note that by default we are writing the field to a file
    named

        "VectorDeformationField.mhd"

    This is a MetaImage format file. It would be more elegant to
    get this name from the configuration file...




Please let us know if you find any problems or you have
further comments. Feedback from users is fundamental for
improving the quality and usefulness of the toolkit.


Thanks a lot,



   Luis



------------------------
Corinne Mattmann wrote:

> Hi,
> 
> I'm trying to deformably register two 3D images: I began with the
> example "DeformableRegistration1.cxx" (femregistrationfilter) and the
> config-file "FiniteElementRegistrationParameters1.txt" and changed it
> successfully to 3D. At the moment I'm adapting the parameters and trying
> to use the multi-resolution option and there were two questions arising
> to which I can't find an answer:
> - I would like to play with the shrink factors between the different
> resolution-levels. Where can I set these values?
> - Why does the following line in the config-file have two parameters and
> what do they stand for?
> 	"0 0.99  % Similarity metric (0=mean sq, 1 = ncc, 2=pattern int,
> 3=MI, 5=demons)"
> 
> Thanks for your answers,
> Corinne
> 
> Another thing: The deformation field I get out of the filter has a
> spacing of 1 in all three directions and origin 0, although my original
> image had other values. Is there a reason to output the deformation
> field like this?
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>