macro "cut into thirds vertically" { roiManager("Add"); firstROI = roiManager("count")-1; getSelectionBounds(x, y, width, height); third = width / 3; for (i=0; i<3; i++) { makeRectangle (x+(i*third), y, third, height); roiManager("Add"); roiManager("select", roiManager("count")-1); // roiManager("rename", "rectangle"); roiManager("select", newArray(firstROI, roiManager("count")-1)); roiManager("and"); roiManager("Add"); roiManager("deselect"); roiManager("select", roiManager("count")-2); roiManager("delete"); } }