// "RoiManagerSpeedTest" // // This macro tests the speed of the ROI Manager // running in batch mode and not in batch mode. // Make sure the ROI Manager is closed. It runs faster // and more reliably in batch mode if it is closed. if (isOpen("ROI Manager")) { selectWindow("ROI Manager"); run("Close"); } t1 = test(true); t2 = test(false); showMessage("Speed Test", "This macro runs "+round(t2/t1)+" times faster in batch mode"); exit; function test(batchMode) { width = 1000; height = 1000; n = 250; areas = newArray(n); means = newArray(n); setBatchMode(batchMode); roiManager("reset"); newImage("Untitled", "8-bit ramp", width, height, 1); start = getTime; for (i=0; i