Returns the points contained (not contained) in roi if keepContained is true (false).
(Roi roi, boolean keepContained)
| 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; |
no test coverage detected