private boolean restoreWithoutUpdate(ImagePlus imp, int index) { noUpdateMode = true; if (imp==null) imp = getImage(); return restore(imp, index, false); }
private boolean restoreWithoutUpdate(ImagePlus imp, int index) { noUpdateMode = true; if (imp==null) imp = getImage(); return restore(imp, index, false); }
private void combine() { ImagePlus imp = getImage(); if (imp==null) return; Roi[] rois = getSelectedRoisAsArray(); if (rois.length==1) { error("More than one item must be selected, or none"); return; } int nPointRois = 0; for (int i=0; i<rois.length; i++) { if (rois[i].getType()==Roi.POINT) nPointRois++; else break; } if (nPointRois==rois.length) combinePoints(imp, rois); else combineRois(imp, rois); }
private void combine() { ImagePlus imp = getImage(); if (imp==null) return; Roi[] rois = getSelectedRoisAsArray(); if (rois.length==1) { error("More than one item must be selected, or none"); return; } int nPointRois = 0; for (int i=0; i<rois.length; i++) { if (rois[i].getType()==Roi.POINT) nPointRois++; else break; } if (nPointRois==rois.length) combinePoints(imp, rois); else combineRois(imp, rois); }
ImagePlus imp = getImage(); if (imp!=null) { Roi roi = imp.getRoi();
ImagePlus imp = getImage(); if (imp!=null) { Roi roi = imp.getRoi();
boolean update(boolean clone) { ImagePlus imp = getImage(); if (imp==null) return false; ImageCanvas ic = imp.getCanvas(); boolean showingAll = ic!=null && ic.getShowAllROIs(); Roi roi = imp.getRoi(); if (roi==null) { error("The active image does not have a selection."); return false; } int index = list.getSelectedIndex(); if (index<0 && !showingAll) return error("Exactly one item in the list must be selected."); if (index>=0) { if (clone) { String name = (String)listModel.getElementAt(index); Roi roi2 = (Roi)roi.clone(); roi2.setPosition(imp); roi.setName(name); roi2.setName(name); rois.set(index, roi2); } else rois.set(index, roi); } if (record()) Recorder.record("roiManager", "Update"); updateShowAll(); return true; }
boolean update(boolean clone) { ImagePlus imp = getImage(); if (imp==null) return false; ImageCanvas ic = imp.getCanvas(); boolean showingAll = ic!=null && ic.getShowAllROIs(); Roi roi = imp.getRoi(); if (roi==null) { error("The active image does not have a selection."); return false; } int index = list.getSelectedIndex(); if (index<0 && !showingAll) return error("Exactly one item in the list must be selected."); if (index>=0) { if (clone) { String name = (String)listModel.getElementAt(index); Roi roi2 = (Roi)roi.clone(); roi2.setPosition(imp); roi.setName(name); roi2.setName(name); rois.set(index, roi2); } else rois.set(index, roi); } if (record()) Recorder.record("roiManager", "Update"); updateShowAll(); return true; }
void split() { ImagePlus imp = getImage(); if (imp==null) return; Roi roi = imp.getRoi(); if (roi==null || roi.getType()!=Roi.COMPOSITE) { error("Image with composite selection required"); return; } boolean record = Recorder.record; Recorder.record = false; Roi[] rois = ((ShapeRoi)roi).getRois(); for (int i=0; i<rois.length; i++) { imp.setRoi(rois[i]); addRoi(false); } Recorder.record = record; if (record()) Recorder.record("roiManager", "Split"); }
void split() { ImagePlus imp = getImage(); if (imp==null) return; Roi roi = imp.getRoi(); if (roi==null || roi.getType()!=Roi.COMPOSITE) { error("Image with composite selection required"); return; } boolean record = Recorder.record; Recorder.record = false; Roi[] rois = ((ShapeRoi)roi).getRois(); for (int i=0; i<rois.length; i++) { imp.setRoi(rois[i]); addRoi(false); } Recorder.record = record; if (record()) Recorder.record("roiManager", "Split"); }
void and() { ImagePlus imp = getImage(); if (imp==null) return; int[] indexes = getSelectedIndexes();
void and() { ImagePlus imp = getImage(); if (imp==null) return; int[] indexes = getSelectedIndexes();
void xor() { ImagePlus imp = getImage(); if (imp==null) return; int[] indexes = getSelectedIndexes();
void xor() { ImagePlus imp = getImage(); if (imp==null) return; int[] indexes = getSelectedIndexes();
boolean addRoi(Roi roi, boolean promptForName, Color color, int lineWidth) { if (listModel==null) IJ.log("<<Error: Uninitialized RoiManager>>"); ImagePlus imp = roi==null?getImage():WindowManager.getCurrentImage(); if (roi==null) { if (imp==null)
boolean addRoi(Roi roi, boolean promptForName, Color color, int lineWidth) { if (listModel==null) IJ.log("<<Error: Uninitialized RoiManager>>"); ImagePlus imp = roi==null?getImage():WindowManager.getCurrentImage(); if (roi==null) { if (imp==null)