[Insight-users] Understanding the code of HistogramMatchingImageFilter

Dominique Töpfer dominique at toepfer-web.de
Tue Jun 16 14:32:07 EDT 2009


Hello,

I have some difficulties understanding the code of the 
HistogramMatchingImageFilter. In the method BeforeThreadedGenerateData() 
m_UpperGradient is set by the following code:

denominator = m_QuantileTable[0][m_NumberOfMatchPoints+1] - 
m_SourceMaxValue;
if ( denominator != 0)
  {
    m_UpperGradient = m_QuantileTable[1][m_NumberOfMatchPoints+1] -
      m_ReferenceMaxValue;
    m_UpperGradient /= denominator;
  }
  else
  {
    m_UpperGradient = 0.0;
  }


But considering

m_QuantileTable[0][m_NumberOfMatchPoints + 1] = m_SourceMaxValue;
m_QuantileTable[1][m_NumberOfMatchPoints + 1] = m_ReferenceMaxValue;

(same method) m_UpperGradient is always set to 0.0. So why is this 
variable necessary? Did I overlook something?
Thanks in advance!

Dominique



More information about the Insight-users mailing list