MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getContainedPoints

Method getContainedPoints

ij/src/main/java/ij/gui/Roi.java:773–787  ·  view source on GitHub ↗

Returns the coordinates of the pixels inside this ROI as an array of Points. @see #getContainedFloatPoints @see #iterator

()

Source from the content-addressed store, hash-verified

771 * @see #iterator
772 */
773 public Point[] getContainedPoints() {
774 Roi roi = this;
775 if (isLine())
776 roi = convertLineToArea(this);
777 ImageProcessor mask = roi.getMask();
778 Rectangle bounds = roi.getBounds();
779 ArrayList points = new ArrayList();
780 for (int y=0; y<bounds.height; y++) {
781 for (int x=0; x<bounds.width; x++) {
782 if (mask==null || mask.getPixel(x,y)!=0)
783 points.add(new Point(roi.x+x,roi.y+y));
784 }
785 }
786 return (Point[])points.toArray(new Point[points.size()]);
787 }
788
789 /** Returns the coordinates of the pixels inside this ROI as a FloatPolygon.
790 * @see #getContainedPoints

Callers

nothing calls this directly

Calls 8

isLineMethod · 0.95
convertLineToAreaMethod · 0.95
getMaskMethod · 0.95
getBoundsMethod · 0.95
getPixelMethod · 0.95
addMethod · 0.65
toArrayMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected