[Fwd: Re: [Insight-users] PointsetToImageRegistrationMethod]

David Macias Verde dmacver at gobiernodecanarias.org
Tue, 23 Mar 2004 20:04:58 +0000


--=-U6XCDyOF+6vhjHRCjy1E
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear Luis:

Thank you very much for your wise help.=20

I know it is the second time I ask you for it, but I sincerely cannot
find Insight/Examples/DataRepresentation/Mesh/ImageToPointSet.cxx
anywhere. Could you please tell where to go and get it? I've downloaded
again the whole distribution but it's not in.

Regards,

David Mac=EDas




-----Forwarded Message-----

> From: Luis Ibanez <luis.ibanez at kitware.com>
> To: dmacver at gobiernodecanarias.org
> Cc: ITK Users <insight-users at public.kitware.com>
> Subject: Re: [Insight-users] PointsetToImageRegistrationMethod
> Date: Tue, 23 Mar 2004 10:10:55 -0500
>=20
>=20
> Hi David,
>=20
> Matching Canny edges of the Moving image against
> the Distance map of the Fixed image Canny edges
> is a great idea.
>=20
> The only trick is that the MeanSquaresMetric is
> not what you can use for such matching.  This
> metric tries to minimize the difference between
> the pixel values of your canny edge map and the
> values of the Distance map.  Since the canny edges
> are bright (high values), and the Distance map values
> are zero over the fixed image edges, the optimization
> necessarily will climb up in the distance map, looking
> for higher values, that unfortunately correspond to
> larger distances to the fixed image edges.
>=20
> You need a metric that will be optimal when the bright
> pixels of the moving-image canny-edges will be on the
> *zero* values of the distance map.
>=20
> A possible metric could be to simply compute the sum of
> the distance map values that are the images of the moving
> image canny edges under the spatial transform.
>=20
> You can implement this metric in a very efficient way
> by creating a PointSet from your Canny edges moving image.
> For this purpose you can use the new example:
>=20
>     Insight/Examples/DataRepresentation/Mesh/
>                          ImageToPointSet.cxx
>=20
> and simply add an if() condition inside the for() loop
> in order to generate points only in the pixels corresponding
> to edges. Once you get this PointSet, you can create a new
> PointSetToImageMetric base on a criterion like the one we
> mention above (e.g. sum of distance map values).
>=20
> Note that you can do even better by taking advantage
> of the fact that the DanielssonDistanceMap not only
> tells you how far you are from the edges, it also tells
> you in what direction to move in order to get closer.
> If you use this information you coud feed the Levenberg-
> Marquardt optimizer and perform registration at very
> high speed.  Similar techniques are the ones used for
> performing registration in Image Guided Surgery where
> you need almost real-time registration.
>=20
>=20
> Regards,
>=20
>=20
>     Luis
>=20
>=20
> -----------------------------------
> David Macias Verde wrote:
> > Hi all:
> >=20
> > I'm sorry for this silly question, but I am new to ITK (and also the=20
> > rest of the basic things, as C++, VTK, Qt, which are the tools I'm=20
> > trying to bring together). To me I see a huge field for just an apprent=
ice.
> >=20
> > At this time I'm doing rigid registration in the following manner:
> >=20
> > FixedImage                                         MovingImage
> >       ||                                                     ||
> >       \/                                                     \/=20
> > itkCannyEdgeDetectorFilteri                        =20
> > itkCannyEdgeDetectorFilter
> >       ||                                                   =20
> >       \/                                                  =20
> > itkDanielssonDistanceMapImageFilter
> >=20
> >                                        ||
> >                                        ||
> >                                        ||
> >                                        \/
> >                               itkTranslationTransform
> >                                        ||
> >                                        \/
> >                       itkRegularStepGradientDescentOptimizer
> >                                        ||
> >                                        \/
> >                        itkMeanSquaresPointSetToImageMetric
> >                                        ||
> >                                        \/
> >                           itkLinearInterpolateImageFunction
> >                                        ||
> >                                        \/
> >                         itkPointsetToImageRegistrationMethod
> >=20
> > The trouble I get is that the images, far to converge, go the other way=
=20
> > round. The results of the registration algorithm are:
> >=20
> > Result =3DTranslation X =3D -90.4793
> > Translation Y =3D 103.5
> > Iterations    =3D 99
> > Metric value  =3D 1.04037e+09
> >=20
> > Could anyone give a hint on how I can solved this to cross over such a =
task?
> >=20
> > Thanks in advance,
> >=20
> > --=20
> > David Macias Verde <_david.maciasverde at gobiernodecanarias.org_=20
> > <mailto:david.maciasverde at gobiernodecanarias.org>>
> > Servicio de F=EDsica M=E9dica - Hospital de Gran Canaria Dr. Negr=EDn
> >=20
>=20
>=20

--=20
David Macias Verde <david.maciasverde at gobiernodecanarias.org>
Servicio de F=EDsica M=E9dica - Hospital de Gran Canaria Dr. Negr=EDn

