[ITK-users] Otsu Filter in Statistic and Review/statistics

Matt McCormick matt.mccormick at kitware.com
Mon Apr 3 15:19:07 EDT 2017


Hi Zein,

It sounds like this is ITKv3.  A number of Otsu fixes have been made
in ITKv4 - upgrading will likely fix the issue.

HTH,
Matt

On Fri, Mar 31, 2017 at 4:42 AM, Zein Salah <zeinsalah at gmail.com> wrote:
> Hi,
>
> I had a strange behavior regarding otsu filter. My code is as simple as
> this:
>
>
>     typedef itk::Statistics::ScalarImageToHistogramGenerator<ImageType>
> ScalarImageToHistogramGeneratorType;
>     typedef ScalarImageToHistogramGeneratorType::HistogramType
> HistogramType;
>     typedef itk::OtsuMultipleThresholdsCalculator<HistogramType>
> OtsuCalculatorType;
>
>     ScalarImageToHistogramGeneratorType::Pointer
> scalarImageToHistogramGenerator =
> ScalarImageToHistogramGeneratorType::New();
>     scalarImageToHistogramGenerator->SetNumberOfBins(128);
>     scalarImageToHistogramGenerator->SetInput(itkImage);
>     scalarImageToHistogramGenerator->Compute();
>
>
>     OtsuCalculatorType::Pointer otsuCalculator = OtsuCalculatorType::New();
>     otsuCalculator->SetNumberOfThresholds(numberOfThresholds);
>
> otsuCalculator->SetInputHistogram(scalarImageToHistogramGenerator->GetOutput());
>     otsuCalculator->Update();
>
>     const OtsuCalculatorType::OutputType& thresholdVector =
> otsuCalculator->GetOutput();
>     HistogramType::MeasurementType threshold =
> thresholdVector[usedThreshold];
>
>
> I tested this with itk configured with ITK_USE_REVIEW_STATISTICS set to ON
> and once to OFF.
> With some images, the results is not the same.
>
> Is this a known issue?
>
> thanks,
> Zein
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list