MantisBT - ITK
View Issue Details
0003103ITKpublic2006-04-06 05:442011-02-15 16:36
Marius Staring 
brian avants 
normalminoralways
assignedopen 
 
 
0003103: NormalizedCorrelationMetric does not check the m_ComputeGradient bool
The NormalizedCorrelationImageToImageMetric does not check the m_ComputeGradient bool when calculating the derivative in both GetDerivative() and GetValueAndDerivative(). It assumes that this bool is true and it also depends on this assumption. However, there exists a function, inherited from the Image, called SetComputeGradient(bool) which enables the user to set it to false. Doing so would result in throwing an exeption.
No tags attached.
Issue History
2007-09-19 12:24Luis IbanezAssigned ToLydia Ng => Stephen Aylward
2007-09-23 10:36Luis IbanezNote Added: 0009262
2008-04-29 10:42Luis IbanezNote Added: 0011583
2010-10-21 13:38Hans JohnsonNote Added: 0022631
2010-10-21 13:39Hans JohnsonAssigned ToStephen Aylward => Luis Ibanez
2010-11-07 02:31Luis IbanezAssigned ToLuis Ibanez => brian avants

Notes
(0003970)
Marius Staring   
2006-04-06 05:49   
... inherited from Image, called ...

   should be

... inherited from ImageToImageMetric, called ...
(0003971)
Marius Staring   
2006-04-06 06:17   
Related to this:

The boolean m_ComputeGradient is standard set to true in the ImageToImageMetric. However, there are some metrics that do not use this gradient image, but forget to set it to false. This will result in a performance penalty, because you are calculating something in Initialize() that you never use. Examples of such metrics are the MeanReciprocalSquareDifferenceImageToImageMetric and classes deriving from the HistogramImageToImageMetric, a notable exeption is the MattesMutualInformationImageToImageMetric.

Maybe it is better to set the default to false and set it to true for metrics that use it. Isn't it dangerous to have the function SetComputeGradient(bool) accesible by the user, because it is more dependend on the specific metric?
(0004125)
Lydia Ng   
2006-05-23 14:00   
Lydia to check this
(0009262)
Luis Ibanez   
2007-09-23 10:36   
To be done during WA10, or with NAC refactorings.
(0011583)
Luis Ibanez   
2008-04-29 10:42   
The metric seems to be doing the right thing here.
This probably should be addressed with more explicit documentation on the use
of the ComputeGradient flag and the GetDerivate() and GetValueAndDerivative() methods.
(0022631)
Hans Johnson   
2010-10-21 13:38   
Brian Avants to address this as part of the ITKv4 image registration refactoring.