For (..){..} Loop does not wait until Measurement finished

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

For (..){..} Loop does not wait until Measurement finished

Frank Scigalla
Hello,

I am currently working at a Macro which performs MultiMeasurements of
Stack-files,
each with a separate (given) ROI-Set.
The filenames of stack and tiff are stored in an string-array which is
looped

macro "listmeasure [l]" {
  tmp = "C:\\Programme\\ImageJ\\filelist.txt";          
  str = File.openAsString(tmp);
  liste = newArray("");
  liste = split(str, "\n");
 
  n = nResults;
  g = 0;
  for (g=0; g<(liste.length-1); g=g+2) {
        open(liste[g]);              // opens stack
        open(liste[g+1]);         // opens ROI-Set.zip to RoiManager
        run("Multimeasure_and_Save [6]"); // Performs measurement in
special order and saves measurement results
        run("RoiReset [r]");      // "resets" roi Manager, closes picture
    }
 
My problem is that this script imports the 2nd ROI-Set while the first
is still being measured (causes exception).
Can I force the script to wait until sub-functions are finished?

Frank