Вопрос

I would like to enlarge several rois with the following loop:

counts=roiManager("count");
 for(i=0; i<counts; i++) {
    roiManager("Select", i);
    run("Enlarge...", "enlarge=10");
 }

However, I can’t figure out, what’s wrong with this macro.

Это было полезно?

Решение

Your code enlarges every ROI by 10 pixels, but does not store the new ROI in the ROI manager. You are missing the roiManager("Update"); command, which you get when running the macro recorder while clicking the Update button in the ROI Manager window.

counts=roiManager("count");
for(i=0; i<counts; i++) {
    roiManager("Select", i);
    run("Enlarge...", "enlarge=10");
    roiManager("Update");
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top