/** Creates an OvalRoi. */ public static OvalRoi OvalRoi(double x, double y, double width, double height) { return new OvalRoi(x, y, width, height); }
/** Draws an elliptical shape. */ public void drawOval(int x, int y, int width, int height) { if ((long)width*height>4*this.width*this.height) return; OvalRoi oval = new OvalRoi(x, y, width, height); drawPolygon(oval.getPolygon()); }
protected OvalRoi mark(int distance, Color color) { float intensity = image.get(slice, distance); int x = image.distance2x(distance); int y = image.intensity2y(intensity); OvalRoi roi = new OvalRoi(x - 10, y - 10, 20, 20); if (color != null) roi.setStrokeColor(color); return roi; }
/** Returns this OvalRoi as a FloatPolygon. */ public FloatPolygon getFloatPolygon() { Polygon p = getPolygon(); return new FloatPolygon(toFloat(p.xpoints), toFloat(p.ypoints), p.npoints); }
/** Draws an outline of this OvalRoi on the image. */ public void drawPixels(ImageProcessor ip) { Polygon p = getPolygon(); if (p.npoints>0) { int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); ip.drawPolygon(p); ip.setLineWidth(saveWidth); } if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
protected void addCircle( final ImagePlus imp, final int centerX, final int centerY, final double radius ) { Overlay o = imp.getOverlay(); if ( o == null ) { o = new Overlay(); imp.setOverlay( o ); } final OvalRoi or = new OvalRoi( Math.round( centerX - radius ), Math.round( centerY - radius ), Math.round( radius * 2 ), Math.round( radius * 2 ) ); or.setStrokeColor( select ); or.setStrokeWidth( selectWidth ); o.add( or ); imp.updateAndDraw(); }
while (next < max && rois[next] == null) next++; Rectangle rect1 = rois[i].getBounds(); Rectangle rect2 = rois[next].getBounds(); for (int j = i + 1; j < next; j++) { int x = rect1.x + (j - i) * (rect2.x - rect1.x) / (next - i); int width = rect1.width + (j - i) * (rect2.width - rect1.width) / (next - i); int height = rect1.height + (j - i) * (rect2.height - rect1.height) / (next - i); rois[j] = new OvalRoi(x, y, width, height); if (debug) addToRoiManager(j + 1, rois[j]);
MetadataStore store, int roiNum, int shape, int c, int z, int t) Rectangle vnRectBounds = roi.getPolygon().getBounds(); int x = vnRectBounds.x; int y = vnRectBounds.y; store.setEllipseRadiusX((double) rx/2, roiNum, shape); store.setEllipseRadiusY((double) ry/2, roiNum, shape); store.setEllipseText(roi.getName(), roiNum, shape); if (c >= 0) { store.setEllipseTheC(unwrap(c), roiNum, shape); store.setEllipseTheT(unwrap(t), roiNum, shape); if (roi.getStrokeWidth() > 0) { store.setEllipseStrokeWidth(new Length((roi.getStrokeWidth()), UNITS.PIXEL), roiNum, shape); if (roi.getStrokeColor() != null) { store.setEllipseStrokeColor(toOMExmlColor(roi.getStrokeColor()), roiNum, shape); if (roi.getFillColor() != null){ store.setEllipseFillColor(toOMExmlColor(roi.getFillColor()) , roiNum, shape);
/** Returns the number of points in this selection; equivalent to getPolygon().npoints. */ public int size() { return getPolygon().npoints; }
final OvalRoi or = new OvalRoi( Math.round( p1.getL()[ 0 ] - newRadius ), Math.round( p1.getL()[ 1 ] - newRadius ), Math.round( newRadius * 2 ), Math.round( newRadius * 2 ) ); or.setStrokeColor( highlight ); or.setStrokeWidth( hightlightWidth ); or.setStrokeColor( standard ); or.setStrokeWidth( standardWidth );
MetadataStore store, int roiNum, int shape, int c, int z, int t) Rectangle vnRectBounds = roi.getPolygon().getBounds(); int x = vnRectBounds.x; int y = vnRectBounds.y; store.setEllipseRadiusX((double) rx/2, roiNum, shape); store.setEllipseRadiusY((double) ry/2, roiNum, shape); store.setEllipseText(roi.getName(), roiNum, shape); if (c >= 0) { store.setEllipseTheC(unwrap(c), roiNum, shape); store.setEllipseTheT(unwrap(t), roiNum, shape); if (roi.getStrokeWidth() > 0) { store.setEllipseStrokeWidth(new Length((roi.getStrokeWidth()), UNITS.PIXEL), roiNum, shape); if (roi.getStrokeColor() != null) { store.setEllipseStrokeColor(toOMExmlColor(roi.getStrokeColor()), roiNum, shape); if (roi.getFillColor() != null){ store.setEllipseFillColor(toOMExmlColor(roi.getFillColor()) , roiNum, shape);
/** Draws an outline of this OvalRoi on the image. */ public void drawPixels(ImageProcessor ip) { Polygon p = getPolygon(); if (p.npoints>0) { int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); ip.drawPolygon(p); ip.setLineWidth(saveWidth); } if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Returns this OvalRoi as a FloatPolygon. */ public FloatPolygon getFloatPolygon() { Polygon p = getPolygon(); return new FloatPolygon(toFloat(p.xpoints), toFloat(p.ypoints), p.npoints); }
/** Returns the number of points in this selection; equivalent to getPolygon().npoints. */ public int size() { return getPolygon().npoints; }
/** Creates an OvalRoi. */ public static OvalRoi OvalRoi(double x, double y, double width, double height) { return new OvalRoi(x, y, width, height); }
/** Fills an elliptical shape. */ public void fillOval(int x, int y, int width, int height) { if ((long)width*height>4*this.width*this.height) return; OvalRoi oval = new OvalRoi(x, y, width, height); fillPolygon(oval.getPolygon()); }
protected static void drawProjectedInterestPoints( final ImagePlus imp, final List< InterestPoint > ipList, final int projectionDim ) { final int xDim = getXDim( projectionDim ); final int yDim = getYDim( projectionDim ); // extract peaks to show Overlay o = imp.getOverlay(); if ( o == null ) { o = new Overlay(); imp.setOverlay( o ); } o.clear(); for ( final InterestPoint ip : ipList ) { final double x = ip.getL()[ xDim ]; final double y = ip.getL()[ yDim ]; final OvalRoi or = new OvalRoi( Math.round( x - size ), Math.round( y - size ), Math.round( size * 2 ), Math.round( size * 2 ) ); or.setStrokeColor( Color.green ); o.add( or ); } imp.updateAndDraw(); }
final OvalRoi or = new OvalRoi( Math.round( p2.getL()[ 0 ] - newRadius ), Math.round( p2.getL()[ 1 ] - newRadius ), Math.round( newRadius * 2 ), Math.round( newRadius * 2 ) ); or.setStrokeColor( highlight ); or.setStrokeWidth( hightlightWidth ); or.setStrokeColor( standard ); or.setStrokeWidth( standardWidth );