private void removeOverlay(ImagePlus imp) { if (imp!=null && imp.getCanvas()!=null) setOverlay(imp, null); }
private void removeOverlay(ImagePlus imp) { if (imp!=null && imp.getCanvas()!=null) setOverlay(imp, null); }
void updateShowAll() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; if (showAllCheckbox.getState()) { if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } else removeOverlay(imp); } else removeOverlay(imp); }
void updateShowAll() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; if (showAllCheckbox.getState()) { if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } else removeOverlay(imp); } else removeOverlay(imp); }
void toRoiManager() { ImagePlus imp = IJ.getImage(); Overlay overlay = imp.getOverlay(); if (overlay==null) { IJ.error("Overlay required"); return; } RoiManager rm = RoiManager.getInstance2(); if (rm==null) rm = new RoiManager(); if (overlay.size()>=4 && overlay.get(3).getPosition()!=0) Prefs.showAllSliceOnly = true; rm.setOverlay(overlay); imp.setOverlay(null); }
void showAll(int mode) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; boolean showAll = mode==SHOW_ALL; if (showAll) imageID = imp.getID(); if (mode==LABELS || mode==NO_LABELS) showAll = true; if (showAll) imp.deleteRoi(); if (mode==SHOW_NONE) { removeOverlay(imp); imageID = 0; } else if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } }
void toRoiManager() { ImagePlus imp = IJ.getImage(); Overlay overlay = imp.getOverlay(); if (overlay==null) { IJ.error("Overlay required"); return; } RoiManager rm = RoiManager.getInstance2(); if (rm==null) rm = new RoiManager(); if (overlay.size()>=4 && overlay.get(3).getPosition()!=0) Prefs.showAllSliceOnly = true; rm.setOverlay(overlay); imp.setOverlay(null); }
void showAll(int mode) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; boolean showAll = mode==SHOW_ALL; if (showAll) imageID = imp.getID(); if (mode==LABELS || mode==NO_LABELS) showAll = true; if (showAll) imp.deleteRoi(); if (mode==SHOW_NONE) { removeOverlay(imp); imageID = 0; } else if (getCount()>0) { Roi[] rois = getRoisAsArray(); Overlay overlay = newOverlay(); for (int i=0; i<rois.length; i++) overlay.add(rois[i]); setOverlay(imp, overlay); } }
/** Moves all the ROIs to the specified image's overlay. */ public void moveRoisToOverlay(ImagePlus imp) { if (imp==null) return; Roi[] rois = getRoisAsArray(); int n = rois.length; Overlay overlay = imp.getOverlay(); if (overlay==null) overlay = newOverlay(); for (int i=0; i<n; i++) { Roi roi = (Roi)rois[i].clone(); if (!Prefs.showAllSliceOnly && !IJ.isMacro()) roi.setPosition(0); //if (roi.getStrokeWidth()==1) // roi.setStrokeWidth(0); overlay.add(roi); } if (overlayTemplate!=null) overlay.drawLabels(overlayTemplate.getDrawLabels()); imp.setOverlay(overlay); if (imp.getCanvas()!=null) setOverlay(imp, null); }
/** Moves all the ROIs to the specified image's overlay. */ public void moveRoisToOverlay(ImagePlus imp) { if (imp==null) return; Roi[] rois = getRoisAsArray(); int n = rois.length; Overlay overlay = imp.getOverlay(); if (overlay==null) overlay = newOverlay(); for (int i=0; i<n; i++) { Roi roi = (Roi)rois[i].clone(); if (!Prefs.showAllSliceOnly && !IJ.isMacro()) roi.setPosition(0); //if (roi.getStrokeWidth()==1) // roi.setStrokeWidth(0); overlay.add(roi); } if (overlayTemplate!=null) overlay.drawLabels(overlayTemplate.getDrawLabels()); imp.setOverlay(overlay); if (imp.getCanvas()!=null) setOverlay(imp, null); }
setOverlay(imp, overlay); } else imp.draw();
setOverlay(imp, overlay); } else imp.draw();