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:<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 class="gmail_quote">On Sun, Jul 12, 2009 at 10:07 AM, 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 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>