<div dir="ltr">Hi,<br><br>Sometimes it's hard or impossible to compute the derivative of a metric. <br><br>In these cases, you could use a derivative-free optimizer such as AmoebaOptimizer or SPSAOptimizer. These optimizers don't call GetDerivative() so you can just implement it with an empty function.<br>
<br>Their disadvantage is that they usually require more samples of the metric (more calls to GetValue()).<br><br>- Aviv<br><br><br><div class="gmail_quote">2008/7/24 Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi 田光建<br>
<br>
Yes, if you are creating a new metric, you must<br>
derive it from itk::ImageToImageMetric, you should<br>
implement the method<br>
<br>
GetValue( parameters )<br>
<br>
and you need to implement the methods:<br>
<br>
<br>
GetDerivative( parameters )<br>
<br>
and<br>
<br>
GetValueAndDerivative(...)<br>
<br>
Please take a look at other metrics, for example,<br>
the MeanSquaresImageToImageMetric would be an<br>
easy example to follow.<br>
<br>
<br>
Regards,<br>
<br>
<br>
Luis<br>
<br>
<br>
-------------<br>
田光建 wrote:<br>
> Thank you for your answer, Luis. If I want to develope my own special<br>
> image metric, I need to calculate the derivative. What should I do?<br>
> Should I derive my own class from itk class and override the<br>
> GetDerivative() and GetValueAndDerivative()?<br>
><br>
> > Date: Wed, 23 Jul 2008 10:29:29 -0400<br>
> > From: <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a><br>
> > To: <a href="mailto:gjtian@hotmail.com" target="_blank">gjtian@hotmail.com</a><br>
> > CC: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
> > Subject: Re: [Insight-users] Image Registration Metric Derivative<br>
> Calculation<br>
> ><br>
> ><br>
> > Hi 田光建,<br>
> ><br>
> ><br>
> > Simply call the method<br>
> ><br>
> ><br>
> > GetDerivative()<br>
> ><br>
> > or<br>
> ><br>
> > GetValueAndDerivative()<br>
> ><br>
> > on the metric that you are using.<br>
> ><br>
> > It will return an array with the values of the derivative<br>
> > of the Metric with respect to the transform parameters.<br>
> ><br>
> > Regards,<br>
> ><br>
> ><br>
> > Luis<br>
> ><br>
> ><br>
> > ------------------<br>
> > 田光建 wrote:<br>
> > > Hi,All<br>
> > ><br>
> > > I want to know how to calculate the metric derivative in ITK for<br>
> > > registration. We assume that the first order derivative of the image<br>
> > > metric with respect to the transformation parameters, I want to<br>
> know how<br>
> > > to calculate it?<br>
> > ><br>
> > > Thank you all.<br>
> > ><br>
> > ><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>
> ------------------------------------------------------------------------<br>
> MSN上小游戏,工作休闲两不误! 马上就开始玩! <<a href="http://im.live.cn/minigame" target="_blank">http://im.live.cn/minigame</a>><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>
</blockquote></div><br></div>