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

Method getContainedFloatPoints

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

Returns the coordinates of the pixels inside this ROI as a FloatPolygon. @see #getContainedPoints @see #iterator

()

Source from the content-addressed store, hash-verified

791 * @see #iterator
792 */
793 public FloatPolygon getContainedFloatPoints() {
794 Roi roi2 = this;
795 if (isLine()) {
796 if (getStrokeWidth()<=1)
797 return roi2.getInterpolatedPolygon();
798 else
799 roi2 = convertLineToArea(this);
800 }
801 ImageProcessor mask = roi2.getMask();
802 Rectangle bounds = roi2.getBounds();
803 FloatPolygon points = new FloatPolygon();
804 for (int y=0; y<bounds.height; y++) {
805 for (int x=0; x<bounds.width; x++) {
806 if (mask==null || mask.getPixel(x,y)!=0)
807 points.addPoint((float)(bounds.x+x),(float)(bounds.y+y));
808 }
809 }
810 return points;
811 }
812
813 /**
814 * <pre>

Callers 1

getContainedPointsMethod · 0.45

Calls 8

isLineMethod · 0.95
getStrokeWidthMethod · 0.95
convertLineToAreaMethod · 0.95
getMaskMethod · 0.95
getBoundsMethod · 0.95
getPixelMethod · 0.95
addPointMethod · 0.95

Tested by

no test coverage detected