<div>Okay, i have been investigeting the matter a bit more.</div>
<div>It seems that it actually has an effect when i set the <br>optimizer-&gt;SetMaximumNumberOfIterations</div>
<div>&nbsp;</div>
<div>It moves in intervals of 9. So if i set the MaximumNumberOfIterations = 1 it corresponds to 17 iterations.</div>
<div>if i set it to 10 it corresponds to 26 and so on.</div>
<div>In short:</div>
<div>value:&nbsp;&nbsp;&nbsp; </div>
<div>1-9&nbsp;&nbsp;&nbsp; : 17 iterations</div>
<div>
<div>10-18 :&nbsp;26 iterations</div>
<div>
<div>19-27 :&nbsp;35 iterations</div>
<div>
<div>28-36 :&nbsp;44 iterations</div>
<div>
<div>37-46 :&nbsp;53 iterations</div>
<div>etc.</div>
<div>&nbsp;</div>
<div>I find this very odd.</div>
<div>I read this reply made by Luis once:</div>
<div>&nbsp;</div>
<div>&gt;<i> The Amoeba optimizer in ITK is a wrapper around the vnl<br></i>&gt;<i> amoeba optimizer. Since VNL does not send any events during<br></i>&gt;<i> the iterations of its optimizers, ITK implemented a trick in 
</i>&gt;<i> the following way:<br></i>&gt;<i><br></i>&gt;<i>&nbsp;&nbsp;&nbsp;&nbsp; itkAmoebaOptimizer&nbsp; wraps vnl_amoeba<br></i>&gt;<i><br></i>&gt;<i>&nbsp;&nbsp;&nbsp; SingleValuedVnlCostFunctionAdaptor<br></i>&gt;<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wraps vnl_cost_function
<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> vnl_amoeba calls the f() method of the vnl_cost_function,<br></i>&gt;<i> that in turn calls the GetValue() method of the ITK<br></i>&gt;<i> SingleValuedVnlCostFunctionAdaptor.
<br></i>&gt;<i><br></i>&gt;<i> The SingleValuedVnlCostFunctionAdaptor sends events that<br></i>&gt;<i> are &quot;observed&quot; by the itkAmoebaOptimizer and resent as<br></i>&gt;<i> iteration events.<br></i>&gt;<i><br></i>
&gt;<i> In this way, we get events *per evaluation* of the cost<br></i>&gt;<i> function. Note that this is not completely equivalent<br></i>&gt;<i> to events per iteration of the amoeba_optimizer,.... but<br></i>&gt;<i> it is better than nothing.
<br></i>&gt;<i><br></i>&gt;<i> as a rule of thumb you could expect that N evaluations of<br></i>&gt;<i> the cost_function are equivalent to one iteration of the<br></i>&gt;<i> amoeba optimizer, where N is the dimensionality of the
<br></i>&gt;<i> parametric space of the cost function.<br></i></div>
<div>
<div>So i should expect that my amount of parameters is 9. The problem is that it is only 7, since i use the </div>
<div>itkSimilarity3DTransform ie. (Rx,Ry,Rz,Tx,Ty,Tz,S = 7)</div>
<div>So i cannot understand why the iteration count behaves like this.</div>
<div>&nbsp;</div>
<div>Any suggestions?</div></div>
<div><i>&nbsp;</i></div></div></div></div></div>
<div>&nbsp;</div>
<div><br>&nbsp;</div>
<div><span class="gmail_quote">2006/11/29, Arne Hansen &lt;<a href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hello.</div>
<div>I am using an amoeba optimizer to minimize overlap (itkKappaStatistic) between 2 binary volumes.</div>
<div>&nbsp;</div>
<div>My problem is that it seems that when i set parameters </div>
<div>optimizer-&gt;SetMaximumNumberOfIterations(1);</div>
<div>optimizer-&gt;SetParametersConvergenceTolerance(10);<br>optimizer-&gt;SetFunctionConvergenceTolerance(10);</div>
<div>&nbsp;</div>
<div>they dont seem to have any affect at all. Even though i tell it to maximal do 1 iteration, it still does 17 iterations in the first layer of my itkMultiResolutionImageRegistrationMethod.</div>
<div>&nbsp;</div>
<div>Furthermore, as i am doing kappastatistic, the maximum function value is of course 1 for perfectly</div>
<div>gemetric aligned images. So the function value is -1 all the time(Because i told the optimizer to maximize and not nminimize. But still, it does first convergeafter the 17 iterationss in the top pyramid. And the same for the rest of the pyramid. 
</div>
<div>Here is the result from a 2-layered pyramid.......</div>
<div>&nbsp;</div>
<div><font size="2">
<p>Iteration count : 0</p>
<p>///////////////////////////////////////////////////////////</p>
<p>Pyramid level0</p>
<p>///////////////////////////////////////////////////////////</p>
<p>-1:</p>
<p>//[]</p>
<p>[0, 0, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.00025, 0, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0, 0.00025, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0, 0, 0.00025, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0, 0, 0, 0.025, 0, 0, 1]</p>
<p>-1:</p>
<p>[0, 0, 0, 0, 0.025, 0, 1]</p>
<p>-1:</p>
<p>[0, 0, 0, 0, 0, 0.025, 1]</p>
<p>-1:</p>
<p>[0, 0, 0, 0, 0, 0, 1.05]</p>
<p>-1:</p>
<p>[7.1428571429e-005, 7.1428571429e-005, 7.1428571429e-005, 0.0071428571429, 0.0071428571429, 0.0071428571429, 1.0142857143]</p>
<p>-1:</p>
<p>[1.7857142857e-005, 1.7857142857e-005, 1.7857142857e-005, 0.0017857142857, 0.0017857142857, 0.0017857142857, 1.0035714286]</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0, 0.000125, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0, 0, 0.0125, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0, 0, 0, 0.0125, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0, 0, 0, 0, 0.0125, 1]</p>
<p>-1:</p>
<p>[0.000125, 0, 0, 0, 0, 0, 1.025]</p>
<p>-1:</p>
<p>[0.000125, 0, 0, 0, 0, 0, 1]</p>
<p>Iteration count : 17</p>
<p>///////////////////////////////////////////////////////////</p>
<p>Pyramid level1</p>
<p>///////////////////////////////////////////////////////////</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.00025, 0.000125, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0.00025, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0.00025, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0, 0.025, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0, 0, 0.025, 0, 1]</p>
<p>-1:</p>
<p>[0.000125, 0.000125, 0, 0, 0, 0.025, 1]</p>
<p>-0.97433615191:</p>
<p>[0.000125, 0.000125, 0, 0, 0, 0, 1.05]</p>
<p>-0.96254003621:</p>
<p>[0.00016071428571, 0.00016071428571, 7.1428571429e-005, 0.0071428571429, 0.0071428571429, 0.0071428571429, 0.95]</p>
<p>-1:</p>
<p>[0.00013392857143, 0.00013392857143, 1.7857142857e-005, 0.0017857142857, 0.0017857142857, 0.0017857142857, 1.025]</p>
<p>-1:</p>
<p>[0.0001875, 0.0001875, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0.000125, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0, 0.0125, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0, 0, 0.0125, 0, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0, 0, 0, 0.0125, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0, 0, 0, 0, 1]</p>
<p>-1:</p>
<p>[0.0001875, 0.000125, 0, 0, 0, 0, 1.025]</p>
<p>----------------------------Registration completed-------------------</p>
<p>&nbsp;</p>
<p>Result : </p>
<p>Translation X = 0</p>
<p>Translation Y = 0</p>
<p>Translation Z = 0</p>
<p>Rotation X = 0.70710678119</p>
<p>Rotation Y = 0.70710678119</p>
<p>Rotation Z = 0</p>
<p>GetAngle = 0.0005303300921</p>
<p>Offset = -0.021839980215 0.021839980215 -0.0025979353519</p>
<p>Matrix = </p>
<p>0.99999992969 7.03125e-008 0.00037499998682</p>
<p>7.03125e-008 0.99999992969 -0.00037499998682</p>
<p>-0.00037499998682 0.00037499998682 0.99999985938</p>
<p>Offset = </p>
<p>[-0.021839980215, 0.021839980215, -0.0025979353519]</p></font></div>
<div>&nbsp;</div>
<div>Culd someone help my. Than you very much</div></blockquote></div><br>