Login  Register

Re: Different histograms in the macro and Java

Posted by Avital Steinberg on Sep 03, 2015; 11:14am
URL: http://imagej.273.s1.nabble.com/Different-histograms-in-the-macro-and-Java-tp5014228p5014230.html

Hi David,
I prefer the second suggestion you gave me, since the HistogramWindow class
has constructors that all display the histogram. (I don't want it to be
displayed)

What does int mOptions mean? This is probably exactly the solution I'm
looking for.

Thanks,
Avital



On Thu, Sep 3, 2015 at 1:22 PM, Davíð Þór Bragason <[hidden email]>
wrote:

> Hi Avital,
>
> you could look at ij.gui.HistogramWindow, a class you can use in a plugin
> or script and has different constructuctors taking bin, min, max values,
> etc. Some of them require you to convert to 32 bit image however.
>
> Or, you could try ImagePlus#getStatistics(int mOptions, int nBins, double
> histMin, double histMax) and then get the histogram from
> ij.process.ImageStatistics#getHistogram();
>
> Regards,
> David
>
>
> On Thu, Sep 3, 2015 at 9:34 AM, Avital Steinberg <
> [hidden email]>
> wrote:
>
> > Hi,
> > I would like to get the same histogram as the one obtained in Analyze,
> > histogram - using Javascript, and get the values  obtained when clicking
> on
> > "List" in the histogram window in ImageJ. (without displaying the
> > histogram)
> >
> > The problem is that the command recorder records nothing when I click on
> > list, so it's not clear to me how to get the values after using the
> > command:
> >
> > IJ.run(imp, "Histogram", "");
> >
> > Also, if I use the getHistogram function from the ImageProcessor or
> > ImagePlus class in the Java API, it gives a different histogram. The bin
> > width is 1, instead of (xmax - xmin)/nBins bin width. I would like to get
> > the same histogram as the one in Analyze, histogram.
> >
> > Is there an easy way to do this?
> >
> > Thanks,
> > Avital
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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