Skip to content
Snippets Groups Projects
Commit c5bd59ea authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

BUG: avoid comparaison with zero in double precision

parent 27964ba6
Branches
Tags
No related merge requests found
......@@ -152,7 +152,9 @@ void LeeImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
E_I = sum / static_cast<double>(neighborhoodSize);
Var_I = sum2 / static_cast<double>(neighborhoodSize) - E_I * E_I;
I = static_cast<double>(bit.GetCenterPixel());
if (E_I == 0)
const double epsilon = 0.0000000001;
if (vcl_abs(E_I) < epsilon)
{
dPixel = itk::NumericTraits<OutputPixelType>::Zero;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment