<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). &nbsp;
&nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; I
have done some reading on the quasi newton methods &nbsp;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">&nbsp; &nbsp; &nbsp; &nbsp; 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">&nbsp; &nbsp; &nbsp; &nbsp; Felix.</font>
<br>
<br>
<br><font size=1 face="Courier New">Initial =</font>
<br><font size=1 face="Courier New">&nbsp;Angle (radians) &nbsp; = 0</font>
<br><font size=1 face="Courier New">&nbsp;Angle (degrees) &nbsp; = 0</font>
<br><font size=1 face="Courier New">&nbsp;Center X &nbsp; &nbsp; &nbsp;=
111.125</font>
<br><font size=1 face="Courier New">&nbsp;Center Y &nbsp; &nbsp; &nbsp;=
116.064</font>
<br><font size=1 face="Courier New">&nbsp;Translation X = 11.9944</font>
<br><font size=1 face="Courier New">&nbsp;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] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; // &lt;====================================</font>
<br>
<br><font size=1 face="Courier New">*************************************************</font>
<br><font size=1 face="Courier New">&nbsp; N=5 &nbsp; NUMBER OF CORRECTIONS=5
&nbsp; &nbsp; &nbsp; INITIAL VALUES F= 15301 &nbsp; GNORM= 5.16606e+06</font>
<br><font size=1 face="Courier New">*************************************************</font>
<br><font size=1 face="Courier New">&nbsp; &nbsp;I &nbsp; NFN &nbsp; &nbsp;FUNC
&nbsp; &nbsp; &nbsp; &nbsp;GNORM &nbsp; &nbsp; &nbsp; STEPLENGTH</font>
<br><font size=1 face="Courier New">GetValueAndDerivative [0.000196306,
111.125, 116.064, 9324.5, 17691.2] &nbsp; &nbsp; &nbsp; &nbsp;//
&lt;====================================</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%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Luis Ibanez &lt;luis.ibanez@kitware.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Gesendet von: insight-users-bounces@itk.org</font>
<p><font size=1 face="sans-serif">06.10.2009 20:42</font>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">An</font></div>
<td><font size=1 face="sans-serif">Felix.Bollenbeck@iff.fraunhofer.de</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Kopie</font></div>
<td><font size=1 face="sans-serif">insight-users@itk.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Thema</font></div>
<td><font size=1 face="sans-serif">Re: [Insight-users] LBFGS with Centered2DTransform:
All points &nbsp; &nbsp; &nbsp; &nbsp;mapped to outside of the
moving image</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br><tt><font size=2>Hi &nbsp;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>
 &nbsp; Please let us know what you find,<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Thanks<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Luis<br>
<br>
<br>
---------------------------------------------------------------<br>
On Wed, Sep 30, 2009 at 9:39 AM, &nbsp;&lt;Felix.Bollenbeck@iff.fraunhofer.de&gt;
wrote:<br>
&gt;<br>
&gt; Dear ITK user,<br>
&gt;<br>
&gt; I want to use the LBFGS for centered 2D registration, instead of gradient<br>
&gt; descent, hoping for a little speed-up.<br>
&gt;<br>
&gt; I exchanged the optimizer in one of the multi-res examples.<br>
&gt;<br>
&gt; (The regular step gradient optimization works fine. )<br>
&gt;<br>
&gt; The LBFGS version complains though:<br>
&gt;<br>
&gt; &quot;All points mapped to outside of the moving image&quot;<br>
&gt;<br>
&gt; I assume, I have made two possible errors:<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; 1. Scales are not passed correctly to
the LBFGS and back, so that<br>
&gt; the floating image is indeed way off course<br>
&gt;<br>
&gt;<br>
&gt; and /or<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; 2. Transform and/or Metric do not deliver
derivatives as the<br>
&gt; optimizer expects it, and the registration method assumes that these
values<br>
&gt; are zero<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; The exeception is thrown before any optimizer positions are printed.<br>
&gt;<br>
&gt; Can you point me in the right direction?<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Felix.<br>
&gt; _____________________________________<br>
&gt; Powered by www.kitware.com<br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; </font></tt><a href=http://www.kitware.com/opensource/opensource.html><tt><font size=2>http://www.kitware.com/opensource/opensource.html<br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; </font></tt><a href=http://www.itk.org/Wiki/ITK_FAQ><tt><font size=2>http://www.itk.org/Wiki/ITK_FAQ<br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; </font></tt><a href="http://www.itk.org/mailman/listinfo/insight-users"><tt><font size=2>http://www.itk.org/mailman/listinfo/insight-users<br>
&gt;<br>
&gt;<br>
_____________________________________<br>
Powered by www.kitware.com<br>
<br>
Visit other Kitware open-source projects at<br>
</font></tt><a href=http://www.kitware.com/opensource/opensource.html><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 href=http://www.itk.org/Wiki/ITK_FAQ><tt><font size=2>http://www.itk.org/Wiki/ITK_FAQ<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</font></tt><a href="http://www.itk.org/mailman/listinfo/insight-users"><tt><font size=2>http://www.itk.org/mailman/listinfo/insight-users<br>
</font></tt></a></a></a></a></a></a>
<br>