ImagePlus getImage() { ImagePlus imp = IJ.getImage(interp); if (imp.getWindow()==null && IJ.getInstance()!=null && !interp.isBatchMode() && WindowManager.getTempCurrentImage()==null) throw new RuntimeException(Macro.MACRO_CANCELED); defaultIP = null; defaultImp = imp; return imp; }
ImagePlus getImage() { ImagePlus imp = IJ.getImage(interp); if (imp.getWindow()==null && IJ.getInstance()!=null && !interp.isBatchMode() && WindowManager.getTempCurrentImage()==null) throw new RuntimeException(Macro.MACRO_CANCELED); defaultIP = null; defaultImp = imp; return imp; }
/** Runs the specified plugin using the specified image. */ public static Object runPlugIn(ImagePlus imp, String className, String arg) { if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); Object o = runPlugIn("", className, arg); WindowManager.setTempCurrentImage(temp); return o; } else return runPlugIn(className, arg); }
/** Runs the specified plugin using the specified image. */ public static Object runPlugIn(ImagePlus imp, String className, String arg) { if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); Object o = runPlugIn("", className, arg); WindowManager.setTempCurrentImage(temp); return o; } else return runPlugIn(className, arg); }
/** Runs an ImageJ command using the specified image and options. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.*/ public static void run(ImagePlus imp, String command, String options) { if (ij==null && Menus.getCommands()==null) init(); if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); run(command, options); WindowManager.setTempCurrentImage(temp); } else run(command, options); }
/** Runs an ImageJ command using the specified image and options. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.*/ public static void run(ImagePlus imp, String command, String options) { if (ij==null && Menus.getCommands()==null) init(); if (imp!=null) { ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(imp); run(command, options); WindowManager.setTempCurrentImage(temp); } else run(command, options); }
error("Macro Error", "Image "+id+" not found or no images are open."); if (Interpreter.isBatchMode()) { ImagePlus impT = WindowManager.getTempCurrentImage(); ImagePlus impC = WindowManager.getCurrentImage(); if (impC!=null && impC!=imp && impT!=null)
error("Macro Error", "Image "+id+" not found or no images are open."); if (Interpreter.isBatchMode()) { ImagePlus impT = WindowManager.getTempCurrentImage(); ImagePlus impC = WindowManager.getCurrentImage(); if (impC!=null && impC!=imp && impT!=null)
if (interp.isBatchMode()) return; interp.setBatchMode(true); ImagePlus tmp = WindowManager.getTempCurrentImage(); if (tmp!=null) Interpreter.addBatchModeImage(tmp);
if (interp.isBatchMode()) return; interp.setBatchMode(true); ImagePlus tmp = WindowManager.getTempCurrentImage(); if (tmp!=null) Interpreter.addBatchModeImage(tmp);
public static void applyMacro(ImageProcessor ip, String macro, boolean showProgress) { if (!macro.contains("=")) macro = "v="+macro; ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(new ImagePlus("",ip)); int PCStart = 23;
public static void applyMacro(ImageProcessor ip, String macro, boolean showProgress) { if (!macro.contains("=")) macro = "v="+macro; ImagePlus temp = WindowManager.getTempCurrentImage(); WindowManager.setTempCurrentImage(new ImagePlus("",ip)); int PCStart = 23;