Returns the coordinates of the pixels inside this ROI as an array of Points. @see #getContainedFloatPoints @see #iterator
()
| 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 |