Is it possible to reopen an accidentally closed polygon ROI in imageJ?

Hi guys,

We are doing a quite complicated manual segmentation project of images using “Polygon ROI” in imageJ. In the process, we often accidentally double click the same dot and have to do the segmentation over again. Is there a way to reopen an accidentally closed polygon or disable the double-clicking function?

Edit: I have just fixed the issue by modifying the ij-1.52p.jar file and changed the mouse click interval from 500 msec to 10msec so that you can’t click fast enough to cause the double click issue. That said, I sincerely hope a “reopening” feature would be added to ROI selection in the future.

One suggestion would be to draw a polyline instead of the polygon where you can delete or add points to the selection and when finished convert the polyline to a polygon with this tiny macro:

getSelectionCoordinates(x, y);
//close the polyline to a polygon!
x = Array.concat(x, x[0]);
y = Array.concat(y, y[0]);
makeSelection("polygon", x, y);

See also (how to delete or add points):

https://imagej.nih.gov/ij/docs/guide/146-10.html

There is also a modify polygon macro available, see:

http://dev.mri.cnrs.fr/projects/imagej-macros/wiki/Modify_Polygon_Selection

For a reproducible result I would also store and save your ROI’s in the ROI Manager, too.

3 Likes

Thank you so much for your suggestion! This is very helpful!

Hi @Sunillllll,

An other solution is to combine ROIs. You can do this by pushing the SHIFT key while you are doing a new ROI. At the end of your drawing, both ROIs will be merged.

Nico