void decodeOverlayOptions(Roi roi, int version, int options, int color, int fontSize) { Overlay proto = new Overlay(); proto.drawLabels((options&OVERLAY_LABELS)!=0); proto.drawNames((options&OVERLAY_NAMES)!=0); proto.drawBackgrounds((options&OVERLAY_BACKGROUNDS)!=0); if (version>=220 && color!=0) proto.setLabelColor(new Color(color)); boolean bold = (options&OVERLAY_BOLD)!=0; boolean scalable = (options&SCALE_LABELS)!=0; if (fontSize>0 || bold || scalable) { proto.setLabelFont(new Font("SansSerif", bold?Font.BOLD:Font.PLAIN, fontSize), scalable); } roi.setPrototypeOverlay(proto); }
void decodeOverlayOptions(Roi roi, int version, int options, int color, int fontSize) { Overlay proto = new Overlay(); proto.drawLabels((options&OVERLAY_LABELS)!=0); proto.drawNames((options&OVERLAY_NAMES)!=0); proto.drawBackgrounds((options&OVERLAY_BACKGROUNDS)!=0); if (version>=220 && color!=0) proto.setLabelColor(new Color(color)); boolean bold = (options&OVERLAY_BOLD)!=0; boolean scalable = (options&SCALE_LABELS)!=0; if (fontSize>0 || bold || scalable) { proto.setLabelFont(new Font("SansSerif", bold?Font.BOLD:Font.PLAIN, fontSize), scalable); } roi.setPrototypeOverlay(proto); }
void updateRoiList(Rectangle rect) { if (gel==null) return; if (overlay==null) { overlay = new Overlay(); overlay.drawLabels(true); overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); } overlay.add(new Roi(rect.x, rect.y, rect.width, rect.height, null)); gel.setOverlay(overlay); }
void updateRoiList(Rectangle rect) { if (gel==null) return; if (overlay==null) { overlay = new Overlay(); overlay.drawLabels(true); overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); } overlay.add(new Roi(rect.x, rect.y, rect.width, rect.height, null)); gel.setOverlay(overlay); }
/** Returns a new Overlay that has the same properties as this one. */ public Overlay create() { Overlay overlay2 = new Overlay(); overlay2.drawLabels(label); overlay2.drawNames(drawNames); overlay2.drawBackgrounds(drawBackgrounds); overlay2.setLabelColor(labelColor); overlay2.setLabelFont(labelFont, scalableLabels); overlay2.setIsCalibrationBar(isCalibrationBar); overlay2.selectable(selectable); return overlay2; }
/** Returns a new Overlay that has the same properties as this one. */ public Overlay create() { Overlay overlay2 = new Overlay(); overlay2.drawLabels(label); overlay2.drawNames(drawNames); overlay2.drawBackgrounds(drawBackgrounds); overlay2.setLabelColor(labelColor); overlay2.setLabelFont(labelFont, scalableLabels); overlay2.setIsCalibrationBar(isCalibrationBar); overlay2.selectable(selectable); return overlay2; }
private Overlay newOverlay() { Overlay overlay = OverlayLabels.createOverlay(); overlay.drawLabels(labelsCheckbox.getState()); if (overlay.getLabelFont()==null && overlay.getLabelColor()==null) { overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); } overlay.drawNames(Prefs.useNamesAsLabels); if (overlayTemplate!=null) { overlay.drawNames(overlayTemplate.getDrawNames()); overlay.drawBackgrounds(overlayTemplate.getDrawBackgrounds()); overlay.setLabelColor(overlayTemplate.getLabelColor()); overlay.setLabelFont(overlayTemplate.getLabelFont(), overlayTemplate.scalableLabels()); } return overlay; }
private Overlay newOverlay() { Overlay overlay = OverlayLabels.createOverlay(); overlay.drawLabels(labelsCheckbox.getState()); if (overlay.getLabelFont()==null && overlay.getLabelColor()==null) { overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); } overlay.drawNames(Prefs.useNamesAsLabels); if (overlayTemplate!=null) { overlay.drawNames(overlayTemplate.getDrawNames()); overlay.drawBackgrounds(overlayTemplate.getDrawBackgrounds()); overlay.setLabelColor(overlayTemplate.getLabelColor()); overlay.setLabelFont(overlayTemplate.getLabelFont(), overlayTemplate.scalableLabels()); } return overlay; }
public void setPrototypeOverlay(Overlay overlay) { prototypeOverlay = new Overlay(); prototypeOverlay.drawLabels(overlay.getDrawLabels()); prototypeOverlay.drawNames(overlay.getDrawNames()); prototypeOverlay.drawBackgrounds(overlay.getDrawBackgrounds()); prototypeOverlay.setLabelColor(overlay.getLabelColor()); prototypeOverlay.setLabelFont(overlay.getLabelFont(), overlay.scalableLabels()); }
public void setPrototypeOverlay(Overlay overlay) { prototypeOverlay = new Overlay(); prototypeOverlay.drawLabels(overlay.getDrawLabels()); prototypeOverlay.drawNames(overlay.getDrawNames()); prototypeOverlay.drawBackgrounds(overlay.getDrawBackgrounds()); prototypeOverlay.setLabelColor(overlay.getLabelColor()); prototypeOverlay.setLabelFont(overlay.getLabelFont(), overlay.scalableLabels()); }
interp.getComma(); Color ignore = getColor(); overlay.drawBackgrounds(true);
interp.getComma(); Color ignore = getColor(); overlay.drawBackgrounds(true);
Analyzer.drawLabels(showLabels); overlay.drawNames(showNames); overlay.drawBackgrounds(drawBackgrounds); Color color = Colors.getColor(colorName, Color.white); overlay.setLabelColor(color);
Analyzer.drawLabels(showLabels); overlay.drawNames(showNames); overlay.drawBackgrounds(drawBackgrounds); Color color = Colors.getColor(colorName, Color.white); overlay.setLabelColor(color);
void setOverlay(ImagePlus imp, byte[][] rois) { Overlay overlay = new Overlay(); Overlay proto = null; for (int i=0; i<rois.length; i++) { Roi roi = RoiDecoder.openFromByteArray(rois[i]); if (roi==null) continue; if (proto==null) { proto = roi.getPrototypeOverlay(); overlay.drawLabels(proto.getDrawLabels()); overlay.drawNames(proto.getDrawNames()); overlay.drawBackgrounds(proto.getDrawBackgrounds()); overlay.setLabelColor(proto.getLabelColor()); overlay.setLabelFont(proto.getLabelFont(), proto.scalableLabels()); } overlay.add(roi); } imp.setOverlay(overlay); }
void setOverlay(ImagePlus imp, byte[][] rois) { Overlay overlay = new Overlay(); Overlay proto = null; for (int i=0; i<rois.length; i++) { Roi roi = RoiDecoder.openFromByteArray(rois[i]); if (roi==null) continue; if (proto==null) { proto = roi.getPrototypeOverlay(); overlay.drawLabels(proto.getDrawLabels()); overlay.drawNames(proto.getDrawNames()); overlay.drawBackgrounds(proto.getDrawBackgrounds()); overlay.setLabelColor(proto.getLabelColor()); overlay.setLabelFont(proto.getLabelFont(), proto.scalableLabels()); } overlay.add(roi); } imp.setOverlay(overlay); }
public void run(String arg) { imp = WindowManager.getCurrentImage(); overlay = null; if (imp!=null) { ImageCanvas ic = imp.getCanvas(); if (ic!=null) overlay = ic.getShowAllList(); if (overlay==null) overlay = imp.getOverlay(); } if (overlay==null) overlay = defaultOverlay; showDialog(); if (!gd.wasCanceled()) { defaultOverlay.drawLabels(overlay.getDrawLabels()); defaultOverlay.drawNames(overlay.getDrawNames()); defaultOverlay.drawBackgrounds(overlay.getDrawBackgrounds()); defaultOverlay.setLabelColor(overlay.getLabelColor()); defaultOverlay.setLabelFont(overlay.getLabelFont()); } }
public void run(String arg) { imp = WindowManager.getCurrentImage(); overlay = null; if (imp!=null) { ImageCanvas ic = imp.getCanvas(); if (ic!=null) overlay = ic.getShowAllList(); if (overlay==null) overlay = imp.getOverlay(); } if (overlay==null) overlay = defaultOverlay; showDialog(); if (!gd.wasCanceled()) { defaultOverlay.drawLabels(overlay.getDrawLabels()); defaultOverlay.drawNames(overlay.getDrawNames()); defaultOverlay.drawBackgrounds(overlay.getDrawBackgrounds()); defaultOverlay.setLabelColor(overlay.getLabelColor()); defaultOverlay.setLabelFont(overlay.getLabelFont()); } }
private void addRoiToOverlay() { Roi roi = imp.getRoi(); if (roi==null) return; roi = (Roi)roi.clone(); if (imp.getStackSize()>1) { if (imp.isHyperStack()||imp.isComposite()) roi.setPosition(0, imp.getSlice(), imp.getFrame()); else roi.setPosition(imp.getCurrentSlice()); } if (roi.getName()==null) roi.setName(""+rt.size()); //roi.setName(IJ.getString("Label:", "m"+rt.size())); roi.setIgnoreClipRect(true); Overlay overlay = imp.getOverlay(); if (overlay==null) overlay = new Overlay(); if (drawLabels) overlay.drawLabels(true); if (!overlay.getDrawNames()) overlay.drawNames(true); overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); overlay.add(roi); imp.setOverlay(overlay); if (roi.getType()==Roi.COMPOSITE && Toolbar.getToolId()==Toolbar.OVAL && Toolbar.getBrushSize()>0) imp.deleteRoi(); // delete ROIs created with the selection brush tool }
private void addRoiToOverlay() { Roi roi = imp.getRoi(); if (roi==null) return; roi = (Roi)roi.clone(); if (imp.getStackSize()>1) { if (imp.isHyperStack()||imp.isComposite()) roi.setPosition(0, imp.getSlice(), imp.getFrame()); else roi.setPosition(imp.getCurrentSlice()); } if (roi.getName()==null) roi.setName(""+rt.size()); //roi.setName(IJ.getString("Label:", "m"+rt.size())); roi.setIgnoreClipRect(true); Overlay overlay = imp.getOverlay(); if (overlay==null) overlay = new Overlay(); if (drawLabels) overlay.drawLabels(true); if (!overlay.getDrawNames()) overlay.drawNames(true); overlay.setLabelColor(Color.white); overlay.drawBackgrounds(true); overlay.add(roi); imp.setOverlay(overlay); if (roi.getType()==Roi.COMPOSITE && Toolbar.getToolId()==Toolbar.OVAL && Toolbar.getBrushSize()>0) imp.deleteRoi(); // delete ROIs created with the selection brush tool }