Login  Register

How do I get a single value from the histogram and put it in the results

Posted by George_S on Oct 07, 2014; 1:34pm
URL: http://imagej.273.s1.nabble.com/How-do-I-get-a-single-value-from-the-histogram-and-put-it-in-the-results-tp5009939.html

I am making a very simple macro for an 8 bit grayscale image:
Threshold;
make binary;
erode;
dilate;
then retrieve the number of white (or black) pixels (pixels with a value of 255) from the histogram and put it in the results.

It was simple in NIH Image but I am having problems with getting the number of pixels. I can get the % area and the number of pixels by a roundabout way but I would like to use the number in a calculation later on in the macro.

Thank you,
George