--=-U6XCDyOF+6vhjHRCjy1E
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
Dear Luis:<BR>
<BR>
Thank you very much for your wise help. <BR>
<BR>
I know it is the second time I ask you for it, but I sincerely cannot find Insight/Examples/DataRepresentation/Mesh/ImageToPointSet.cxx anywhere. Could you please tell where to go and get it? I've downloaded again the whole distribution but it's not in.<BR>
<BR>
Regards,<BR>
<BR>
David Mac&#237;as<BR>
<BR>
<BR>
<BR>
<BR>
-----Forwarded Message-----
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><B><I>From:</B> Luis Ibanez &lt;luis.ibanez at kitware.com&gt;
<B>To:</B> dmacver at gobiernodecanarias.org
<B>Cc:</B> ITK Users &lt;insight-users at public.kitware.com&gt;
<B>Subject:</B> Re: [Insight-users] PointsetToImageRegistrationMethod
<B>Date:</B> Tue, 23 Mar 2004 10:10:55 -0500


Hi David,

Matching Canny edges of the Moving image against
the Distance map of the Fixed image Canny edges
is a great idea.

The only trick is that the MeanSquaresMetric is
not what you can use for such matching.  This
metric tries to minimize the difference between
the pixel values of your canny edge map and the
values of the Distance map.  Since the canny edges
are bright (high values), and the Distance map values
are zero over the fixed image edges, the optimization
necessarily will climb up in the distance map, looking
for higher values, that unfortunately correspond to
larger distances to the fixed image edges.

You need a metric that will be optimal when the bright
pixels of the moving-image canny-edges will be on the
*zero* values of the distance map.

A possible metric could be to simply compute the sum of
the distance map values that are the images of the moving
image canny edges under the spatial transform.

You can implement this metric in a very efficient way
by creating a PointSet from your Canny edges moving image.
For this purpose you can use the new example:

    Insight/Examples/DataRepresentation/Mesh/
                         ImageToPointSet.cxx

and simply add an if() condition inside the for() loop
in order to generate points only in the pixels corresponding
to edges. Once you get this PointSet, you can create a new
PointSetToImageMetric base on a criterion like the one we
mention above (e.g. sum of distance map values).

Note that you can do even better by taking advantage
of the fact that the DanielssonDistanceMap not only
tells you how far you are from the edges, it also tells
you in what direction to move in order to get closer.
If you use this information you coud feed the Levenberg-
Marquardt optimizer and perform registration at very
high speed.  Similar techniques are the ones used for
performing registration in Image Guided Surgery where
you need almost real-time registration.


Regards,


    Luis


-----------------------------------
David Macias Verde wrote:
&gt; Hi all:
&gt; 
&gt; I'm sorry for this silly question, but I am new to ITK (and also the 
&gt; rest of the basic things, as C++, VTK, Qt, which are the tools I'm 
&gt; trying to bring together). To me I see a huge field for just an apprentice.
&gt; 
&gt; At this time I'm doing rigid registration in the following manner:
&gt; 
&gt; FixedImage                                         MovingImage
&gt;       ||                                                     ||
&gt;       \/                                                     \/ 
&gt; itkCannyEdgeDetectorFilteri                         
&gt; itkCannyEdgeDetectorFilter
&gt;       ||                                                    
&gt;       \/                                                   
&gt; itkDanielssonDistanceMapImageFilter
&gt; 
&gt;                                        ||
&gt;                                        ||
&gt;                                        ||
&gt;                                        \/
&gt;                               itkTranslationTransform
&gt;                                        ||
&gt;                                        \/
&gt;                       itkRegularStepGradientDescentOptimizer
&gt;                                        ||
&gt;                                        \/
&gt;                        itkMeanSquaresPointSetToImageMetric
&gt;                                        ||
&gt;                                        \/
&gt;                           itkLinearInterpolateImageFunction
&gt;                                        ||
&gt;                                        \/
&gt;                         itkPointsetToImageRegistrationMethod
&gt; 
&gt; The trouble I get is that the images, far to converge, go the other way 
&gt; round. The results of the registration algorithm are:
&gt; 
&gt; Result =Translation X = -90.4793
&gt; Translation Y = 103.5
&gt; Iterations    = 99
&gt; Metric value  = 1.04037e+09
&gt; 
&gt; Could anyone give a hint on how I can solved this to cross over such a task?
&gt; 
&gt; Thanks in advance,
&gt; 
&gt; -- 
&gt; David Macias Verde &lt;_david.maciasverde at gobiernodecanarias.org_ 
&gt; &lt;mailto:david.maciasverde at gobiernodecanarias.org&gt;&gt;
&gt; Servicio de F&#237;sica M&#233;dica - Hospital de Gran Canaria Dr. Negr&#237;n
&gt; 

</I></FONT></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
David Macias Verde &lt;<A HREF="mailto:david.maciasverde at gobiernodecanarias.org"><U>david.maciasverde at gobiernodecanarias.org</U></A>&gt;<BR>
Servicio de F&#237;sica M&#233;dica - Hospital de Gran Canaria Dr. Negr&#237;n
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>

--=-U6XCDyOF+6vhjHRCjy1E--