[ITK] [ITK-users] Otsu Filter in Statistic and Review/statistics
Zein Salah
zeinsalah at gmail.com
Fri Mar 31 04:42:09 EDT 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170331/cd6d9970/attachment-0003.html>
-------------- next part --------------
_____________________________________
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 Community
mailing list