[Insight-users] Bug in itkMRFImageFilter.hxx

Joël Schaerer joel.schaerer at gmail.com
Wed Feb 1 13:36:24 EST 2012


Hello all,

The MRFImageFilter takes a smoothing parameter to set the desired 
balance between spatial smoothness and data fidelity. This parameter is 
supposed to be set using the SetSmoothingFactor() method.

Unfortunately, this parameter is not actually used in the computation. 
The reason is that it is used only in the 
SetDefaultMRFNeighborhoodWeight() method, which is private (why?) and 
called in the constructor, before the user has a chance to set the 
smoothing factor. Of course, if the user sets his own weights, the 
factor is also ignored.

I would suggest using the m_SmoothingFactor in DoNeighborhoodOperation 
instead, independently of the weights, as follows:

(line 637)
- m_NeighborInfluence[index] += m_MRFNeighborhoodWeight[i];
+ m_NeighborInfluence[index] += m_MRFNeighborhoodWeight[i] * 
m_SmoothingFactor;

and removing all the occurrences in SetDefaultMRFNeighborhoodWeight().

Joel

PS: I am aware the project has a bug tracker, but since most of my 
previous bug reports were ignored for years before "expiring", I am 
hoping posting on the mailing list will gather more attention.


More information about the Insight-users mailing list