Hi Sven,<br><br>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.<br><br>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.<br>
<br>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.<br>
<br>This is good news, actually, because it means we can change the metric without worrying about breaking existing working code. :)<br><br>As for the other debatable problems:<br>1. I don't like the way it finds the "subtractionFactor" -- really slow.<br>
2. I don't like the way it computes the derivative using finite differences - slow and highly dependent on the magic number "delta".<br><br>I was intending to insert a formal bug fix, but I got held up by nagging tasks like writing an M.Sc. thesis.<br>
<br>I'm attaching a fixed version, however in this version I crippled the (questionable) "subtractionFactor" feature.<br><br>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.<br>
<br>Hope this helps. <br><br>- Aviv<br><br><div class="gmail_quote">On Wed, Jun 25, 2008 at 2:44 PM, Fischer, Sven <<a href="mailto:Sven.Fischer@medizin.uni-leipzig.de" target="_blank">Sven.Fischer@medizin.uni-leipzig.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="DE">
<div>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi all,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">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?</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Also I wished to know if there is a pattern intensity
metric available in ITK?</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Regards,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Sven</span></font></p>
</div>
</div>
<br>_______________________________________________<br>
Insight-users mailing list<br>
<a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>