Hi Felix,<br><br>Thanks for letting us know of your progress.<br><br>All ITK optimizers have the same API for setting the<br>scaling parameters array.<br><br>However, the Optimizer parameters themselves <br>are very unique to every optimizer. Therefore, you<br>
have to familiarize yourself with the optimizer <br>parameters that control the equivalent of the <br>"Step length" concept.<br><br>This is critical, because it may be responsible from<br>jumping to a position that is too far in the parametric<br>
space, and therefore results on your image fixed <br>image not overlapping any longer with the moving<br>image.<br><br><br> Regards,<br><br><br> Luis<br><br><br>-------------------------<br><div class="gmail_quote">
On Thu, Oct 8, 2009 at 8:43 AM, Felix Bollenbeck <span dir="ltr"><<a href="mailto:Felix.Bollenbeck@iff.fraunhofer.de">Felix.Bollenbeck@iff.fraunhofer.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font size="2" face="sans-serif">Dear Luis, dear users</font>
<br>
<br><font size="2" face="sans-serif">thanks for your hint.</font>
<br>
<br><font size="2" face="sans-serif">The problems seems to be comming from
the scales - the floating image is indeed far far away (see below).
</font>
<br><font size="2" face="sans-serif"> I
have done some reading on the quasi newton methods maths, but completely
forgot thinking about parameter scaling, so I had kept the scales from
the gradientDescent code.</font>
<br>
<br>
<br><font size="2" face="sans-serif">Using uniform 1.0 scaling avoids the
first error, but then stepsizes are 2-3 maginitudes to small laeving the
metric value almost unchanged, over the iterations.</font>
<br>
<br><font size="2" face="sans-serif">Does the LBFGS class have a different
interface for the scaling parameters </font>
<br><font size="2" face="sans-serif"> and
where would I look best for more info on the scale parameters?</font>
<br>
<br><font size="2" face="sans-serif">Best regards,</font>
<br>
<br><font size="2" face="sans-serif"> Felix.</font>
<br>
<br>
<br><font size="1" face="Courier New">Initial =</font>
<br><font size="1" face="Courier New"> Angle (radians) = 0</font>
<br><font size="1" face="Courier New"> Angle (degrees) = 0</font>
<br><font size="1" face="Courier New"> Center X =
111.125</font>
<br><font size="1" face="Courier New"> Center Y =
116.064</font>
<br><font size="1" face="Courier New"> Translation X = 11.9944</font>
<br><font size="1" face="Courier New"> Translation Y = -8.46667</font>
<br><font size="1" face="Courier New">Number of Pixels=425780</font>
<br><font size="1" face="Courier New">FixedImage schedule: [1, 1]</font>
<br>
<br><font size="1" face="Courier New">MovingImage schedule: [1, 1]</font>
<br>
<br><font size="1" face="Courier New">-------------------------------------</font>
<br><font size="1" face="Courier New">MultiResolution Level : 0</font>
<br>
<br><font size="1" face="Courier New">GetValueAndDerivative [0, 111.125,
116.064, 11.9944, -8.46667]
// <====================================</font>
<br>
<br><font size="1" face="Courier New">*************************************************</font>
<br><font size="1" face="Courier New"> N=5 NUMBER OF CORRECTIONS=5
INITIAL VALUES F= 15301 GNORM= 5.16606e+06</font>
<br><font size="1" face="Courier New">*************************************************</font>
<br><font size="1" face="Courier New"> I NFN FUNC
GNORM STEPLENGTH</font>
<br><font size="1" face="Courier New">GetValueAndDerivative [0.000196306,
111.125, 116.064, 9324.5, 17691.2] //
<====================================</font>
<br><font size="1" face="Courier New">ExceptionObject caught !</font>
<br>
<br><font size="1" face="Courier New">itk::ExceptionObject (0x7f9f10)</font>
<br><font size="1" face="Courier New">// snip </font>
<br><font size="1" face="Courier New">Description: itk::ERROR: MeanSquaresImageToImageMetric(0x7f2260):
All the points mapped to outside of the moving image</font>
<br>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td width="40%"><font size="1" face="sans-serif"><b>Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>></b>
</font>
<br><font size="1" face="sans-serif">Gesendet von: <a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a></font>
<p><font size="1" face="sans-serif">06.10.2009 20:42</font>
<br>
</p></td><td width="59%">
<table width="100%">
<tbody><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">An</font></div>
</td><td><div class="im"><font size="1" face="sans-serif"><a href="mailto:Felix.Bollenbeck@iff.fraunhofer.de" target="_blank">Felix.Bollenbeck@iff.fraunhofer.de</a></font>
</div></td></tr><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">Kopie</font></div>
</td><td><font size="1" face="sans-serif"><a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a></font>
</td></tr><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">Thema</font></div>
</td><td><font size="1" face="sans-serif">Re: [Insight-users] LBFGS with Centered2DTransform:
All points mapped to outside of the
moving image</font></td></tr></tbody></table>
<br>
<table>
<tbody><tr valign="top">
<td>
</td><td></td></tr></tbody></table>
<br></td></tr></tbody></table><div><div></div><div class="h5">
<br>
<br>
<br>
<br><tt><font size="2">Hi Felix,<br>
<br>
Thanks for the clear description of the problem.<br>
<br>
If the Exception is thrown before printing the first<br>
iteration of the optimizer, it is then likely that the<br>
problem is in the initialization of the transform.<br>
<br>
...<br>
<br>
Printing out the parameters that are received<br>
by the Metric in its first evaluation will help<br>
answering the question.<br>
<br>
Simply add a std::cout in the GetValueAndDerivative()<br>
method, of the Metric that you are using.<br>
<br>
<br>
Please let us know what you find,<br>
<br>
<br>
Thanks<br>
<br>
<br>
Luis<br>
<br>
<br>
---------------------------------------------------------------<br>
On Wed, Sep 30, 2009 at 9:39 AM, <<a href="mailto:Felix.Bollenbeck@iff.fraunhofer.de" target="_blank">Felix.Bollenbeck@iff.fraunhofer.de</a>>
wrote:<br>
><br>
> Dear ITK user,<br>
><br>
> I want to use the LBFGS for centered 2D registration, instead of gradient<br>
> descent, hoping for a little speed-up.<br>
><br>
> I exchanged the optimizer in one of the multi-res examples.<br>
><br>
> (The regular step gradient optimization works fine. )<br>
><br>
> The LBFGS version complains though:<br>
><br>
> "All points mapped to outside of the moving image"<br>
><br>
> I assume, I have made two possible errors:<br>
><br>
><br>
> 1. Scales are not passed correctly to
the LBFGS and back, so that<br>
> the floating image is indeed way off course<br>
><br>
><br>
> and /or<br>
><br>
> 2. Transform and/or Metric do not deliver
derivatives as the<br>
> optimizer expects it, and the registration method assumes that these
values<br>
> are zero<br>
><br>
><br>
><br>
> The exeception is thrown before any optimizer positions are printed.<br>
><br>
> Can you point me in the right direction?<br>
><br>
> Regards,<br>
><br>
> Felix.<br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> </font></tt><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><tt><font size="2">http://www.kitware.com/opensource/opensource.html<br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> </font></tt></a><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank"><tt><font size="2">http://www.itk.org/Wiki/ITK_FAQ<br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> </font></tt></a><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank"><tt><font size="2">http://www.itk.org/mailman/listinfo/insight-users<br>
><br>
><br>
_____________________________________<br>
Powered by www.kitware.com<br>
<br>
Visit other Kitware open-source projects at<br>
</font></tt></a><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><tt><font size="2">http://www.kitware.com/opensource/opensource.html<br>
<br>
Please keep messages on-topic and check the ITK FAQ at: </font></tt></a><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank"><tt><font size="2">http://www.itk.org/Wiki/ITK_FAQ<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</font></tt></a><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank"><tt><font size="2">http://www.itk.org/mailman/listinfo/insight-users<br>
</font></tt></a>
<br></div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<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>