Hi Luis,<br>Indeed, using the initialization of the transform caused the registration process to start converge.<br>Now I have some more questions:<br><br>1. When I used the itkVersorRigid3DTransformOptimizer with MI as similarity measure I got the following:
<br><br><br>0 -0.503786 [0.225825, 0.130641, -0.089263, 17.0313, -5.89068, 2.82659]<br>1 -0.530214 [0.0337306, 0.00517666, 0.0194914, 17.0843, -13.8388, 3.57437]<br>2 -0.732826 [0.0115593, 0.0676283, -0.240682
, 19.3635, -10.6118, 3.26182]<br><br>I understood that the most left number is the number of iteration. But when I used the powell optimizer with my similarity measure I got:<br>0 1256 [0.24891, 0, 0, 16.8535, -21.8262
, 1.51675]<br>0 1256 [0.24891, 0, 0, 16.8535, -21.8262, 1.51675]<br>0 1249 [0.214091, 0, 0, 16.8535, -21.8262, 1.51675]<br>0 1245 [0.217064, 0, 0, 16.8535, -21.8262, 1.51675]<br><br>Isn't the event occur in each iteration of the optimizer?
<br><br>2. I set the powell optimizer parameters as follows:<br> optimizer->SetStepLength( 0.00001 ); <br> optimizer->SetStepTolerance( 0.000005 );<br> optimizer->SetValueTolerance( 50 );<br><br>But when the optimizer reached the requested tolerance it did not stop: here is the output:
<br>iter: 0 val: 717 step: 0.0001 [0.000361803, 0, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 717 step: 0.0001 [0.000423607, 0, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 717 step: 0.0001 [
0.000461803, 0, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 717 step: 0.0001 [0.00048541, 0, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 715 step: 0.0001 [0.00048541, 0.000161803, 0, 16.8535, -21.8262
, 1.51675]<br>iter: 0 val: 715 step: 0.0001 [0.00048541, 0.0002, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 715 step: 0.0001 [0.00048541, 0.000223607, 0, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 715 step:
0.0001 [0.00048541, 0.000223607, 0.0001, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 715 step: 0.0001 [0.00048541, 0.000223607, 6.18034e-05, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 715 step: 0.0001
[0.00048541, 0.000223607, 8.09017e-05, 16.8535, -21.8262, 1.51675]<br>iter: 0 val: 653 step: 0.0001 [0.00048541, 0.000223607, 8.09017e-05, 18.4716, -21.8262, 1.51675]<br>iter: 0 val: 653 step: 0.0001 [
0.00048541, 0.000223607, 8.09017e-05, 18.4716, -21.8262, 1.51675]<br>iter: 0 val: 44 step: 0.0001 [0.00048541, 0.000223607, 8.09017e-05, 18.4716, -10.2082, 1.51675]<br>iter: 0 val: 44 step: 0.0001 [0.00048541
, 0.000223607, 8.09017e-05, 18.4716, -9.05781, 1.51675]<br>iter: 0 val: 42 step: 0.0001 [0.00048541, 0.000223607, 8.09017e-05, 18.4716, -9.633, 1.51675]<br>iter: 0 val: 42 step: 0.0001 [0.00048541, 0.000223607
, 8.09017e-05, 18.4716, -9.63361, 1.51675]<br>iter: 0 val: 32 step: 0.0001 [0.00048541, 0.000223607, 8.09017e-05, 18.4716, -9.63361, -0.101279]<br>iter: 0 val: 29 step: 0.0001 [0.00048541, 0.000223607
, 8.09017e-05, 18.4716, -9.63361, 0.516755]<br>iter: 0 val: 29 step: 0.0001 [0.00048541, 0.000223607, 8.09017e-05, 18.4716, -9.63361, 0.516755]<br>iter: 0 val: 29 step: 0.0001 [0.00048541, 0.000223607
, 8.09017e-05, 18.4716, -9.63361, 0.516755]<br>iter: 0 val: 1976 step: 0.0001 [0.000423607, 0.000223607, 8.09017e-05, 18.4716, -9.63361, 0.516755]<br>iter: 0 val: 1976 step: 0.0001 [0.00038541, 0.000223607
, 8.09017e-05, 18.4716, -9.63361, 0.516755]<br><br>My main question is: How can I cause the optimizer to stop when he reach to the minimum?<br><br><br>3. The last question for now: Is there a way to modify the powell optimizer to work properly with versors as you did to the gradient-decent optimizer in the itkVersorRigid3DTransformOptimizer. If yes, how can I do it? and if not, why?
<br><br><br>Many thanks for your help<br><br>Moti<br><br><div><span class="gmail_quote">On 4/15/07, <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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi Moti,<br><br><br>I missed your last question:<br><br>Yes,<br>you will find an example of the use of the Powell optimizer for
<br>3D image registration in the directory:<br><br> InsightApplications/<br> LandmarkInitializedMutualInformationRegistration<br><br><br> Regards,<br><br><br> Luis<br><br><br>-------------------<br>Moti Freiman wrote:
<br>> Hi Luis,<br>> Thanks for your quick response.<br>><br>> 1. I assumed that i have a bad setting of the parameters, but I've no<br>> idea from where to start.<br>> My images are T2 mri images which were taken in two times. Firstly i
<br>> used the mutual information multi resolution example provided with the<br>> ITK to register them. I initialized the transform with the identity<br>> transform. and the images registered well.<br>> Then I started to modify the multi resolution example to working with my
<br>> similarity measure.<br>> The first step was to use the Powell optimizer instead of the versor<br>> optimizer , but staying with the 3d rigid versor transform, and<br>> initialization to the identity transform. In the first evaluation of the
<br>> similarity measure i got the exception. The scaling parameters and<br>> others were the same as appear in the multi resolution MI registration<br>> example.<br>> I also tried to change the similarity measure from MI to my similarity
<br>> measure, but after 4 evaluations, i got the exception when it starts to<br>> apply the rotation about the Z axiz.<br>><br>> 2. Is the powell optimizer can work with the versor transform, or just<br>> with euler3D transform ?
<br>> 3. Is there anywhere example of 3D registration with the powell optimizer?<br>><br>> Many thanks,<br>> Moti<br>><br>> On 4/15/07, *Luis Ibanez* < <a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com
</a><br>> <mailto:<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>>> wrote:<br>><br>><br>> Hi Moti,<br>><br>><br>> Here are a couple of suggestions:<br>><br>>
<br>> 1) You can use the OnePlusOne evolutionary optimizer.<br>> This optimizer does not require gradients in the<br>> cost function. Note that the versor rigid 3D transform<br>> will map its parameters to the Versor space, so that
<br>> you stay in the unit sphere.<br>><br>><br>><br>><br>> but.. before you get rid of the Powell optimizer,<br>> note that you may be simply using a bad set of<br>> parameters for it:
<br>><br>><br>><br>> 2) The message that you are getting from the Powell optimizer<br>> can be related to:<br>><br>> A) Poor initialization of the transform.<br>><br>> How are you initializing your transform ?
<br>> Have you verified that the initial transform<br>> give you a large overlap of the fixed and moving images ?<br>><br>><br>> B) Using steps that are too large<br>>
<br>> How many iterations does the optimizer performs before<br>> you get the exception ?<br>> What parameters are you passing to the optimizer<br>><br>><br>><br>> C) Lack of using a right combination of parameter scaling.
<br>><br>> What values are you setting for the parameter scaling?<br>> This is very important, since it compensates for the<br>> difference in the dynamic range of the versor components
<br>> versus the translation components.<br>> You may find useful to read the description of this<br>> issue 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>><br>><br>> Regards,<br>><br>><br>> Luis<br>><br>><br>> ---------------------<br>> Moti Freiman wrote:
<br>> > Hello,<br>> > I'm trying register two 3D volumes within the ITK framework using<br>> a new<br>> > similarity measure which has no analytical gradients.<br>> > Since the 3D versor optimizer in itk is based on a gradient decent
<br>> > optimizer. i cannot use it with my similarity measure.<br>> > I tried to use the Powell optimizer with 3DRigidVersor transform<br>> but I<br>> > got the following message:<br>
> > "All the points mapped to outside of the moving image"<br>> > It seems that powell is not optimized for the versor space.<br>> > 1. Is there any option to build a non-gradient based optimizer
<br>> for the<br>> > versor space as it done for gradient decent optimizer?<br>> > 2. Any other suggestions to which elements i should use in my<br>> > registration process given that my similarity measure has no
<br>> gradients?<br>> > Thanks,<br>> > Moti<br>> > --<br>> > __<br>> > Moti Freiman, Ph.D Student.<br>> > Medical Image Processing and Computer-Assisted Surgery Laboratory.
<br>> > School of Computer Science and Engineering.<br>> > The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904,<br>> Israel<br>> > Phone: +(972)-2-658-5371 (laboratory)<br>
> > WWW site: <a href="http://www.cs.huji.ac.il/~freiman">http://www.cs.huji.ac.il/~freiman</a><br>> > <<a href="http://www.cs.huji.ac.il/%7Efreiman">http://www.cs.huji.ac.il/%7Efreiman</a><br>> <
<a href="http://www.cs.huji.ac.il/%7Efreiman">http://www.cs.huji.ac.il/%7Efreiman</a>>><br>> ><br>> > --<br>> > __<br>> > Moti Freiman, Ph.D Student.<br>> > Medical Image Processing and Computer-Assisted Surgery Laboratory.
<br>> > School of Computer Science and Engineering.<br>> > The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904,<br>> Israel<br>> > Phone: +(972)-2-658-5371 (laboratory)<br>
> > WWW site: <a href="http://www.cs.huji.ac.il/~freiman">http://www.cs.huji.ac.il/~freiman</a><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> <mailto:
<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>>
<br>><br>> --<br>> __<br>> Moti Freiman, Ph.D Student.<br>> Medical Image Processing and Computer-Assisted Surgery Laboratory.<br>> School of Computer Science and Engineering.<br>> The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
<br>> Phone: +(972)-2-658-5371 (laboratory)<br>> WWW site: <a href="http://www.cs.huji.ac.il/~freiman">http://www.cs.huji.ac.il/~freiman</a><br></blockquote></div><br><br clear="all"><br>-- <br>__<br>Moti Freiman, Ph.D
Student.<br>Medical Image Processing and Computer-Assisted Surgery Laboratory.<br>School of Computer Science and Engineering.<br>The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel<br>Phone: +(972)-2-658-5371 (laboratory)
<br>WWW site: <a href="http://www.cs.huji.ac.il/~freiman">http://www.cs.huji.ac.il/~freiman</a>