[Insight-users] Observer for Demons registration

Luis Ibanez luis.ibanez at kitware.com
Fri, 30 Jan 2004 18:25:29 -0500


Hi Radhika,

There is not an explicit notion of "Metric"
in the Demons registration filter.

You are simply updating a PDE over the
the deformation field.

What you probably want to do is to use a
multi-resolution approach by using first the filter
in a subsampled version of your images.

In that way you can check on the intermetiate
results of the registration at every resolution
level.

Now that.... if you feel adventurous you could
implement a metric measure in the

   itk::DemonsRegistrationFunction

by cumulating the values of (f-g)^2.  After all
what the Demons algorithm is minimizing is the
sum of squared differences between the fixed
image and the deformed moving image.

Look at the file

   Insight/Code/Algorithms/
     itkDemonsRegistrationFunction.txx

in line 206 there is the computation of the
difference between the fixed image pixel
intensity and the deformed moving image


double speedValue = fixedValue - movingValue;

If you create a new member variable
double m_Metric and add

   m_Metric += speedValue * speedValue


then you could print out the value of this\
value metric from the IniitializeIteration
method, for example, and get a feeling on
how the Sum of Squared differences is
changing over time.

If you find that useful, let us know and
we will explore a way of making this value
available through the filter.



   Regards,


     Luis


------------------------------
Radhika Sivaramakrishna wrote:

> Hi Luis,
> 
> I used the example in itkDemonsRegistrationFilterTest.cxx and put in the 
> class ShowProgressObject as well as setting the Command/Observer to my 
> registration filter. The function GetProgress shows the progress of the 
> registration. Is there any other function to show the actual metric value or
> 
> something equivalent so that there is some way to halt the process if 
> things are not moving along fine? What does GetOutputs() do?
> 
> Radhika
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Wednesday, January 28, 2004 10:35 AM
> To: Radhika Sivaramakrishna
> Cc: ITK
> Subject: Re: [Insight-users] Observer for Demons registration
> 
> 
> Hi Radhika,
> 
> 
> Yes,
> The DemonsRegistrationFilter invoke progress
> events as any well-behaved ITK filter.
> 
> Simply connect a Command/Observer to the filter
> and set it to observe: ProgressEvents.
> 
> 
> For an example on how to do this, you may want
> to look at the code in
> 
>   Insight/Testing/Code/Algorithms/
>       itkDemonsRegistrationFilterTest.cxx
> 
> 
> Where is this neatly done.
> 
> 
> Regards,
> 
> 
>     Luis
> 
> 
> --------------------------------
> Radhika Sivaramakrishna wrote:
>  > Hi Luis,
>  >
>  > 
>  >
>  > Is there a way to track the progress of Demons registration filter to
>  > see what it does at each iteration?
>  >
>  > 
>  >
>  > Radhika
>  >
>  > 
>  >
>  > -----------------------------------------------------
>  >
>  > Confidentiality Notice.
>  >
>  > This email message is for the sole use of the intended recipient(s) and
>  > may contain confidential and privileged information. Any unauthorized
>  > review, use, disclosure or distribution is prohibited. If you are not
>  > the intended recipient, please contact the sender by reply email and
>  > destroy all copies of the original message. If you are the intended
>  > recipient, please be advised that the content of this message is subject
>  > to access, review and disclosure by the sender's Email System 
> Administrator.
>  >
> 
> 
>                                                     
> ----------------------------------------------------- 
> Confidentiality Notice.
> This email message is for the sole use of the intended recipient(s) and 
> may contain confidential and privileged information. Any unauthorized 
> review, use, disclosure or distribution is prohibited. If you are not 
> the intended recipient, please contact the sender by reply email and 
> destroy all copies of the original message. If you are the intended 
> recipient, please be advised that the content of this message is subject 
> to access, review and disclosure by the sender's Email System Administrator.
>