/** Returns the points as a FloatPolygon. */ public FloatPolygon getContainedFloatPoints() { return getFloatPolygon(); }
/** Returns the points as a FloatPolygon. */ public FloatPolygon getContainedFloatPoints() { return getFloatPolygon(); }
/** Returns the points as an array of Points. * Wilhelm Burger: modified to use FloatPolygon for correct point positions. */ public Point[] getContainedPoints() { FloatPolygon p = getFloatPolygon(); Point[] points = new Point[p.npoints]; for (int i=0; i<p.npoints; i++) points[i] = new Point((int) Math.round(p.xpoints[i] - 0.5f), (int) Math.round(p.ypoints[i] - 0.5f)); return points; }
/** Returns the points as an array of Points. * Wilhelm Burger: modified to use FloatPolygon for correct point positions. */ public Point[] getContainedPoints() { FloatPolygon p = getFloatPolygon(); Point[] points = new Point[p.npoints]; for (int i=0; i<p.npoints; i++) points[i] = new Point((int) Math.round(p.xpoints[i] - 0.5f), (int) Math.round(p.ypoints[i] - 0.5f)); return points; }
final static public List< Point > pointRoiToPoints( final PointRoi roi ) { final FloatPolygon fp = roi.getFloatPolygon(); final float[] x = fp.xpoints; final float[] y = fp.ypoints; final ArrayList< Point > points = new ArrayList< Point >(); for ( int i = 0; i < x.length; ++i ) points.add( new Point( new double[]{ x[ i ], y[ i ] } ) ); return points; }
final static public List< Point > pointRoiToPoints( final PointRoi roi ) { final FloatPolygon fp = roi.getFloatPolygon(); final float[] x = fp.xpoints; final float[] y = fp.ypoints; final ArrayList< Point > points = new ArrayList< Point >(); for ( int i = 0; i < x.length; ++i ) points.add( new Point( new double[]{ x[ i ], y[ i ] } ) ); return points; }
private PointOverlay createPointOverlay(final Roi roi) { assert roi instanceof PointRoi; final PointRoi ptRoi = (PointRoi) roi; final FloatPolygon poly = ptRoi.getFloatPolygon(); final List<double[]> points = new ArrayList<>(); for (int i = 0; i < poly.npoints; i++) { final double x = poly.xpoints[i]; final double y = poly.ypoints[i]; final double[] pt = new double[]{x,y}; points.add(pt); } final PointOverlay overlay = new PointOverlay(getContext(), points); assignPropertiesToOverlay(overlay, roi); return overlay; }
private void debug() { FloatPolygon p = getFloatPolygon(); ResultsTable rt = new ResultsTable(); for (int i=0; i<nPoints; i++) { if (counters!=null) { rt.setValue("Counter", i, counters[i]); rt.setValue("Position", i, positions[i]); } rt.setValue("X", i, p.xpoints[i]); rt.setValue("Y", i, p.ypoints[i]); } rt.show(getCountsTitle()); }
private void debug() { FloatPolygon p = getFloatPolygon(); ResultsTable rt = new ResultsTable(); for (int i=0; i<nPoints; i++) { if (counters!=null) { rt.setValue("Counter", i, counters[i]); rt.setValue("Position", i, positions[i]); } rt.setValue("X", i, p.xpoints[i]); rt.setValue("Y", i, p.ypoints[i]); } rt.show(getCountsTitle()); }
FloatPolygon p = roi.getFloatPolygon(); ImageProcessor ip = imp.getProcessor(); Calibration cal = imp.getCalibration();
FloatPolygon p = roi.getFloatPolygon(); ImageProcessor ip = imp.getProcessor(); Calibration cal = imp.getCalibration();