Login  Register

ImageJ Macro (Do while loop) Problem

Posted by degussa on May 25, 2008; 12:33pm
URL: http://imagej.273.s1.nabble.com/ImageJ-Macro-Do-while-loop-Problem-tp3696117.html

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();