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

Method crop

ij/src/main/java/ij/gui/PointRoi.java:1014–1023  ·  view source on GitHub ↗
(Roi roi)

Source from the content-addressed store, hash-verified

1012
1013 /* Returns a version of this PointRoi that only contains points inside 'roi'. */
1014 public PointRoi crop(Roi roi) {
1015 PointRoi points = (PointRoi)clone();
1016 Polygon p = points.getPolygon();
1017 for (int i=points.size()-1; i>=0; i--) {
1018 if (!roi.contains(p.xpoints[i],p.ypoints[i])) {
1019 points.deletePoint(i);
1020 }
1021 }
1022 return points;
1023 }
1024
1025 @Override
1026 public void copyAttributes(Roi roi2) {

Callers

nothing calls this directly

Calls 5

cloneMethod · 0.95
deletePointMethod · 0.95
getPolygonMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected