Hi Katherine,
On Thu, 7 Jun 2012, Walsh, K. (Katherine) wrote:
> I need to create a 'do while' loop in my macro but I need imagej to read
> the results table for the while clause
> Eg.
> Do {....}
>
> While (%Area <3);
You would run a row counter in a 'for' loop:
for (row = 0; row <= nResults && getResult("Area", row) < 3; row++) {
// Do your thing
}
Compare also
http://imagej.nih.gov/ij/developer/macro/macros.html#loopsand
http://imagej.nih.gov/ij/developer/macro/macros.html#operatorsBy the way, this loop still might not do what you want, because the rows
are not necessarily ordered in ascending order of Area. If you need to
access the rows whose Area is smaller than 3, do something like this:
for (row = 0; row <= nResults; row++) {
if (getResult("Area", row) < 3) {
// Do your thing
}
}
Ciao,
Johannes
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html