/** Adds the specified ROI. */ public void addRoi(Roi roi) { allowDuplicates = true; addRoi(roi, false, null, -1); }
/** Adds the specified ROI. */ public void addRoi(Roi roi) { allowDuplicates = true; addRoi(roi, false, null, -1); }
boolean addRoi(boolean promptForName) { return addRoi(null, promptForName, null, IGNORE_POSITION); }
boolean addRoi(boolean promptForName) { return addRoi(null, promptForName, null, IGNORE_POSITION); }
/** Adds the current selection to the ROI Manager, using the specified color (a 6 digit hex string) and line width. */ public boolean runCommand(String cmd, String hexColor, double lineWidth) { if (hexColor==null && lineWidth==1.0 && (IJ.altKeyDown()&&!Interpreter.isBatchMode())) addRoi(true); else { Color color = hexColor!=null?Colors.decode(hexColor, Color.cyan):null; addRoi(null, false, color, (int)Math.round(lineWidth)); } return true; }
/** Adds the current selection to the ROI Manager, using the specified color (a 6 digit hex string) and line width. */ public boolean runCommand(String cmd, String hexColor, double lineWidth) { if (hexColor==null && lineWidth==1.0 && (IJ.altKeyDown()&&!Interpreter.isBatchMode())) addRoi(true); else { Color color = hexColor!=null?Colors.decode(hexColor, Color.cyan):null; addRoi(null, false, color, (int)Math.round(lineWidth)); } return true; }
void addAndDraw(boolean altKeyDown) { if (altKeyDown) { if (!addRoi(true)) return; } else if (!addRoi(false)) return; ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { Undo.setup(Undo.COMPOUND_FILTER, imp); IJ.run(imp, "Draw", "slice"); Undo.setup(Undo.COMPOUND_FILTER_DONE, imp); } if (record()) Recorder.record("roiManager", "Add & Draw"); }
void addAndDraw(boolean altKeyDown) { if (altKeyDown) { if (!addRoi(true)) return; } else if (!addRoi(false)) return; ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { Undo.setup(Undo.COMPOUND_FILTER, imp); IJ.run(imp, "Draw", "slice"); Undo.setup(Undo.COMPOUND_FILTER_DONE, imp); } if (record()) Recorder.record("roiManager", "Add & Draw"); }
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"); }
Rectangle bounds = roi.getBounds(); roi.setLocation(bounds.x+xmin, bounds.y+ymin); roiman.addRoi(roi);
Rectangle bounds = roi.getBounds(); roi.setLocation(bounds.x+xmin, bounds.y+ymin); roiman.addRoi(roi);
if (rois[i] != null) { image.setSliceWithoutUpdate(i + 1); roiManager.addRoi(rois[i]);
rm.setEditMode(plugin.getImagePlus(), false); for (final Roi path : overlay.toArray()) rm.addRoi(path); rm.runCommand("sort"); rm.setEditMode(plugin.getImagePlus(), true);