View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004893ITKpublic2007-04-17 07:212007-09-10 12:33
ReporterRalf Floca 
Assigned ToLuis Ibanez 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0004893: itk::RegularStepGradientDescentBaseOptimizer doesn't check validity of m_GradientMagnitudeTolerance
DescriptionThe itk::RegularStepGradientDescentBaseOptimizer doesn't check validity of the member m_GradientMagnitudeTolerance before starting the optimization. If an invalid (negative) tolerance is set, it is possible that the optimizer will have a gradientMagnitude of 0.0 but won’t stop. This causes the itk::RegularStepGradientDescentOptimizer to compute a factor of -1.#INF in itk::RegularStepGradientDescentOptimizer::AdvanceOneStep and therefore undefined transformation parameters as a step result. This causes e.g. an application to crash when the resulting transformation is used by a metric (like in image registration), because transformed points are undefined too (see also Bug 0004892).

I would suggest that itk::RegularStepGradientDescentBaseOptimizer implements a validity check in
itk::RegularStepGradientDescentBaseOptimizer::StartOptimization() like:
if( m_GradientMagnitudeTolerance < 0.0 )
    {
    itkExceptionMacro(<< "Gradient magnitude tolerance must be greater or equal 0.0. Current value is " << m_GradientMagnitudeTolerance );
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Files

 Relationships

  Notes
(0007338)
Ralf Floca (reporter)
2007-04-17 07:25

Forgot an brace on the suggested solution. Correct version:
if( m_GradientMagnitudeTolerance < 0.0 )
    {
    itkExceptionMacro(<< "Gradient magnitude tolerance must be greater or equal 0.0. Current value is " << m_GradientMagnitudeTolerance );
    }
(0008906)
Luis Ibanez (manager)
2007-09-10 12:23

The validity check has been added to the StartOptimization() method:

http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Numerics/itkRegularStepGradientDescentBaseOptimizer.cxx?root=Insight&sortby=date&r2=1.24&r1=1.23 [^]
(0008907)
Luis Ibanez (manager)
2007-09-10 12:32

A test for the exception was also added to

Insight/Testing/Code/Numerics/
   itkRegularStepGradientDescentOptimizerTest.cxx

http://www.itk.org/cgi-bin/viewcvs.cgi/Testing/Code/Numerics/itkRegularStepGradientDescentOptimizerTest.cxx?root=Insight&sortby=date&r2=1.23&r1=1.22 [^]
(0008908)
Luis Ibanez (manager)
2007-09-10 12:33

The modifications were committed and the tests are passing.

 Issue History
Date Modified Username Field Change
2007-09-10 12:23 Luis Ibanez Note Added: 0008906
2007-09-10 12:32 Luis Ibanez Note Added: 0008907
2007-09-10 12:33 Luis Ibanez Status assigned => closed
2007-09-10 12:33 Luis Ibanez Note Added: 0008908
2007-09-10 12:33 Luis Ibanez Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team