MantisBT - ITK
View Issue Details
0004962ITKpublic2007-05-02 10:452007-09-17 10:20
Ivan Macia 
Julien Jomier 
normalmajoralways
closedfixed 
 
 
0004962: Error in normalization in itk::GaussianDerivativeSpatialFunction
In file itkGaussianDerivativeSpatialFunction when using m_Normalized to calculate a gaussian of unit area, the normalization factor seems to be wrong. According to what I expect (see attached document) the lines

if (m_Normalized)
{
  prefixDenom = m_Sigma[0]*m_Sigma[0]*m_Sigma[0];
  for(unsigned int i = 1; i < VImageDimension; i++)
  {
    prefixDenom *= m_Sigma[i]*m_Sigma[i]*m_Sigma[i];
  }

  prefixDenom *= 2 * 3.1415927;
}

should be replaced by

if (m_Normalized)
{
  prefixDenom = m_Sigma[m_Direction]*m_Sigma[m_Direction]

  for(unsigned int i = 0; i < VImageDimension; i++)
    prefixDenom *= m_Sigma[i];

  prefixDenom *= vcl_pow( 2 * 3.1415927, VImageDimension / 2.0);
}

Also in line 78 multiplying by 2 at the beginning is not correct.
No tags attached.
pdf NormalizedGaussianDerivatives.pdf (21,791) 1969-12-31 19:00
https://public.kitware.com/Bug/file/988/NormalizedGaussianDerivatives.pdf
Issue History
2007-09-17 10:20Luis IbanezNote Added: 0009016

Notes
(0009016)
Luis Ibanez   
2007-09-17 10:20   
The fix was committed by Julien:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkGaussianDerivativeSpatialFunction.txx?root=Insight&r1=1.7&r2=1.8 [^]