/** Draws the specified ROI on this image using the line width and color defined by ip.setLineWidth() and ip.setColor(). @see ImageProcessor#drawRoi */ public void draw(Roi roi) { roi.drawPixels(this); }
/** Draws the specified ROI on this image using the line width and color defined by ip.setLineWidth() and ip.setColor(). @see ImageProcessor#drawRoi */ public void draw(Roi roi) { roi.drawPixels(this); }
/** * @deprecated * replaced by drawPixels(ImageProcessor) */ public void drawPixels() { if (imp!=null) drawPixels(imp.getProcessor()); }
/** * @deprecated * replaced by drawPixels(ImageProcessor) */ public void drawPixels() { if (imp!=null) drawPixels(imp.getProcessor()); }
/** * @deprecated * replaced by ImageProcessor.draw(Roi) */ public void draw(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); roi.drawPixels(ip); if (IJ.altKeyDown()) drawLabel(ip); }
/** * @deprecated * replaced by ImageProcessor.draw(Roi) */ public void draw(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); roi.drawPixels(ip); if (IJ.altKeyDown()) drawLabel(ip); }
public void mouseReleased(MouseEvent e) { super.mouseReleased(e); Roi roi = imp.getRoi(); if (roi!=null && roi.getType()==Roi.LINE) { Undo.setup(Undo.FILTER, imp); imp.getProcessor().snapshot(); roi.drawPixels(); imp.updateAndDraw(); imp.deleteRoi(); } }
public void mouseReleased(MouseEvent e) { super.mouseReleased(e); Roi roi = imp.getRoi(); if (roi!=null && roi.getType()==Roi.LINE) { Undo.setup(Undo.FILTER, imp); imp.getProcessor().snapshot(); roi.drawPixels(); imp.updateAndDraw(); imp.deleteRoi(); } }
/** * @deprecated * replaced by ImageProcessor.fill(Roi) */ public void fill(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); } else ip.fill(); // fill with foreground color }
/** * @deprecated * replaced by ImageProcessor.fill(Roi) */ public void fill(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); } else ip.fill(); // fill with foreground color }
public void clear(ImageProcessor ip) { ip.setColor(Toolbar.getBackgroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(); } else if (roi!=null && roi instanceof TextRoi) ((TextRoi)roi).clear(ip); else ip.fill(); // fill with background color ip.setColor(Toolbar.getForegroundColor()); }
public void clear(ImageProcessor ip) { ip.setColor(Toolbar.getBackgroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(); } else if (roi!=null && roi instanceof TextRoi) ((TextRoi)roi).clear(ip); else ip.fill(); // fill with background color ip.setColor(Toolbar.getForegroundColor()); }
Roi convertLineToPolygon(Roi roi, ImageProcessor ip) { if (roi==null) return null; ip.resetRoi(); ip.setColor(0); ip.fill(); ip.setColor(255); if (roi.getType()==Roi.LINE && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); //new ImagePlus("ip", ip.duplicate()).show(); ip.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE); ThresholdToSelection tts = new ThresholdToSelection(); return tts.convert(ip); }
Roi convertLineToPolygon(Roi roi, ImageProcessor ip) { if (roi==null) return null; ip.resetRoi(); ip.setColor(0); ip.fill(); ip.setColor(255); if (roi.getType()==Roi.LINE && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(ip); //new ImagePlus("ip", ip.duplicate()).show(); ip.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE); ThresholdToSelection tts = new ThresholdToSelection(); return tts.convert(ip); }
roi.setLocation(lwidth, lwidth); ip2.setColor(255); roi.drawPixels(ip2); ip2.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE); ThresholdToSelection tts = new ThresholdToSelection();
/** Fills the ROI with the current fill/draw value. * @see #setColor(Color) * @see #setValue(double) * @see #fill(Roi) */ public void fill(Roi roi) { if (roi!=null && roi.isLine()) { if ((roi instanceof Line) && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) fillPolygon(roi.getPolygon()); else roi.drawPixels(this); return; } ImageProcessor m = getMask(); Rectangle r = getRoi(); setRoi(roi); fill(getMask()); setMask(m); setRoi(r); }
/** Fills the ROI with the current fill/draw value. * @see #setColor(Color) * @see #setValue(double) * @see #fill(Roi) */ public void fill(Roi roi) { if (roi!=null && roi.isLine()) { if ((roi instanceof Line) && roi.getStrokeWidth()>1 && !(roi instanceof Arrow)) fillPolygon(roi.getPolygon()); else roi.drawPixels(this); return; } ImageProcessor m = getMask(); Rectangle r = getRoi(); setRoi(roi); fill(getMask()); setMask(m); setRoi(r); }
public void label(ImageProcessor ip) { if (!IJ.isMacro()) { IJ.error("Label", "To label a selection, enable \"Add to overlay\" in Analyze>\nSet Measurements and press 'm' (Analyze>Measure)."); return; } if (Analyzer.getCounter()==0) { IJ.error("Label", "Measurement counter is zero"); return; } if (Analyzer.firstParticle<Analyzer.lastParticle) drawParticleLabels(ip); else { ip.setColor(Toolbar.getForegroundColor()); ImageCanvas ic = imp.getCanvas(); if (ic!=null) { double mag = ic.getMagnification(); if (mag<1.0) { int lineWidth = 1; lineWidth = (int)(lineWidth/mag); ip.setLineWidth(lineWidth); } } roi.drawPixels(ip); ip.setLineWidth(1); drawLabel(ip); } }
case DRAW: roi.drawPixels(ip); break; case FILL: ip.fill(roi); break; case LABEL: roi.drawPixels(ip); filler.drawLabel(imp, ip, i+1, roi.getBounds()); break;
public void label(ImageProcessor ip) { if (!IJ.isMacro()) { IJ.error("Label", "To label a selection, enable \"Add to overlay\" in Analyze>\nSet Measurements and press 'm' (Analyze>Measure)."); return; } if (Analyzer.getCounter()==0) { IJ.error("Label", "Measurement counter is zero"); return; } if (Analyzer.firstParticle<Analyzer.lastParticle) drawParticleLabels(ip); else { ip.setColor(Toolbar.getForegroundColor()); ImageCanvas ic = imp.getCanvas(); if (ic!=null) { double mag = ic.getMagnification(); if (mag<1.0) { int lineWidth = 1; lineWidth = (int)(lineWidth/mag); ip.setLineWidth(lineWidth); } } roi.drawPixels(ip); ip.setLineWidth(1); drawLabel(ip); } }