[Insight-users] Histogram statistics

Luis Ibanez luis.ibanez at kitware.com
Tue Oct 25 00:13:18 EDT 2005


Hi Martin,

Just double checking:

What is slow is:

     A) The comptation of the Histogram ?
     B) the computation of the Quantile ?

I would expect that most of the time is spent
computing the actual histogram.

Could you please put a RealTimeClock in between
both operations and let us know how much time
is spent in both operations.

http://www.itk.org/Insight/Doxygen/html/classitk_1_1RealTimeClock.html

Also, please let us know of the size of your
image and its pixel type.



   Thanks


     Luis


----------------
Martin Kavec wrote:
> Hello everybody,
> 
> I am trying to calculate some statistics out of the image histogram, but the 
> execution is pretty slow. Here is what I do:
> 
> typedef itk::Statistics::ScalarImageToHistogramGenerator< InputImageType > 
> HistogramGeneratorType;
>    typename HistogramGeneratorType::Pointer histogramGenerator = 
> HistogramGeneratorType::New();
> 
>    histogramGenerator->SetInput( input );
>    histogramGenerator->SetNumberOfBins( 1000 );
>    histogramGenerator->SetMarginalScale( 10.0 );
>    histogramGenerator->Compute();
> 
>    typedef typename HistogramGeneratorType::HistogramType  HistogramType;
>    const HistogramType *histogram = histogramGenerator->GetOutput();
> 
>    m_BrightnessThreshold = histogram->Quantile( 0, 0.98 );
> 
> 
> Is there any way to speed this up, or any other way to calculate the histogram 
> quantile?
> 
> Thans,
> 
> Martin
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 



More information about the Insight-users mailing list