getStatistics Mode

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

getStatistics Mode

Jeremy Adler
Analyse histogram generates the Mode but the Mode is not available from getStatistics().

Could getStatistics() be amended ?

Clearly the mode can extracted by running through the arrays returned by getStatistics() but getting directly would be neater.
The mode is useful with an image of an object on a background it provides a good indication of the mean background intensity.

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

Re: getStatistics Mode

Gabriel Landini
On Thursday 09 Oct 2014 09:10:57 Jeremy Adler wrote:
> Analyse histogram generates the Mode but the Mode is not available from
> getStatistics().
> Could getStatistics() be amended ?
>
> Clearly the mode can extracted by running through the arrays returned by
> getStatistics() but getting directly would be neater.
 The mode is useful
> with an image of an object on a background it provides a good indication of
> the mean background intensity.

Hi,
One problem is that there is no guarantee to be a mode (think of a uniform
distribution), or a single one (multimodal histograms).
One risks getting an automatic statistic that does not represent the
distribution. Not sure how would catch those cases.

Cheers

Gabriel

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

Re: getStatistics Mode

Michael Schmid
In reply to this post by Jeremy Adler
Hi Jeremy,

assuming that you are writing a macro, you could use getHistogram and then simply loop through the array to find the maximum.

Like this, you can also determine the bin width. Especially for 16-bit or float images, where you might have a rather low number of pixels with any given value, selecting a suitable bin width will suppress noise.

Michael
________________________________________________________________
On Oct 9, 2014, at 11:10, Jeremy Adler wrote:

> Analyse histogram generates the Mode but the Mode is not available from getStatistics().
>
> Could getStatistics() be amended ?
>
> Clearly the mode can extracted by running through the arrays returned by getStatistics() but getting directly would be neater.
> The mode is useful with an image of an object on a background it provides a good indication of the mean background intensity.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html