Here is a small code snippet:
**************************************
ImagePlus imp = IJ.getImage();
/*Create a Polygon ROI!*/
int[] xp = { 5, 50, 100, 150, 200, 250, 300 };
int[] yp = { 100, 200, 200, 200, 200, 100 };
PolygonRoi polRoi = new PolygonRoi(xp, yp, 6, Roi.POLYGON);
imp.setRoi(polRoi);
/*Add the ROI to the ROI Manager!*/
RoiManager manager = RoiManager.getInstance();
if (manager == null)
{
manager = new RoiManager();
}
manager.addRoi(polRoi);
*************************************
For different ROI types see:
http://rsbweb.nih.gov/ij/developer/api/ij/gui/Roi.html
If you reply to this email, your message will be added to the discussion below:http://imagej.1557.x6.nabble.com/add-a-set-of-point-coordinates-to-ROI-manager-tp5009232p5009246.html
| Free forum by Nabble | Edit this page |