MultiMeasure prompts user to click ok

Posted by Sarah W. on
URL: http://imagej.273.s1.nabble.com/MultiMeasure-prompts-user-to-click-ok-tp3687622.html

Hi all,

i am working on a macro that (consecutively) opens several folders, stacks the contained images and measures several rois throughout the stack.
i use the multimeasure tool and it works fine for the first folder/stack. however, from the second folder on, before measuring it prompts me to confirm that i want to "measure all slices" and obtain "one row per slice" in the results table.
i tried the macro recorder but it shows no way to set options to the roiManager("Multi Measure") command nor does it seem to pick up on my clicking "ok".
is it possible to set the options of multimeasure in a way that accepts the settings of "measure all slices" and "one row per slice"?
or, is it possible to avoid prompting altogether (perferrably disable it before saving the measurements and enabling it again afterwards)?
any suggestions appreciated!
thanks!

sarah

here is the code i used:

DIR=getDirectory("Choose Directory");

u=1;
while (File.exists(DIR+"DS"+u+"\\")) {

        DIR_DS=DIR+"DS"+u+"\\";
        SLICES=getFileList(DIR_DS);

        for (i=0; i<SLICES.length; i++) {
                open(DIR_DS+SLICES[i]);
        }

        run("Images to Stack", "title=i0 keep");

        run("ROI Manager...");
        roiManager("Open", "C:\\temp\\myRoiSet.zip");
        run("Set Measurements...", "area mean standard modal min median redirect=None decimal=3");
        roiManager("Multi Measure");

        selectWindow("ROI Manager");
        run("Close");


        String.copyResults();
        selectWindow("Results");
                datei=DIR+"DS"+u+".xls";
        saveAs("Measurements", datei);
       
        selectWindow("Results");
        run("Close");
       
        run("Close All Without Saving");

        u++;
               
}