<br>Hi Jimmy,<br><br>Thanks for letting us know about your version of Insight and InsightApplications.<br><br>This seems to be a real bug:<br><br>The API of itkCenteredEuler3DTransforms changed around March 2005, and this<br>
program was not updated correctly to match the new API.<br><br><a href="http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkCenteredEuler3DTransform.h?root=Insight&amp;r1=1.4&amp;r2=1.5">http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkCenteredEuler3DTransform.h?root=Insight&amp;r1=1.4&amp;r2=1.5
</a><br><br>The most recent API of the itkCenteredEuler3DTransform&nbsp; used 9 parameters:<br><br>&nbsp;&nbsp; 3 for rotation<br>&nbsp;&nbsp; 3 for translation<br>&nbsp;&nbsp; 3 for the center of rotation<br><br>The program however, still expects only 6 parameters:
<br><br>&nbsp; 3 for rotation<br>&nbsp; 3 for translation<br><br><br>We have just reported this as Bug#5382:<br><a href="http://public.kitware.com/Bug/bug.php?op=show&amp;bugid=5382">http://public.kitware.com/Bug/bug.php?op=show&amp;bugid=5382
</a><br><br><br>The simplest solution is for you to replace the<br><br>&nbsp;&nbsp; CenteredEuler3DTransform<br><br>with the<br><br>&nbsp;&nbsp; Euler3DTransform <br><br>We are now making similar changes in the CVS version of InsightApplications.
<br><br><br>----<br><br><br>&nbsp; Regarding the meaning of the Optimizer scales please read the <br>&nbsp; ITK Software Guide<br><br>&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a>
<br><br><br>&nbsp;&nbsp; in particular the &quot;Image Registration&quot; chapter.<br><br>&nbsp;&nbsp; The purpose of the scaling array that is passed to the optimizer <br>&nbsp;&nbsp; is to make more uniform the dynamic range of the Transform <br>&nbsp;&nbsp; parameters. 
E.g.&nbsp; radians in rotations versus millimeters in <br>&nbsp;&nbsp; Translation.<br><br>&nbsp;&nbsp; The size of the parameter scaling array *MUST* be the same <br>&nbsp;&nbsp; of the number of Transform parameters, since each element <br>&nbsp;&nbsp; of the parameter scaling array correspond to one of the 
<br>&nbsp;&nbsp; Transform parameters.<br>&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp; This is explained in the ITK Software Guide, and has been <br>&nbsp;&nbsp; discussed many times in the list. Please read the guide and<br>&nbsp;&nbsp; let us know if you still have any questions.
<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<br><br><br><br><br>==============================================<br><div><span class="gmail_quote">On 7/23/07, <b class="gmail_sendername">jimmy</b> &lt;<a href="mailto:jimmy_lab@163.com">
jimmy_lab@163.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank you for your reply.<br><br>The version of Insight and InsightApplication are both 
2.8.1.<br>The source file of IntensityBased2D3DRegistration is also attached.<br><br>Line 994 is where the problem located.<br>Could you tell me that what the meaning of weightings here used by Optimizer?<br>optimizer-&gt;SetScales(weightings);&nbsp;&nbsp;// &lt;- what do the scales stand for?
<br><br>I have also downloaded the newest version of IntensityBased2D3DRegistration, it seems to be unchanged.<br>The file version is&nbsp;&nbsp;&quot;Version:&nbsp;&nbsp; $Revision: 1.4 $ &quot;.<br><br>Thanks in advance.<br><br><br>------------------
<br>jimmy<br>2007-07-23<br><br>-------------------------------------------------------------<br>发件人:Luis Ibanez<br>发送日期:2007-07-22 23:01:25<br>收件人:jimmy<br>抄送:insight-users<br>主题:Re: [Insight-users] Problem about the&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ITKAPP-IntensityBased2D3DRegistration
<br><br><br>Hi Jimmy,<br><br>&nbsp;&nbsp; What version of Insight&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; are you using ?<br>&nbsp;&nbsp; What version of InsightApplications are you using ?<br><br>Over time the API of some of the ITK transforms has changed.<br>Notably, the Center of rotation, used to be part of the
<br>parameters of the transform. This may explain the mismatch<br>between 6 and 9 parameters.<br><br>It is likely that you are combining two imcompatible versions<br>of Insight and InsightApplications.<br><br><br> Please let us know,
<br><br><br>&nbsp;&nbsp; Thanks<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Luis<br><br><br>--------------<br>jimmy wrote:<br>&gt; Hi, everyone:<br>&gt;<br>&gt; When I running the ITKAPP [IntensityBased2D3DRegistration],<br>&gt; an error occurs as the following:
<br>&gt;<br>&gt; itk::ExceptionObject (00F7FCD0)<br>&gt; Location: &quot;void __thiscall itk::RegularStepGradientDescentBaseOptimizer::Advance<br>&gt; OneStep(void)&quot;<br>&gt; File: ITKSource\Code\Numerics\itkRegularStepGradientDescentBaseOptimizer.cxx
<br>&gt; Line: 200<br>&gt; Description: itk::ERROR: RegularStepGradientDescentOptimizer(015128A8): The size<br>&gt;&nbsp;&nbsp;of Scales is 6, but the NumberOfParameters for the CostFunction is 9.<br>&gt;<br>&gt; Can someone tell my why?&nbsp;&nbsp; ( The test example is from BrainWeb )
<br>&gt;<br>&gt; 1.<br>&gt; Is it the problem of<br>&gt; itk::Optimizer::ScalesType weightings( 6 );&nbsp;&nbsp;?<br>&gt;<br>&gt; What does it use for?&nbsp;&nbsp;How to expand it into *9?*<br>&gt;<br>&gt; 2.<br>&gt; And when I ignore the option of the command line
<br>&gt;&nbsp;&nbsp;./IntensityBased2D3DRegistration [-t -100 -100 -100] projection.mhd /data/BrainWeb/brainweb165a10f17.mha<br>&gt;<br>&gt; The iteration of optimizer is 0, and the parameters of transform do not change.<br>&gt; furthermore the programe crashed when writing the wrong result image.
<br>&gt;<br>&gt; Don&#39;t you think it is more reasonable that we should not input any tranformation information before registration?<br>&gt;<br>&gt;<br>&gt;<br>&gt; --------------<br>&gt; jimmy<br>&gt; 2007-07-18<br>&gt;
<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; Insight-users mailing list<br>&gt; <a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br>&gt; <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>