public static void setImageJMenuBar(ImageWindow win) { ImageJ ij = IJ.getInstance(); boolean setMenuBar = true; ImagePlus imp = win.getImagePlus(); if (imp!=null) setMenuBar = imp.setIJMenuBar(); MenuBar mb = Menus.getMenuBar(); if (mb!=null && mb==win.getMenuBar()) setMenuBar = false; setMenuBarTime = 0L; if (setMenuBar && ij!=null && !ij.quitting() && !Interpreter.nonBatchMacroRunning()) { IJ.wait(10); // may be needed for Java 1.4 on OS X long t0 = System.currentTimeMillis(); win.setMenuBar(mb); long time = System.currentTimeMillis()-t0; setMenuBarTime = time; Menus.setMenuBarCount++; if (IJ.debugMode) IJ.log("setMenuBar: "+time+"ms ("+Menus.setMenuBarCount+")"); if (time>2000L) Prefs.setIJMenuBar = false; } if (imp!=null) imp.setIJMenuBar(true); }
public static void setImageJMenuBar(ImageWindow win) { ImageJ ij = IJ.getInstance(); boolean setMenuBar = true; ImagePlus imp = win.getImagePlus(); if (imp!=null) setMenuBar = imp.setIJMenuBar(); MenuBar mb = Menus.getMenuBar(); if (mb!=null && mb==win.getMenuBar()) setMenuBar = false; setMenuBarTime = 0L; if (setMenuBar && ij!=null && !ij.quitting() && !Interpreter.nonBatchMacroRunning()) { IJ.wait(10); // may be needed for Java 1.4 on OS X long t0 = System.currentTimeMillis(); win.setMenuBar(mb); long time = System.currentTimeMillis()-t0; setMenuBarTime = time; Menus.setMenuBarCount++; if (IJ.debugMode) IJ.log("setMenuBar: "+time+"ms ("+Menus.setMenuBarCount+")"); if (time>2000L) Prefs.setIJMenuBar = false; } if (imp!=null) imp.setIJMenuBar(true); }
private void calibrate() { String unit=cal.getUnit(); double o_depth=cal.pixelDepth; double o_height=cal.pixelHeight; double o_width=cal.pixelWidth; cal_yz.setUnit(unit); if (rotateYZ) { cal_yz.pixelHeight=o_depth/az; cal_yz.pixelWidth=o_height; } else { cal_yz.pixelWidth=o_depth/az; cal_yz.pixelHeight=o_height; } if (flipXZ) cal_yz.setInvertY(true); yz_image.setCalibration(cal_yz); yz_image.setIJMenuBar(false); cal_xz.setUnit(unit); cal_xz.pixelWidth=o_width; cal_xz.pixelHeight=o_depth/az; if (flipXZ) cal_xz.setInvertY(true); xz_image.setCalibration(cal_xz); xz_image.setIJMenuBar(false); }
private void calibrate() { String unit=cal.getUnit(); double o_depth=cal.pixelDepth; double o_height=cal.pixelHeight; double o_width=cal.pixelWidth; cal_yz.setUnit(unit); if (rotateYZ) { cal_yz.pixelHeight=o_depth/az; cal_yz.pixelWidth=o_height; } else { cal_yz.pixelWidth=o_depth/az; cal_yz.pixelHeight=o_height; } if (flipXZ) cal_yz.setInvertY(true); yz_image.setCalibration(cal_yz); yz_image.setIJMenuBar(false); cal_xz.setUnit(unit); cal_xz.pixelWidth=o_width; cal_xz.pixelHeight=o_depth/az; if (flipXZ) cal_xz.setInvertY(true); xz_image.setCalibration(cal_xz); xz_image.setIJMenuBar(false); }
y += YOFFSET; ImagePlus imp = win.getImagePlus(); if (imp!=null) imp.setIJMenuBar(i==wList.length-1);
y += YOFFSET; ImagePlus imp = win.getImagePlus(); if (imp!=null) imp.setIJMenuBar(i==wList.length-1);
ImagePlus imp = IJ.openImage(path+names[k]); if (imp!=null) { imp.setIJMenuBar(k==names.length-1); imp.show();
ImagePlus imp = IJ.openImage(path+names[k]); if (imp!=null) { imp.setIJMenuBar(k==names.length-1); imp.show();
public void run(String arg) { ImagePlus imp = IJ.getImage(); if (imp.isComposite()) { int z = imp.getSlice(); int t = imp.getFrame(); ImagePlus[] channels = split(imp); imp.changes = false; imp.setIgnoreFlush(true); imp.close(); for (int i=0; i<channels.length; i++) { channels[i].setIJMenuBar(i==channels.length-1); channels[i].show(); if (z>1 || t>1) channels[i].setPosition(1, z, t); } } else if (imp.getType()==ImagePlus.COLOR_RGB) splitRGB(imp); else IJ.error("Split Channels", "Multichannel image required"); }
public void run(String arg) { ImagePlus imp = IJ.getImage(); if (imp.isComposite()) { int z = imp.getSlice(); int t = imp.getFrame(); ImagePlus[] channels = split(imp); imp.changes = false; imp.setIgnoreFlush(true); imp.close(); for (int i=0; i<channels.length; i++) { channels[i].setIJMenuBar(i==channels.length-1); channels[i].show(); if (z>1 || t>1) channels[i].setPosition(1, z, t); } } else if (imp.getType()==ImagePlus.COLOR_RGB) splitRGB(imp); else IJ.error("Split Channels", "Multichannel image required"); }
private void splitRGB(ImagePlus imp) { boolean keepSource = IJ.altKeyDown(); String title = imp.getTitle(); Calibration cal = imp.getCalibration(); int pos = imp.getCurrentSlice(); ImageStack[] channels = splitRGB(imp.getStack(), keepSource); if (!keepSource) {imp.unlock(); imp.changes=false; imp.close();} ImagePlus rImp = new ImagePlus(title+" (red)", channels[0]); rImp.setCalibration(cal); rImp.setIJMenuBar(false); rImp.show(); rImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus gImp = new ImagePlus(title+" (green)", channels[1]); gImp.setCalibration(cal); gImp.setIJMenuBar(false); gImp.show(); gImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus bImp = new ImagePlus(title+" (blue)", channels[2]); bImp.setCalibration(cal); bImp.show(); bImp.setSlice(pos); }
private void splitRGB(ImagePlus imp) { boolean keepSource = IJ.altKeyDown(); String title = imp.getTitle(); Calibration cal = imp.getCalibration(); int pos = imp.getCurrentSlice(); ImageStack[] channels = splitRGB(imp.getStack(), keepSource); if (!keepSource) {imp.unlock(); imp.changes=false; imp.close();} ImagePlus rImp = new ImagePlus(title+" (red)", channels[0]); rImp.setCalibration(cal); rImp.setIJMenuBar(false); rImp.show(); rImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus gImp = new ImagePlus(title+" (green)", channels[1]); gImp.setCalibration(cal); gImp.setIJMenuBar(false); gImp.show(); gImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus bImp = new ImagePlus(title+" (blue)", channels[2]); bImp.setCalibration(cal); bImp.show(); bImp.setSlice(pos); }
win.toFront(); ImagePlus imp = win.getImagePlus(); if (imp!=null) imp.setIJMenuBar(i==nPics-1);
win.toFront(); ImagePlus imp = win.getImagePlus(); if (imp!=null) imp.setIJMenuBar(i==nPics-1);
if (info!=null && !info.equals(label)) imp2.setProperty("Info", info); imp2.setIJMenuBar(i==size); if (overlay!=null) { Overlay overlay2 = new Overlay();
if (info!=null && !info.equals(label)) imp2.setProperty("Info", info); imp2.setIJMenuBar(i==size); if (overlay!=null) { Overlay overlay2 = new Overlay();