[Insight-users] Gradient Difference Metric

Aviv Hurvitz aviv.hurvitz at gmail.com
Wed Jun 25 10:38:34 EDT 2008


Hi Sven,

I'll give you more information than you bargained for, but the goal is to
save you and others from wasting any more time with this metric.

In short, the GradientDifferenceImageToImageMetric is bad! It has one huge
bug and a few other debatable problems. The huge bug is that it returns the
MAXIMUM value when the registered images are perfectly aligned, whereas it
should return the MINIMUM. That's right, this metric actually pushes the
moving image away from the right result.

I wonder how this came to be? My guess is that the original developer was
using it in a different framework, where registration involved maximizing. I
Googled a bit and the few reports on this metric were either that it doesn't
work or that it *maybe* works, so I guess it  checks out.

This is good news, actually, because it means we can change the metric
without worrying about breaking existing working code. :)

As for the other debatable problems:
1. I don't like the way it finds the "subtractionFactor" -- really slow.
2. I don't like the way it computes the derivative using finite differences
- slow and highly dependent on the magic number "delta".

I was intending to insert a formal bug fix, but I got held up by nagging
tasks like writing an M.Sc. thesis.

I'm attaching a fixed version, however in this version I crippled the
(questionable) "subtractionFactor"  feature.

As for optimizers, this metric computes its derivative using finite
differences, which seems somehow wrong. (Isn't this the job of the
optimizer?) I recommend to use a derivative-free optimizer like
AmoebaOptimizer or SPSAOptimizer.

Hope this helps.

- Aviv

On Wed, Jun 25, 2008 at 2:44 PM, Fischer, Sven <
Sven.Fischer at medizin.uni-leipzig.de> wrote:

>  Hi all,
>
>
>
> I'm using the Gradient Difference Metric for registering two images. It
> seems to me that I have a global optima at the correct position, but there
> are also a lot of local optima. So the registration isn't able to find the
> correct transformation. Has someone an advice which optimizer I should use
> or how I could smooth the objective function?
>
> Also I wished to know if there is a pattern intensity metric available in
> ITK?
>
>
>
> Regards,
>
> Sven
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080625/8e25bf6b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkGradientDifferenceImageToImageMetric.txx
Type: application/octet-stream
Size: 12512 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080625/8e25bf6b/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkGradientDifferenceImageToImageMetric.h
Type: application/octet-stream
Size: 8965 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080625/8e25bf6b/attachment-0003.obj>


More information about the Insight-users mailing list