Login  Register

Re: Matlab using getHistogram

Posted by Michael Schmid on Dec 13, 2018; 1:21pm
URL: http://imagej.273.s1.nabble.com/Matlab-using-getHistogram-tp5021563p5021568.html

Hi R,

there is no ij.IJ.getHistogram method.
 From Java or Javascript, one would have
   ij.IJ.getImage().getProcessor().getHistogram();

These are the counts; the pixel values can be calculated by
interpolating between
   ij.IJ.getImage().getProcessor().getHistogramMin()  and
   ij.IJ.getImage().getProcessor().getHistogramMax().

This does not work for float (32-bit) images; there one needs
ImageStatistics:
   ij.IJ.getImage().getStatistics().getHistogram()

Michael
________________________________________________________________
On 13.12.18 01:41, Rsmith wrote:

> Hello,
>
> I am using ImageJ through Matlab to evaluate 8 bit black and white images. I
> have used Matlab for years but I am new to image J. For the most part
> it.IJ.run... has worked.  I can't make getHistogram work. We have found that
> with the images we use there is a significant count drop off and it helps
> inform the the vales used in threshold. It would be very helpful to make the
> setting dynamic based on the histogram of each image.
>
> I think the issue is just getting the correct syntax for Matlab.  The
> examples for Fiji macros is
>
> getHistogram(values, counts, 256)
>
> So I expect the be something like
>
>    [values, counts]= ij.IJ.getHistogram
>
> This is not working any suggestions are appreciated
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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