Re: Iterator over Roi points anywhere?
Posted by
Eric Barnhill on
Apr 11, 2016; 7:14am
URL: http://imagej.273.s1.nabble.com/Iterator-over-Roi-points-anywhere-tp5016087p5016094.html
Following up on this, does anyone have a plugin or algo to do the opposite, namely, collect a group of contiguous points into an ImageJ ROi?
Eric
Sent from [ProtonMail](
https://protonmail.ch), encrypted email based in Switzerland.
----------------------------------------------------------------------
Date: Sun, 10 Apr 2016 15:08:40 +0000
From: Burger Wilhelm <
[hidden email]>
Subject: Iterator over Roi points anywhere?
Hello all,
does anyone know of a straight way to enumerate/iterate over all points contained in an (arbitrary) Roi? That is (in Java terms), something like this:
...
Roi roi = im.getRoi();
for (Point p : roi.getContainedPoints()) {
... // process p
}
Any help appreciated!
--Wilhelm
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html------------------------------
Date: Sun, 10 Apr 2016 09:21:57 -0700
From: Bio7 <
[hidden email]>
Subject: Re: Iterator over Roi points anywhere?
I posted a similar solution in Jython here:
http://forum.imagej.net/t/pointroi-input-different-from-output-point-positions/1038So you can get, e.g., points, etc., in Java with:
Roi roi = im.getRoi();
int [] xArr = roi.getPolygon().xpoints
int [] yArr = roi.getPolygon().ypoints
See:
http://javadoc.imagej.net/ImageJ1/ij/gui/PolygonRoi.html#getNCoordinates%28%29--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html