/** Returns a copy of this TextRoi. */ public synchronized Object clone() { TextRoi tr = (TextRoi)super.clone(); tr.theText = new String[MAX_LINES]; for (int i=0; i<MAX_LINES; i++) tr.theText[i] = theText[i]; return tr; }
/** Returns a copy of this TextRoi. */ public synchronized Object clone() { TextRoi tr = (TextRoi)super.clone(); tr.theText = new String[MAX_LINES]; for (int i=0; i<MAX_LINES; i++) tr.theText[i] = theText[i]; return tr; }
/** Replaces the ROI at the specified index. */ public void setRoi(Roi roi, int index) { if (index<0 || index>=rois.size()) throw new IllegalArgumentException("setRoi: Index out of range"); rois.set(index, (Roi)roi.clone()); updateShowAll(); }
/** Replaces the ROI at the specified index. */ public void setRoi(Roi roi, int index) { if (index<0 || index>=rois.size()) throw new IllegalArgumentException("setRoi: Index out of range"); rois.set(index, (Roi)roi.clone()); updateShowAll(); }
/**Returns a deep copy of this. */ public synchronized Object clone() { // the equivalent of "operator=" ? ShapeRoi sr = (ShapeRoi)super.clone(); sr.type = COMPOSITE; sr.flatness = flatness; sr.maxerror = maxerror; sr.forceAngle = forceAngle; sr.forceTrace = forceTrace; //sr.setImage(imp); //wsr sr.setShape(ShapeRoi.cloneShape(shape)); return sr; }
public void saveRoi() { if (null != roi) { roi.endPaste(); Rectangle r = roi.getBounds(); if (r.width>0 && r.height>0) { Roi.previousRoi = (Roi)roi.clone(); } } }
/**Returns a deep copy of this. */ public synchronized Object clone() { // the equivalent of "operator=" ? ShapeRoi sr = (ShapeRoi)super.clone(); sr.type = COMPOSITE; sr.flatness = flatness; sr.maxerror = maxerror; sr.forceAngle = forceAngle; sr.forceTrace = forceTrace; //sr.setImage(imp); //wsr sr.setShape(ShapeRoi.cloneShape(shape)); return sr; }
@Override public MultiplePointsRoi clone() { MultiplePointsRoi r = (MultiplePointsRoi) super.clone(); r.markerType = markerType; r.xs = xs.clone(); r.ys = ys.clone(); return r; } }
/** Returns a clone of this Overlay. */ public Overlay duplicate() { Roi[] rois = toArray(); Overlay overlay2 = create(); for (int i=0; i<rois.length; i++) overlay2.add((Roi)rois[i].clone()); return overlay2; }
public void saveRoi() { Roi roi2 = roi; if (roi2!=null) { roi2.endPaste(); Rectangle r = roi2.getBounds(); if ((r.width>0 || r.height>0)) { Roi.previousRoi = (Roi)roi2.clone(); if (IJ.debugMode) IJ.log("saveRoi: "+roi2); } } }
/** Returns a clone of this Overlay. */ public Overlay duplicate() { Roi[] rois = toArray(); Overlay overlay2 = create(); for (int i=0; i<rois.length; i++) overlay2.add((Roi)rois[i].clone()); return overlay2; }
public void saveRoi() { Roi roi2 = roi; if (roi2!=null) { roi2.endPaste(); Rectangle r = roi2.getBounds(); if ((r.width>0 || r.height>0)) { Roi.previousRoi = (Roi)roi2.clone(); if (IJ.debugMode) IJ.log("saveRoi: "+roi2); } } }
@Override public void mouseReleased(MouseEvent e) { if (activeHandle >= 0) { ImagePlus image = getImagePlus(e); // make sure that the ROI has a correct bounding box Roi roi = image.getRoi(); if (roi != null) setRoi(WindowManager.getCurrentImage(), (Roi)roi.clone()); } }
private void enlarge(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi!=null) { Undo.setup(Undo.ROI, imp); roi = (Roi)roi.clone(); (new RoiEnlarger()).run(""); } else noRoi("Enlarge"); }
private void enlarge(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi!=null) { Undo.setup(Undo.ROI, imp); roi = (Roi)roi.clone(); (new RoiEnlarger()).run(""); } else noRoi("Enlarge"); }
private Overlay projectStackRois(Overlay overlay) { if (overlay==null) return null; Overlay overlay2 = overlay.create(); Roi roi; int s; for (Roi r : overlay.toArray()) { s = r.getPosition(); roi = (Roi)r.clone(); if (s>=startSlice && s<=stopSlice || s==0) { roi.setPosition(s); overlay2.add(roi); } } return overlay2; }
private void lineToArea(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi==null || !roi.isLine()) {IJ.error("Line to Area", "Line selection required"); return;} Undo.setup(Undo.ROI, imp); Roi roi2 = lineToArea(roi); imp.setRoi(roi2); Roi.previousRoi = (Roi)roi.clone(); }
public synchronized Object clone() { ImageRoi roi2 = (ImageRoi)super.clone(); ImagePlus imp = new ImagePlus("", img); roi2.setProcessor(imp.getProcessor()); roi2.setOpacity(getOpacity()); roi2.zeroTransparent = !zeroTransparent; roi2.setZeroTransparent(zeroTransparent); return roi2; }
private void lineToArea(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi==null || !roi.isLine()) {IJ.error("Line to Area", "Line selection required"); return;} Undo.setup(Undo.ROI, imp); Roi roi2 = lineToArea(roi); imp.setRoi(roi2); Roi.previousRoi = (Roi)roi.clone(); }
public synchronized Object clone() { ImageRoi roi2 = (ImageRoi)super.clone(); ImagePlus imp = new ImagePlus("", img); roi2.setProcessor(imp.getProcessor()); roi2.setOpacity(getOpacity()); roi2.zeroTransparent = !zeroTransparent; roi2.setZeroTransparent(zeroTransparent); return roi2; }