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

Method checkContained

ij/src/main/java/ij/gui/PointRoi.java:505–520  ·  view source on GitHub ↗

Returns the points contained (not contained) in roi if keepContained is true (false).

(Roi roi, boolean keepContained)

Source from the content-addressed store, hash-verified

503
504 /** Returns the points contained (not contained) in <code>roi</code> if <code>keepContained</code> is true (false). */
505 PointRoi checkContained(Roi roi, boolean keepContained) {
506 if (!roi.isArea()) return null;
507 FloatPolygon points = getFloatPolygon();
508 FloatPolygon points2 = new FloatPolygon();
509 for (int i=0; i<points.npoints; i++) {
510 if (keepContained == roi.containsPoint(points.xpoints[i], points.ypoints[i]))
511 points2.addPoint(points.xpoints[i], points.ypoints[i]);
512 }
513 if (points2.npoints==0)
514 return null;
515 else {
516 PointRoi roi2 = new PointRoi(points2.xpoints, points2.ypoints, points2.npoints);
517 roi2.copyAttributes(this);
518 return roi2;
519 }
520 }
521
522 public ImageProcessor getMask() {
523 ImageProcessor mask = cachedMask;

Callers 2

subtractPointsMethod · 0.95
containedPointsMethod · 0.95

Calls 5

addPointMethod · 0.95
copyAttributesMethod · 0.95
isAreaMethod · 0.80
getFloatPolygonMethod · 0.45
containsPointMethod · 0.45

Tested by

no test coverage detected