[Insight-users] MaximizeOn and PixelType : ITK 1.2 versus current CVS

Luis Ibanez luis . ibanez at kitware . com
Tue, 15 Jul 2003 13:54:43 -0400


Hi Stephan,

This was fixed soon after the 1.2 release.

It was a double bug related to the computation of
derivates in the MeanSquareMetric which resulted
in reversing their direction. The bug was compensated
by setting MaximizeOn() in the example.

The example was fixed in its revision 1.8 (march 9 2002)
http://www . itk . org/cgi-bin/cvsweb . cgi/Insight/Examples/Registration/ImageRegistration3 . cxx?cvsroot=Insight

when the MaximizeOn() was replaced with MaximizeOff()
http://www . itk . org/cgi-bin/cvsweb . cgi/Insight/Examples/Registration/ImageRegistration3 . cxx . diff?r1=1 . 7&r2=1 . 8&cvsroot=Insight

---

Please be confident that your understanging of the
Metric behavior is correct, and that you should use
MaximizeOff() when optimizing the MeanSquares metric.

At this point we are focusing more on getting the
ITK 1.4 release done by early September. The CVS
repository is scheduled to be freezed on August 1st.

Since this issue is already solved in the current CVS
version, this bug will not appear in the 1.4 release.


   Please let us know if you have further questions

     Thanks


        Luis


---------------------
Stephan Moser wrote:
> Hi Luis
> 
> Thanks for your reply. I agree with you in all points, except that we
> seem to talk about different code versions. I just now downloaded ITK
> 1.2.0 (.zip file) again and in ImageRegistration3.cxx there is line nr.
> 381 with the following statement:
> 
> optimizer->MaximizeOn();
> 
> This is what confused me earlier on. Where is the problem? The program
> does compile and works, showing the exact behavior as I described in my
> last mail.
> 
> Regards, Stephan
> 
> 
> 
> On Tue, 15 Jul 2003, Luis Ibanez wrote:
> 
> 
>>Hi Stephan,
>>
>>You are right,
>>the MeanSquare metric is optimal when its value is zero.
>>The optimizer must then be set for Minimizing the cost
>>function.
>>
>>This is done in ImageRegistration3.cxx line 381 with
>>the call
>>
>>           optmizer->MaximizeOff();
>>
>>Note that setting MaximizeOff() is equivalent to call
>>any of the following:
>>
>>         optimizer->MinimizeOn();
>>         optimizer->SetMaximize( false );
>>         optimizer->SetMinimize( true  );
>>
>>You can verify the code in Insight/Code/Numerics
>>
>>   itkRegularStepGradientDescentBaseOptimizer.h
>>
>>
>>The registration should work for both signed and
>>unsigned short pixel types, using MinimizeOn()
>>[ or MaximizeOff() ] in both cases.
>>
>>MaximizeOn() will not produce registered images.
>>
>>
>>You can also experiment this with the Python
>>or Tcl versions:
>>
>>    ImageRegistration3.py
>>    ImageRegistration3.tcl
>>
>>
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
>>
>>-----------------------
>>itk at stmoser . ch wrote:
>>
>>>Hi
>>>
>>>I've just been playing around with a basic registration program and the
>>>registration example nr. 3.  According to some newsgroup postings,
>>>itkMeanSquareImageToImageMetric does sum up squared differences and
>>>therefore needs to be minimized. So MinimizeOn() needs to be called. In
>>>example 3 there is MaximizeOn() though. Why is that?
>>>
>>>It is interesting to note that if PixelType is set to 'short', the
>>>registration does fine with MinimizeOn(), but not with MaximizeOn(). If
>>>it is set to 'unsigned short', it will do with MaximizeOn() but not with
>>>MinimizeOn().
>>>
>>>Can anyone help me?
>>>
>>>Thanks, Stephan
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk . org
>>>http://www . itk . org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk . org
>>http://www . itk . org/mailman/listinfo/insight-users
>>
> 
>