ROI object from co-ordinate arrays
Posted by Tony Shepherd on
URL: http://imagej.273.s1.nabble.com/ROI-object-from-co-ordinate-arrays-tp3701565.html
I'm trying to create an ROI in the active image window, using co-ordinates
stored in 2 arrays. After looking through the documentation I have come up
with the lines of code below. Ncoords is the number of co-ordinate pairs and
2 denotes 'polygon' type (i.e. not oval or rectangle etc)
PolygonRoi segpoly = new PolygonRoi(Xcoords, Ycoords, Ncoords, 2);
Roi segROI = (Roi)segpoly;
ip.setRoi(segROI);
imp.updateAndDraw();
After the 'update and draw' I expect to see my polygon ROI in the image
window (familiar yellow and white boundary) but it's not there. Any ideas?
T