[Insight-users] Wrong GaussianDerivativeSpatialFunction calculation?

Iván Macía imacia at vicomtech.es
Wed May 2 10:56:13 EDT 2007


Hi,
 
In file itkGaussianDerivativeSpatialFunction.txx when using m_Normalized to
calculate a gaussian of unit area, the normalization factor is not correct
if im not wrong. According to what I expect, 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);
}
 
for a correct normalization.

Also in line 78 multiplying by 2 at the beginning does not seem to be
correct. 

I opened a new bug in the bugtracker with ID #4962. See attached pdf file
there for formulas.
http://www.itk.org/Bug/bug.php?op=show&bugid=4962&pos=2

Regards

Ivan


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.6.2/784 - Release Date: 01/05/2007
14:57
 



More information about the Insight-users mailing list