<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%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Luis Ibanez <luis.ibanez@kitware.com></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 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 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, <Felix.Bollenbeck@iff.fraunhofer.de>
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 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:<br>
> </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>
><br>
><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>