Posted by
Lee Berndt on
Aug 31, 2014; 2:16pm
URL: http://imagej.273.s1.nabble.com/Help-Please-tp5009424p5009431.html
Hi Volko....thanks for your response....I solved my problem late last night using the following code:
m = (getResult("Count",0));
getStatistics(nPixels);
n = nPixels;
x = ((m/n)*100);
print("Total Number of Pixels =",n);
print("Number of Black Pixels =",m);
print("Injury Area in cm2 =",x);
Thanks again for your help....
William L. Berndt, Ph.D.
239.246.0396
-----Original Message-----
From: Volko Straub <
[hidden email]>
To: IMAGEJ <
[hidden email]>
Sent: Sun, Aug 31, 2014 1:59 am
Subject: Re: Help Please
Hi William,
If you have a binary image (e.g. an image that you have previously
thresholded), use 'Create Selection' from the Edit->Selection menu
(macro command: run("Create Selection");) to select all pixels with a
value of 255. Follow this by 'Make Inverse' from the Edit->Selection
menu (macro command: run("Make Inverse");) to select all pixels with a
value of 0. Then simply use the Measure command to get the area of the
selection.
Hope this helps,
Volko
On 30/08/2014 22:44, Lee Berndt wrote:
> Greetings:
>
> I've written a macro to help determine the area of injury to turfgrass
(putting greens)....the macro works great except for the very end....what I need
to do is to get the number of pixels in an image corresponding to count 0 of 256
(black)....I can get the total number of pixels in the image but need the value
for count 0 to create a percentage of black to all other pixels.....how do I get
that value? Any help is greatly appreciated....thank you.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html