Home › Forums › Protocols › How to remove ROI that touch the image border? › Reply To: How to remove ROI that touch the image border?

#70364

HI Stephane,

does this work for all timepoints?

I have the following script (I guess from you before  you made it as a protocol) – it works, but only at the first time point.

Any way to make it work at all timepoints ? cheers

Debbi

// Click on the button
// to edit in a frame.

bounds = input0.getBounds2D()
output0 = []
ind = 0;

for(i = 0; i < input1.length; i++)
{
r = input1[i]

rbounds = r.getBounds5D().toRectangle2D();
if ((rbounds.getMinX() == bounds.getMinX()) ||
(rbounds.getMinY() == bounds.getMinY()) ||
(rbounds.getMaxX() == bounds.getMaxX()) ||
(rbounds.getMaxY() == bounds.getMaxY()))
continue;

output0[ind++] = r;
}