/** Creates an empty Overlay that has the current label settings. */ public static Overlay createOverlay() { return defaultOverlay.duplicate(); }
/** Creates an empty Overlay that has the current label settings. */ public static Overlay createOverlay() { return defaultOverlay.duplicate(); }
public Overlay crop(Rectangle bounds) { if (bounds==null) return duplicate(); Overlay overlay2 = create(); Roi[] allRois = toArray(); for (Roi roi: allRois) { Rectangle roiBounds = roi.getBounds(); if (roiBounds.width==0) roiBounds.width=1; if (roiBounds.height==0) roiBounds.height=1; if (bounds.intersects(roiBounds)) overlay2.add((Roi)roi.clone()); } int dx = bounds.x>0?bounds.x:0; int dy = bounds.y>0?bounds.y:0; if (dx>0 || dy>0) overlay2.translate(-dx, -dy); return overlay2; }
public Overlay crop(Rectangle bounds) { if (bounds==null) return duplicate(); Overlay overlay2 = create(); Roi[] allRois = toArray(); for (Roi roi: allRois) { Rectangle roiBounds = roi.getBounds(); if (roiBounds.width==0) roiBounds.width=1; if (roiBounds.height==0) roiBounds.height=1; if (bounds.intersects(roiBounds)) overlay2.add((Roi)roi.clone()); } int dx = bounds.x>0?bounds.x:0; int dy = bounds.y>0?bounds.y:0; if (dx>0 || dy>0) overlay2.translate(-dx, -dy); return overlay2; }
/** Returns a copy of 'overlay', limited to the dimensions of the reduced image. */ private Overlay reduce(Overlay overlay) { int c1 = imp.getChannel(); int z1 = imp.getSlice(); int t1 = imp.getFrame(); Overlay overlay2 = overlay.duplicate(); if (channels2==1 && slices2==slices1 && frames2==frames1) overlay2.crop(c1, c1, 1, slices1, 1, frames1); else if (channels2==channels1 && slices2==1 && frames2==frames1) overlay2.crop(1, channels1, z1, z1, 1, frames1); else if (channels2==channels1 && slices2==slices1 && frames2==1) overlay2.crop(1, channels1, 1, slices1, t1, t1); else if (channels2==channels1 && slices2==1 && frames2==1) overlay2.crop(1, channels1, z1, z1, t1, t1); else if (channels2==1 && slices2==slices1 && frames2==1) overlay2.crop(c1, c1, 1, slices1, t1, t1); else if (channels2==1 && slices2==1 && frames2==frames1) overlay2.crop(c1, c1, z1, z1, 1, frames1); else if (channels2==1 && slices2==1 && frames2==1) overlay2.crop(c1, c1, z1, z1, t1, t1); return overlay2; }
/** Returns a copy of 'overlay', limited to the dimensions of the reduced image. */ private Overlay reduce(Overlay overlay) { int c1 = imp.getChannel(); int z1 = imp.getSlice(); int t1 = imp.getFrame(); Overlay overlay2 = overlay.duplicate(); if (channels2==1 && slices2==slices1 && frames2==frames1) overlay2.crop(c1, c1, 1, slices1, 1, frames1); else if (channels2==channels1 && slices2==1 && frames2==frames1) overlay2.crop(1, channels1, z1, z1, 1, frames1); else if (channels2==channels1 && slices2==slices1 && frames2==1) overlay2.crop(1, channels1, 1, slices1, t1, t1); else if (channels2==channels1 && slices2==1 && frames2==1) overlay2.crop(1, channels1, z1, z1, t1, t1); else if (channels2==1 && slices2==slices1 && frames2==1) overlay2.crop(c1, c1, 1, slices1, t1, t1); else if (channels2==1 && slices2==1 && frames2==frames1) overlay2.crop(c1, c1, z1, z1, 1, frames1); else if (channels2==1 && slices2==1 && frames2==1) overlay2.crop(c1, c1, z1, z1, t1, t1); return overlay2; }
imp2.setOverlay(null); if (overlay!=null && format.equals("tiff")) { Overlay overlay2 = overlay.duplicate(); overlay2.crop(i, i); if (overlay2.size()>0) {
imp2.setOverlay(null); if (overlay!=null && format.equals("tiff")) { Overlay overlay2 = overlay.duplicate(); overlay2.crop(i, i); if (overlay2.size()>0) {
tmp.setProcessor(null, stack.getProcessor(i)); if (overlay!=null) { Overlay overlay2 = overlay.duplicate(); overlay2.crop(i, i); if (overlay2.size()>0) {
tmp.setProcessor(null, stack.getProcessor(i)); if (overlay!=null) { Overlay overlay2 = overlay.duplicate(); overlay2.crop(i, i); if (overlay2.size()>0) {
overlay = null; if (overlay!=null) overlay = overlay.duplicate(); scale(ip, overlay);
overlay = null; if (overlay!=null) overlay = overlay.duplicate(); scale(ip, overlay);
Overlay overlay2 = overlay.duplicate(); if (slices2>1 && frames2>1)
Overlay overlay2 = overlay.duplicate(); if (slices2>1 && frames2>1)
overlay = null; if (overlay!=null) { overlay = overlay.duplicate(); Overlay overlay2 = new Overlay(); for (int i=0; i<overlay.size(); i++) {
overlay = null; if (overlay!=null) { overlay = overlay.duplicate(); Overlay overlay2 = new Overlay(); for (int i=0; i<overlay.size(); i++) {