/** Constructs a PolygonFiller using the specified polygon. */ public PolygonFiller(int[] x, int[] y, int n) { setPolygon(x, y, n); }
/** Constructs a PolygonFiller using the specified polygon. */ public PolygonFiller(int[] x, int[] y, int n) { setPolygon(x, y, n); }
public ImageProcessor getMask() { if (cachedMask!=null && cachedMask.getPixels()!=null && cachedMask.getWidth()==width && cachedMask.getHeight()==height) return cachedMask; PolygonFiller pf = new PolygonFiller(); if (xSpline!=null) pf.setPolygon(toIntR(xSpline), toIntR(ySpline), splinePoints); else if (xpf!=null) pf.setPolygon(toIntR(xpf), toIntR(ypf), nPoints); else pf.setPolygon(xp, yp, nPoints); cachedMask = pf.getMask(width, height); return cachedMask; }
public ImageProcessor getMask() { if (cachedMask!=null && cachedMask.getPixels()!=null && cachedMask.getWidth()==width && cachedMask.getHeight()==height) return cachedMask; PolygonFiller pf = new PolygonFiller(); if (xSpline!=null) pf.setPolygon(toIntR(xSpline), toIntR(ySpline), splinePoints); else if (xpf!=null) pf.setPolygon(toIntR(xpf), toIntR(ypf), nPoints); else pf.setPolygon(xp, yp, nPoints); cachedMask = pf.getMask(width, height); return cachedMask; }
pf.setPolygon(roi.xpoints, roi.ypoints, roi.npoints); ImageProcessor mask = pf.getMask(bounds.width, bounds.height); setMask(mask);
pf.setPolygon(roi.xpoints, roi.ypoints, roi.npoints); ImageProcessor mask = pf.getMask(bounds.width, bounds.height); setMask(mask);
private void fillPolygon(ImageProcessor ip, Polygon p, boolean internContour) { PolygonRoi proi = new PolygonRoi(p, PolygonRoi.POLYGON); Rectangle r = proi.getBounds(); PolygonFiller pf = new PolygonFiller(); pf.setPolygon(proi.getXCoordinates(), proi.getYCoordinates(), proi.getNCoordinates()); ip.setRoi(r); ImageProcessor objectMask = pf.getMask(r.width, r.height); ip.fill(objectMask); if(!internContour){ ip.drawPolygon(p); } }
if (r.width>1 && r.height>1) { PolygonRoi proi = (PolygonRoi)roi; pf.setPolygon(proi.getXCoordinates(), proi.getYCoordinates(), proi.getNCoordinates()); ip2.setMask(pf.getMask(r.width, r.height)); if (floodFill) ff.particleAnalyzerFill(x, y, level1, level2, ip2.getMask(), r);
if (r.width>1 && r.height>1) { PolygonRoi proi = (PolygonRoi)roi; pf.setPolygon(proi.getXCoordinates(), proi.getYCoordinates(), proi.getNCoordinates()); ip2.setMask(pf.getMask(r.width, r.height)); if (floodFill) ff.particleAnalyzerFill(x, y, level1, level2, ip2.getMask(), r);