StackStatisticks histograms precision

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

StackStatisticks histograms precision

damien.schnebelen
Dear all,
I have calculated stacks histograms using the StackStatisticks function and I have noticed that the maximum counts value is truncated to 2^31 -1.
Is it possible to get a long precision histogram?

Thanks by advance,
Damien.
Reply | Threaded
Open this post in threaded view
|

Re: StackStatisticks histograms precision

Rasband, Wayne (NIH/NIMH) [E]
On Jul 14, 2015, at 5:03 AM, damien.schnebelen <[hidden email]> wrote:
>
> Dear all,
> I have calculated stacks histograms using the StackStatisticks function and
> I have noticed that the maximum counts value is truncated to 2^31 -1.
> Is it possible to get a long precision histogram?


The ImageStatistics.getHistogram() method returns a long precision histogram. The following is a JavaScript example.

-wayne

  imp = IJ.createImage("Untitled", "8-bit black", 1024, 1024, 2050);
  stats = new StackStatistics(imp);
  longHistogram = stats.getHistogram();
  print("pixel count: "+stats.longPixelCount);
  print("stats.histogram[0]: "+stats.histogram[0]);
  print("longHistogram[0]: "+longHistogram[0]);
  print("2^31-1: "+ (Math.pow(2,31)-1));

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: StackStatisticks histograms precision

damien.schnebelen
Oh, I was indeed using the function stats.histogram instead of stats.getHistogram().

Thank you very much for the tips!
Damien