Hi guys,
I wrote a Macro which enlarges my (very small) ROIs, which are stored in the ROI-Manager. For a different set of analysis, however, I have to reduce the the size of the ROIs. Somehow my code does not do what I want. Here the code with some made up ROIs.
makeRectangle(782, 457, 4, 8);
roiManager("Add");
makeRectangle(792, 457, 4, 8);
roiManager("Add");
makeRectangle(682, 457, 4, 8);
roiManager("Add");
roiManager("Show All");
macro "Resize Selections" {
requires("1.38e");
dx = -3;
Dialog.create("Adjust size of your ROIs");
Dialog.addNumber("Increase by:", dx);
Dialog.show();
dx = Dialog.getNumber();
n = roiManager("count");
if (n==0)
exit("The ROI Manager is empty");
for (i=0; i<n; i++) {
roiManager("select", i);
run("Enlarge...", "enlarge="+dx);
roiManager("update");
}
When I increase the size, I can reduce the size afterwards (by enlarging with negative values), but I cannot reduce the size below the original ROI. Maybe because they are already very small? Any ideas how to do this?
Thanks a lot for your help
Cheers