[Insight-users] itkOtsuMultipleThresholdsCalculator patch (+ class collocation issue)

Luis Ibanez luis.ibanez at kitware.com
Tue, 02 Mar 2004 17:36:36 -0500


Hi Luca,

Thanks for posting these fixes.

I'll wait until tomorrow to apply the patches. It is
better to let your classes pass a nightly build in
all platforms first.

I'm not sure you want these classes to be on the
Code/Numerics/Statistics directory. They are not really
using classes form the Statistics framework.

The ThresholdLabelerImageFilter is quite generic and seems to
fit better under Code/BasicFilters.

The OtsuMultipleThresholdCalculator is now in Code/Algorithms
along with its partner the itkOtsuThresholdImageCalculator.


We can simply take them out of the "Statistics" namespace.


Maybe I'm missing something obvious here,
please let me know.


    Thanks


      Luis


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

> Hi Luis,
>  thanks a lot for including my code in ITK, I hope it will be useful.
>  Just a couple of things:
>  - could you please apply the attached diff to 
>    itkOtsuMultipleThresholdsCalculator.txx and check it out? It solves a 
>    bug (affecting the computation of initial class means) due to nasty 
>    finish-up touches... sorry about that.
>  - I think itkOtsuMultipleThresholdsCalculator and 
>    itkHistogramAlgorithmBase should be put in Numerics/Statistics 
>    (they live in the Statistics namespace)
>  Thank you again
> 
> Luca
> 
> 
> ------------------------------------------------------------------------
> 
> 73c73
> <       if (classFrequency[j] != 0.0)
> ---
> 
>>      if (classFrequency[j] > 0.0)
> 
> 87c87,94
> <         classMean[k] = histogram->GetMeasurementVector(thresholdIndexes[k])[0] * classFrequency[k];
> ---
> 
>>        if (classFrequency[k] > 0.0)
>>          {
>>          classMean[k] = histogram->GetMeasurementVector(thresholdIndexes[k])[0];
>>          }
>>        else
>>          {
>>          classMean[k] = 0.0;
>>          }
> 
> 100c107
> <       if (classFrequency[numberOfClasses-1] != 0.0)
> ---
> 
>>      if (classFrequency[numberOfClasses-1] > 0.0)
> 
> 182c189,196
> <     classMean[j] = histogram->GetMeasurementVector(j)[0] * classFrequency[j];
> ---
> 
>>    if (classFrequency[j] > 0.0)
>>      {
>>      classMean[j] = histogram->GetMeasurementVector(j)[0];
>>      }
>>    else
>>      {
>>      classMean[j] = 0.0;
>>      }
> 
> 186c200
> <   if (classFrequency[numberOfClasses-1] != 0.0)
> ---
> 
>>  if (classFrequency[numberOfClasses-1] > 0.0)