Posted by
lechristophe on
May 26, 2008; 7:07am
URL: http://imagej.273.s1.nabble.com/ImageJ-Macro-Do-while-loop-Problem-tp3696117p3696119.html
It is difficult to answer your question without seeing your image, but
my guess is that you never reach the 26000 minimum area to exit the
loop. The wand is quite sensitive and it could be almost impossible
(depending on your image) to get a large area, as you sample only one
pixel out of 10 in one dimension to test for the wand.
Maybe you should try to do an Analyze Particle after tresholding (to
catch the big regions) and optionnally loop a doWand on the detected
regions, then report the ROI on your original image.
Christophe
On Sun, May 25, 2008 at 2:33 PM, degus <
[hidden email]> wrote:
> Please i need some urgent help with a macro i am writing. The macro involves
> a loop, but the loop runs continously and does not terminate except i
> physically close imageJ.
>
> Here is the loop part of the macro below,
>
>
> setThreshold(110, 800);
> g = 100;
> b = 300;
> do {
> doWand(g, b);
>
> run("Measure");
>
> Cplxarea = getResult("Area", 0);
>
> g = g + 10;
>
> }
>
> while (Cplxarea<26000);
> run("ROI Manager...");
> roiManager("Add");
> selectImage(IDd);
> close
>
> I want to take the complex region of interest in an image using the doWand
> command, but i need to be sure the doWand takea an area larger than 26000(
> this is actually dependent on the doWand position which varies from image to
> image. so i want to iterate until i can successfully get a complex area
> with the doWand command larger than 26000 in area. The problem i get is that
> the looop runs continously and does not proceed to the next step. I
> appreciate your help. Thank you.
>
> Degussa
>
> run("ROI Manager...");
> roiManager("Add");
> selectImage(IDd);
> close();
> --
> View this message in context:
http://www.nabble.com/ImageJ-Macro--%28Do-while-loop%29-Problem-tp17457474p17457474.html> Sent from the ImageJ mailing list archive at Nabble.com.
>