<br>Hi motes,<br><br>If the deformation is not getting far enough, <br>you may have to:<br><br>1) Increase the number of iterations<br><br> and/or<br><br>2) Start with a larger SetMaximumStepLenght()<br><br>
and/or<br><br>3) Use a higher value in the SetRelaxationFactor()<br> the default is 0.5, you could try 0.9.<br><br><br><br>Think that the value of the Step length is *projected*<br>among all the Dimension of the BSpline parameter<br>
space. Therefore, the value that you set may have to<br>be hundreds of times larger than the deformation that<br>you expect to obtain.<br><br><br> Regards,<br><br><br> Luis<br> <br><br><br>--------------------------------------------------------------------------------<br>
<div class="gmail_quote">On Sun, Jul 12, 2009 at 4:34 PM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</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;">
I have updated the optimizer parameters to match the deformableTransform (since that is what is used in example4):<br><br> //ParametersType parameters(numberOfParameters);<br> OptimizerScalesType optimizerScales(numberOfBSplineParameters);<br>
optimizerScales.Fill(1.0);<br> optimizer->SetScales(optimizerScales);<br> ParametersType parameters(numberOfBSplineParameters);<br> parameters.Fill(0.0);<br> transform->SetParameters(parameters);<br> registration->SetInitialTransformParameters( transform->GetParameters() );<br>
std::cout << "Intial Parameters = " << std::endl;<br> std::cout << transform->GetParameters() << std::endl;<br><br><br>I now get a very small change in the registered image. I assume that the deformation I apply to get the moving image is to drastic. Is it not possible to do a more accurate registration with the following fixed and moving images:<div class="im">
<br>
<br>Fixed: <a href="http://img15.imageshack.us/img15/4683/lenad.jpg" target="_blank">http://img15.imageshack.us/img15/4683/lenad.jpg</a><br><br>Moving: <a href="http://img15.imageshack.us/img15/4364/lenadeform1.jpg" target="_blank">http://img15.imageshack.us/img15/4364/lenadeform1.jpg</a><br>
<br><br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Sun, Jul 12, 2009 at 10:07 AM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com" target="_blank">mort.motes@gmail.com</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;">
I get an error when I run DeformableRegistration4.c++ related to the itk::LBFGSOptimizer optimizer.<br><br>As Luis recommended I have therefore changed the optimizer to itk::RegularStepGradientDescentOptimizer. I have only changed the following optimizer related code in the example:<br>
<br>From:<br><br>// Old itk::LBFGSOptimizer settings<br>// optimizer->SetGradientConvergenceTolerance( 0.05 );<br>// optimizer->SetLineSearchAccuracy( 0.9 );<br>// optimizer->SetDefaultStepLength( 1.5 );<br>// optimizer->TraceOn();<br>
// optimizer->SetMaximumNumberOfFunctionEvaluations( 1000 );<br><br>To (based on the settings to the itk::RegularStepGradientDescentOptimizer from DeformableRegistration15.c++ ):<br><br> OptimizerScalesType optimizerScales(transform->GetNumberOfParameters() );<br>
const double translationScale = 1.0 / 1000.0;<br> optimizerScales[0] = 1.0;<br> optimizerScales[1] = 1.0;<br> optimizerScales[2] = 1.0;<br> optimizerScales[3] = translationScale;<br> optimizerScales[4] = translationScale;<br>
optimizerScales[5] = translationScale;<br> optimizer->SetScales( optimizerScales );<br> optimizer->SetMaximumStepLength( 0.2000 ); <br> optimizer->SetMinimumStepLength( 0.0001 );<br> optimizer->SetNumberOfIterations( 200 );<br>
<br><br>But when I run it on the following fixed and moving images:<br><br>Fixed: <a href="http://img15.imageshack.us/img15/4683/lenad.jpg" target="_blank">http://img15.imageshack.us/img15/4683/lenad.jpg</a><br><br>Moving: <a href="http://img15.imageshack.us/img15/4364/lenadeform1.jpg" target="_blank">http://img15.imageshack.us/img15/4364/lenadeform1.jpg</a><br>
<br>the result is completely identical to the moving image:<br><br>Result (registered image): <a href="http://img189.imageshack.us/img189/3148/lenaout.png" target="_blank">http://img189.imageshack.us/img189/3148/lenaout.png</a><br>
<br>Any ideas on what goes wrong? Is it related to the input images or do I need to tweak the new optimizer further?<br>
<br><br>
</blockquote></div><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>