<div>HI Luis,</div>
<div>Thanks for your prompt reply. Yes, I did set the optimizer (Regular Step Gradient Descent optimizer) as the following way which I forgot to include in last posting.</div>
<div> </div>
<div> optimizer->SetMaximumStepLength( 0.50000 );<br> optimizer->SetMinimumStepLength( 0.01 );<br> optimizer->SetNumberOfIterations( 200 );<br> optimizer->SetGradientMagnitudeTolerance( 0.01*optimizer->GetGradientMagnitudeTolerance() );
</div>
<div> </div>
<div>Later on I tried to increase the step lengths as:</div>
<div> </div>
<div> optimizer->SetMaximumStepLength( 1.000 );</div>
<div> optimizer->SetMinimumStepLength( 0.05 );<br> </div>
<div>And I had the following metric output:</div>
<div> </div>
<div>0 -0.835581 [-0.0321978, -0.466639, 0.883861]<br>1 -0.840282 [0.399061, -0.885096, 1.68318]<br>2 -0.837371 [0.259052, -0.883767, 2.67333]<br>3 -0.824043 [0.75875, -0.889684, 2.68965]<br>4 -0.829629
[0.55809, -0.881664, 2.83855]<br>5 -0.82694 [0.679164, -0.884414, 2.80759]<br>6 -0.828347 [0.623941, -0.882636, 2.8368]<br>7 -0.827662 [0.566916, -0.881064, 2.86234]</div>
<div> </div>
<div>The only change is the step length but the results are similar to the previous one. By the way for the LBFGSB optimizer I used the following conditions:</div>
<div> </div>
<div> // (1) LBFGSB optimizer<br> OptimizerType::BoundSelectionType boundSelect( transform->GetNumberOfParameters() );<br> OptimizerType::BoundValueType upperBound( transform->GetNumberOfParameters() );<br>
OptimizerType::BoundValueType lowerBound( transform->GetNumberOfParameters() );<br> boundSelect.Fill( 0 );<br> upperBound.Fill( 10.0 );<br> lowerBound.Fill( -10.0 );<br> optimizer->SetBoundSelection( boundSelect );
<br> optimizer->SetUpperBound( upperBound );<br> optimizer->SetLowerBound( lowerBound );<br> optimizer->SetMaximumNumberOfEvaluations( 200 );<br> optimizer->SetMaximumNumberOfCorrections( 200 );</div>
<div> </div>
<div>Here I am not clear what you meant for best setting. I thought the conditions I provided were reasonable. Do you see anything obviously different which leads to different results?</div>
<div> </div>
<div>Cheers,</div>
<div>Ming</div>
<div> </div>
<div><span class="gmail_quote">On 5/2/06, <b class="gmail_sendername">Luis Ibanez</b> <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi Ming,<br><br><br>Did you set the optimizer to do Minimization or Maximization ?<br>that is, did you used any of the following:
<br><br><br> optimizer->MaximizeOn() ?<br> optimizer->MaximizeOff() ?<br> optimizer->MinimizeOn() ?<br> optimizer->MinimizeOff() ?<br><br>How much overlap did the images have at the end of the run
<br>with the RegularStepNormalized Correlation ?<br><br>Note that the lasts iterations of the run with<br>RegularStepGradientDescent are advancing at very<br>small steps.<br><br>You may want to start the optimizer with a larger initial
<br>value of the StepLength, and to change the default relaxation<br>factor to be 0.7 or 0.9 instead of the default value 0.5.<br><br>In this way, the step length will change to 0.7 of the previous<br>value every time that the gradient changes directions.
<br><br>You will get a lot of insight about the registration process<br>by plotting the trace of the translation in 3D. This will<br>show you how much the Transform is changing at every iteration.<br>This is not clearly conveyed just by looking at the numbers.
<br><br>You will find the 2D version of many of these types of plots<br>in the ITK Software Guide,<br><br> <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br><br><br>Note that it is not surprising that you get different
<br>results from different optimizers, but before you attempt<br>to compare the results you should make sure that you are<br>actually using both optimizers in their best settings and<br>conditions. Otherwise it is just a bias and unfair
<br>comparison.<br><br><br><br> Regards,<br><br><br> Luis<br><br><br><br>=================<br>Ming Chao wrote:<br>> Hi,<br>><br>> When I used Regular Step Gradient Descent optimizer to register two<br>> images I saw an abnormal behavior. The metric value first decreased but
<br>> after some iterations it became larger. See the following output:<br>><br>> 0 -0.835581 [-0.00321978, -0.0466639, 0.0883861]<br>> 1 -0.836504 [-0.00422488, -0.0933436, 0.176817]<br>> 2 -0.83737
[-0.00293453, -0.139983, 0.265265]<br>> 3 -0.838174 [0.000731481, -0.18652, 0.353701]<br>> 4 -0.838908 [0.00685175, -0.232884, 0.442092]<br>> 5 -0.839563 [0.015502, -0.278993, 0.530404]<br>> 6 -
0.840129 [0.0267537, -0.32476, 0.618602]<br>> 7 -0.840598 [0.0406717, -0.370081, 0.706649]<br>> 8 -0.84096 [ 0.0573129, -0.414844, 0.794509]<br>> 9 -0.84121 [0.0767229, -0.458919, 0.882148]<br>> 10 -
0.841343 [0.0989338, -0.50216, 0.969537]<br>> 11 -0.841358 [0.123961, -0.544401, 1.05665]<br>> 12 -0.841256 [0.151799, -0.58545 , 1.14349]<br>> 13 -0.841041 [0.182419, -0.625084, 1.23004]<br>> 14 -
0.840719 [0.215761, -0.663034, 1.31634]<br>> 15 -0.840298 [0.214669, -0.680096, 1.41487]<br>> 16 -0.839375 [0.216594, -0.696938, 1.51342]<br>> 17 - 0.838339 [0.221686, -0.713544, 1.6119]<br>> 18 -
0.837215 [0.230089, -0.729893, 1.7102]<br>> 19 -0.836032 [0.241937, -0.74596, 1.80819]<br>> 20 -0.83482 [0.257347, -0.76171, 1.90573]<br>> 21 -0.833613 [0.276409, - 0.7771, 2.00268]<br>> 22 -0.832445
[0.299184, -0.792076, 2.09889]<br>> 23 -0.831349 [0.325688, -0.806571, 2.19422]<br>> 24 -0.830357 [0.35589, -0.820502, 2.28853]<br>> 25 -0.829494 [0.389705, -0.833768, 2.3817]<br>> 26 -0.828783
[0.426981, -0.84624, 2.47365]<br>> 27 -0.828236 [0.467495, -0.857749, 2.56435]<br>> 28 -0.827859 [0.510938, -0.868055, 2.65383]<br>> 29 -0.827633 [0.556896, -0.876774, 2.74221]<br>> 30 -0.827525
[ 0.60475, -0.883034, 2.8298]<br>> 31 -0.827502 [0.650812, -0.875321, 2.91822]<br>> 32 -0.827512 [0.629235, -0.881114, 2.87349]<br>> 33 -0.827519 [0.603546, -0.883645, 2.83067]<br>> 34 -0.827483
[0.620407, -0.880267 , 2.84881]<br>> 35 -0.827564 [0.608674, -0.882388, 2.84506]<br>> 36 -0.827459 [0.613038, -0.88246, 2.84059]<br>> 37 -0.827529 [0.610107, -0.882339, 2.84166]<br>> 38 -0.827493
[0.611332, -0.882386, 2.8407]<br>><br>> However, if I change the optimizer to the LBFGSB optimizer, I got the<br>> following output:<br>><br>> 0 -0.840282 [-0.0321978, -0.466639, 0.883861]<br>> 1 -
0.840732 [0.0493198, -0.53362, 1.01199]<br>> 2 -0.840735 [0.0592661, -0.540774, 1.03432]<br>> 3 -0.840751 [0.100359, -0.570829, 1.11035]<br>><br>> This looks reasonable. The setup for the registration is the following:
<br>><br>><br>> typedef itk::BSplineInterpolateImageFunction<ImageType, double ><br>> InterpolatorType;<br>> typedef itk::ImageRegistrationMethod<ImageType, ImageType ><br>> RegistrationType;
<br>><br>> typedef<br>> itk::NormalizedCorrelationImageToImageMetric<ImageType,ImageType ><br>> MetricType;<br>><br>> typedef itk::TranslationTransform< double, Dimension ><br>> TransformType;
<br>><br>> Can anybody tell me why I have so different results with different<br>> optimizers?<br>><br>> Thanks,<br>><br>> Ming<br>><br>><br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br>