|
Dear all,
I'm trying to work with roi manager to isolate ROIs that are inside other ROIs, similar to the functions in Cell profiler.
A grid of rectangle rois are placed over an image and only (parts of ) the rois within a circular large ROI should remain.
Here's the code i thought would work:i=o represents the circular roi selected by user.
for (i=1; i<n; i++)
{
setOption("DisablePopupMenu", true);
setBatchMode(true);
selectWindow(filename);
roiManager("Select",newArray(0,i));
roiManager("AND");
roiManager("Add");
roiManager("Rename","ROI"+i);
}
Yet, rectangle ROIs outside de circular one do not get added since AND gives no result, so popups block automated action in the add step.
Is there a way to perform.. if roi"("AND")<>empty {.. or to block pop ups to allow the macro to advance?
Kind regards,
Richard
|