java coding help - Polygon ROI
Posted by
Kenneth Sloan-2 on
Oct 25, 2017; 10:35pm
URL: http://imagej.273.s1.nabble.com/java-coding-help-Polygon-ROI-tp5019604.html
Java plugin - I’m prompting the user to create POINT and POLYGON ROIs.
For POINT ROI, this seems to work just fine:
IJ.setTool("multipoint");
WaitForUserDialog wfudOCT = new WaitForUserDialog("select three (3) landmarks in OCT; then click OK");
wfudOCT.show();
Roi octLMROI = octIPlus.getRoi();
Polygon octLMPolygon = octLMROI.getPolygon();
But, for POLYGON ROI, this very similar code fails:
IJ.setTool("polygon");
WaitForUserDialog wfudOCT = new WaitForUserDialog("select Polygon in OCT; then click OK");
wfudOCT.show();
Roi octPolyROI = octIPlus.getRoi();
Polygon octPolygon = octPolyROI.getPolygon();
In the second case, octPolyROI is null. The user has drawn a polygon (and completed it) and then clicks on “OK” in the dialog box. The polygon is displayed on the image (with the verticies minimized)
What am I doing wrong?
I do notice that there’s a difference in how the “multipoint” and “Polygon selections” are presented in the
ImageJ toolbar.
If it matters, this is running under FIJI, latest version.
--
Kenneth Sloan
[hidden email] <mailto:
[hidden email]>
Vision is the art of seeing what is invisible to others.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html