/** Adds the specified ROI to the list. The third argument ('n') will * be used to form the first part of the ROI label if it is zero or greater. * @param imp the image associated with the ROI, or null * @param roi the Roi to be added * @param n if zero or greater, will be used to form the first part of the label */ public void add(ImagePlus imp, Roi roi, int n) { if (IJ.debugMode && n<3 && roi!=null) IJ.log("RoiManager.add: "+n+" "+roi.getName()); if (roi==null) return; String label = roi.getName(); String label2 = label; if (label==null) label = getLabel(imp, roi, n); else { if (n>=0) label = n+"-"+label; } if (label==null) return; listModel.addElement(label); if (label2!=null) roi.setName(label2); else roi.setName(label); rois.add((Roi)roi.clone()); }
/** Adds the specified ROI to the list. The third argument ('n') will * be used to form the first part of the ROI label if it is zero or greater. * @param imp the image associated with the ROI, or null * @param roi the Roi to be added * @param n if zero or greater, will be used to form the first part of the label */ public void add(ImagePlus imp, Roi roi, int n) { if (IJ.debugMode && n<3 && roi!=null) IJ.log("RoiManager.add: "+n+" "+roi.getName()); if (roi==null) return; String label = roi.getName(); String label2 = label; if (label==null) label = getLabel(imp, roi, n); else { if (n>=0) label = n+"-"+label; } if (label==null) return; listModel.addElement(label); if (label2!=null) roi.setName(label2); else roi.setName(label); rois.add((Roi)roi.clone()); }
if (isStandardName(name)) name = null; String label = name!=null?name:getLabel(imp, roi, -1); if (promptForName) label = promptForName(label);
if (isStandardName(name)) name = null; String label = name!=null?name:getLabel(imp, roi, -1); if (promptForName) label = promptForName(label);