help on macro to evaluate results table data

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

help on macro to evaluate results table data

dobensl
I am writing a macro that uses the Voronoi nearest neighbor plugin to (1) detect neighboring particles, (2) obtain each neighbor's feret angle, and (3) measure angle change. By reiteratively performing nearest Voronoi neighbor analysis, the macro I’ve put together presents the data (thus far) in a Results table that includes (for particle 1 and neighbor 2) the columns: X1, Y1, X2, Y2, Angle1, Angle2 and %Difference (between angles). For an example micrograph I am using, I have 57 particles resulting in 96 rows in the Results table (some X1,Y1 have multiple X2,Y2 neighbors).

I would like to loop through each row and obtain for X1,Y1 the %Difference, add them to an array and average these values. I would use SetResults to add the averaged value to a new column "average%Difference", and my last step would be to wand each particle and present the "average%Difference" for each of the 57 particles as a final Results table or a ROI color coded image.

Being a trained fruit fly geneticist, I am struggling with how to go through the the X1,Y1 values in the Results table row-by-row. Specifically, I do not know if I should use an "if" loop, a "for" loop or a "while" loop. The following step is cloudy, too: I know how to add %Difference values to an array and take the mean of that array, but it is not working, as documented by the "print.array" function. Any advice, links or direction would be appreciated.

Len



Leonard Dobens, PhD
Associate Professor of Biology
SCB312
School of Biological Sciences
University of Missouri-Kansas City
5007 Rockhill Road
Kansas City, MO 64110
8162356272
[hidden email]




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