[Insight-users] Minor bug in new OtsuMultipleThresholdsCalculator?

Luis Ibanez luis.ibanez at kitware.com
Fri, 05 Mar 2004 10:12:13 -0500


Luca, Zach,

Thanks for posting the modifications.
This patch has now been applied.

Note also that the calculator was removed
from the "Statistics" namespace.

Please let us know if you find any problems,


   Thanks


     Luis


--------------------------------
lucantiga at softhome.net wrote:

> Hi Zach and Luis,
>  attached you can find the corrected versions of 
> OtsuMultipleThresholdsCalculator. 
> 
>  Basically I defined two types, namely 
> 
>  typedef typename NumericTraits<MeasurementType>::RealType MeanType;
>  typedef typename NumericTraits<MeasurementType>::RealType VarianceType;
> 
> and modified the code accordingly, with all the necessary static_cast's.
> 
>  To be consistent, I also changed all comparisons of the kind
> 
> if (frequency > 0.0)
>  with 
> if (NumericTraits<FrequencyType>::IsPositive(frequency))
> 
>  and the assignments
> 
> mean = 0.0;
>  with
> mean = NumericTraits<MeanType>::Zero;
> 
>  The test passes correctly.
> 
>  Therefore, two modifications were made with respect to the CVS version:
>  1. Fixed bug in class mean calculation
>  2. Fixed type handling 
> 
> I also fixed a Doxygen problem in itkOtsuMultipleThresholdsCalculator.h
> 
> /** \class itkOtsuMultipleThresholdsCalculator
> 
>  was changed to
> 
> /** \class OtsuMultipleThresholdsCalculator
> 
>  This same thing should also be fixed for 
> HistogramAlgorithmBase and ThresholdLabelerImageFilter
> 
> Thanks!
> 
> Luca
> 
>