Need help using getResult

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Need help using getResult

geowim
Hi,
I have been trying to write a macro that stores the data from the "Results" window into variables.  The results table contains the mean, mode, and std. dev. for the three color channels red, green and blue obtained from using Analyze>Tools>Color Histogram.  Here is my code -

run("Clear Results");
run("Color Histogram");
red = getResult("mean",1);
green = getResult("mean",2);
blue = getResult("mean",3);
RGB = newArray(red, green,blue);
print(RGB);

When I select an area of a picture and then execute the macro.  I get the following error message - 

"Results" table empty in line 3.
red = getResult("mean",1<)>;

Does any body knows the solution to this problem? Your help will be much appreciated. Thanks!

-geowim


Reply | Threaded
Open this post in threaded view
|

Re: Need help using getResult

geowim
If anybody else has the same problem, I found the solution from this post -
http://imagej.588099.n2.nabble.com/Macro-Can-t-get-data-from-Results-table-tc633088.html#a5567554