Acess the frequency curve of a Histogram created from 1D Array

Hello Forum!

I’m using ImageJ’s Macro language in attempting to separate the slices within the stack into two groups based on their average pixel intensity values.

To do that, I thought of creating an array that would store the mean values from each slice, and my intention is to look at the distribution of the values within the array to figure out which threshold to apply in order to separate the slices into the two groups.

My problem is that while I am able to plot the histogram based on the array values, using

Plot.addHistogram(values, binWidth, binCenter)

I don’t seem to identify any macro command/function that would allow me to access the frequency curve, nor the sequence of bins. For example, getHistogram() allows the access to Values and Counts arrays, but it works only on images as data source. Naturally, I could convert my array into an image, but my values are non-integers, and I would prefer not to round my data.

So, I was wondering if there could be some suggestions on how to access the histogram curves based not on an image, but on an array.

Many thanks in advance.

Does

Plot.getValues(xpoints, ypoints);

work for you?

2 Likes

Look at that, it does work for me!!
Thanks a bunch @notQRV

Cheerio!!