protected void drawOverlay(Graphics g) { if (imp!=null && imp.getHideOverlay()) return; Overlay overlay = imp.getOverlay(); if (overlay==null) return; int n = overlay.size(); for (int i=0; i<n; i++) { Roi roi = overlay.get(i); drawRoi(g, roi); } }
int height = imp.getHeight(); int biType = BufferedImage.TYPE_INT_RGB; boolean overlay = imp.getOverlay()!=null && !imp.getHideOverlay(); ImageProcessor ip = imp.getProcessor(); if (ip.isDefaultLut() && !imp.isComposite() && !overlay && ip.getMinThreshold()==ImageProcessor.NO_THRESHOLD)
int height = imp.getHeight(); int biType = BufferedImage.TYPE_INT_RGB; boolean overlay = imp.getOverlay()!=null && !imp.getHideOverlay(); ImageProcessor ip = imp.getProcessor(); if (ip.isDefaultLut() && !imp.isComposite() && !overlay && ip.getMinThreshold()==ImageProcessor.NO_THRESHOLD)
public void writeImage(ImagePlus imp, String path, int transparentIndex) throws Exception { if (imp.getStackSize()==4 && imp.getBitDepth()==8 && "alpha".equalsIgnoreCase(imp.getStack().getSliceLabel(4))) writeFourChannelsWithAlpha(imp, path); else if (transparentIndex>=0 && transparentIndex<=255 && imp.getBitDepth()==8) writeImageWithTransparency(imp, path, transparentIndex); else if (imp.getOverlay()!=null && !imp.getHideOverlay()) ImageIO.write(imp.flatten().getBufferedImage(), "png", new File(path)); else if (imp.getBitDepth()==16 && !imp.isComposite() && imp.getProcessor().isDefaultLut()) write16gs(imp, path); else ImageIO.write(imp.getBufferedImage(), "png", new File(path)); }
public void writeImage(ImagePlus imp, String path, int transparentIndex) throws Exception { if (imp.getStackSize()==4 && imp.getBitDepth()==8 && "alpha".equalsIgnoreCase(imp.getStack().getSliceLabel(4))) writeFourChannelsWithAlpha(imp, path); else if (transparentIndex>=0 && transparentIndex<=255 && imp.getBitDepth()==8) writeImageWithTransparency(imp, path, transparentIndex); else if (imp.getOverlay()!=null && !imp.getHideOverlay()) ImageIO.write(imp.flatten().getBufferedImage(), "png", new File(path)); else if (imp.getBitDepth()==16 && !imp.isComposite() && imp.getProcessor().isDefaultLut()) write16gs(imp, path); else ImageIO.write(imp.getBufferedImage(), "png", new File(path)); }
private ImagePlus flatten(ImagePlus imp) { if (imp.getOverlay()!=null && !imp.getHideOverlay() && !imp.isHyperStack()) { ImagePlus imp2 = imp; Roi roi = imp.getRoi(); if (imp.getStackSize()>1) { imp.deleteRoi(); int slice = imp.getCurrentSlice(); imp = new Duplicator().run(imp, slice, slice); } imp = imp.flatten(); imp.setRoi(roi); imp2.setRoi(roi); } return imp; }
public static byte[][] getOverlay(ImagePlus imp) { if (imp.getHideOverlay()) return null; Overlay overlay = imp.getOverlay(); if (overlay==null) { ImageCanvas ic = imp.getCanvas(); if (ic==null) return null; overlay = ic.getShowAllList(); // ROI Manager "Show All" list if (overlay==null) return null; } int n = overlay.size(); if (n==0) return null; if (Orthogonal_Views.isOrthoViewsImage(imp)) return null; byte[][] array = new byte[n][]; for (int i=0; i<overlay.size(); i++) { Roi roi = overlay.get(i); if (i==0) roi.setPrototypeOverlay(overlay); array[i] = RoiEncoder.saveAsByteArray(roi); } return array; }
public static byte[][] getOverlay(ImagePlus imp) { if (imp.getHideOverlay()) return null; Overlay overlay = imp.getOverlay(); if (overlay==null) { ImageCanvas ic = imp.getCanvas(); if (ic==null) return null; overlay = ic.getShowAllList(); // ROI Manager "Show All" list if (overlay==null) return null; } int n = overlay.size(); if (n==0) return null; if (Orthogonal_Views.isOrthoViewsImage(imp)) return null; byte[][] array = new byte[n][]; for (int i=0; i<overlay.size(); i++) { Roi roi = overlay.get(i); if (i==0) roi.setPrototypeOverlay(overlay); array[i] = RoiEncoder.saveAsByteArray(roi); } return array; }
private ImagePlus flatten(ImagePlus imp) { if (imp.getOverlay()!=null && !imp.getHideOverlay() && !imp.isHyperStack()) { ImagePlus imp2 = imp; Roi roi = imp.getRoi(); if (imp.getStackSize()>1) { imp.deleteRoi(); int slice = imp.getCurrentSlice(); imp = new Duplicator().run(imp, slice, slice); } imp = imp.flatten(); imp.setRoi(roi); imp2.setRoi(roi); } return imp; }
private void drawOverlay(Overlay overlay, Graphics g) { if (imp!=null && imp.getHideOverlay() && overlay!=showAllOverlay) return; flattening = imp!=null && ImagePlus.flattenTitle.equals(imp.getTitle());
if (overlay!=null && !imp.getHideOverlay()) { Overlay overlay2 = overlay.crop(ip.getRoi()); if (imp.getStackSize()>1)
if (overlay!=null && !imp.getHideOverlay()) { Overlay overlay2 = overlay.crop(ip.getRoi()); if (imp.getStackSize()>1)
else { Overlay overlay = imp.getOverlay(); if (imp.getHideOverlay()) overlay = null; if (overlay!=null && overlay.size()!=1)
else { Overlay overlay = imp.getOverlay(); if (imp.getHideOverlay()) overlay = null; if (overlay!=null && overlay.size()!=1)
imp2.setPosition(1, 1, 1); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) imp2.setOverlay(reduce(overlay));
imp2.setDisplayRange(min, max); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) { Overlay overlay2 = overlay.crop(rect); overlay2.crop(firstSlice, lastSlice);
imp2.setDisplayRange(min, max); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) { Overlay overlay2 = overlay.crop(rect); overlay2.crop(firstSlice, lastSlice);
imp2.setPosition(1, 1, 1); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) imp2.setOverlay(reduce(overlay));
imp2.setOpenAsHyperStack(true); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) imp2.setOverlay(overlay.crop(rect)); if (Recorder.record)
imp2.setOpenAsHyperStack(true); Overlay overlay = imp.getOverlay(); if (overlay!=null && !imp.getHideOverlay()) imp2.setOverlay(overlay.crop(rect)); if (Recorder.record)