public void imageUpdated(ImagePlus imp) { if (imp.getID()==imageID) imageUpdated = true; }
/** Returns the ID of the image associated with this ROI. */ public int getImageID() { return imp!=null?imp.getID():imageID; }
/** * Gets the ID of the given {@link ImagePlus} object. If the given object is * not an {@link ImagePlus}, throws {@link IllegalArgumentException}. * * @param o The {@link ImagePlus} whose ID is needed. * @return The value of {@link ImagePlus#getID()}. * @see #isImagePlus(Object) * @throws ClassCastException if the given object is not an {@link ImagePlus}. */ public int getImageID(final Object o) { return ((ImagePlus) o).getID(); }
public void imageUpdated(ImagePlus imp) { if (imp.getID()==previousImageID && Thread.currentThread()!=thread) imageWasUpdated = true; }
public void imageUpdated(ImagePlus imp) { if (imp.getID()==previousImageID && Thread.currentThread()!=thread) imageWasUpdated = true; }
public static int[] getBatchModeImageIDs() { if (!batchMode || imageTable==null) return new int[0]; int n = imageTable.size(); int[] imageIDs = new int[n]; for (int i=0; i<n; i++) { ImagePlus imp = (ImagePlus)imageTable.get(i); imageIDs[i] = imp.getID(); } return imageIDs; }
public static int[] getBatchModeImageIDs() { if (!batchMode || imageTable==null) return new int[0]; int n = imageTable.size(); int[] imageIDs = new int[n]; for (int i=0; i<n; i++) { ImagePlus imp = (ImagePlus)imageTable.get(i); imageIDs[i] = imp.getID(); } return imageIDs; }
public static ImagePlus getBatchModeImage(int id) { if (!batchMode || imageTable==null) return null; for (Enumeration en=Interpreter.imageTable.elements(); en.hasMoreElements();) { ImagePlus imp = (ImagePlus)en.nextElement(); if (id==imp.getID()) return imp; } return null; }
public static ImagePlus getBatchModeImage(int id) { if (!batchMode || imageTable==null) return null; for (Enumeration en=Interpreter.imageTable.elements(); en.hasMoreElements();) { ImagePlus imp = (ImagePlus)en.nextElement(); if (id==imp.getID()) return imp; } return null; }
private boolean synced(ImageWindow source) { if (source==null || vwins==null) return false; ImagePlus imp = source.getImagePlus(); if (imp==null) return false; return vwins.contains(new Integer(imp.getID())); }
public static int getImageID() { ImagePlus img = getImage(); return img!=null?img.getID():0; }
double isActive() { int id = (int)getArg(); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getID()!=id) return 0.0; //false else return 1.0; //true }
/** Set the "Redirect To" image. Pass 'null' as the argument to disable redirected sampling. */ public static void setRedirectImage(ImagePlus imp) { if (imp==null) { redirectTarget = 0; redirectTitle = null; redirectImage = null; } else { redirectTarget = imp.getID(); redirectTitle = imp.getTitle(); if (imp.getWindow()==null) redirectImage = imp; } }
public static void showList() { for (int i=0; i<imageList.size(); i++) { ImageWindow win = (ImageWindow)imageList.get(i); ImagePlus imp = win.getImagePlus(); IJ.log(i + " " + imp.getTitle() + (win==currentWindow?"*":"")+" "+imp.getID()); } for (int i=0; i<activations.size(); i++) { ImageWindow win = (ImageWindow)activations.get(i); ImagePlus imp = win.getImagePlus(); IJ.log(i + " " + imp.getTitle() + " " + imp.getID()); } if (imageList.size()==0) IJ.log("imageList is empty"); if (activations.size()==0) IJ.log("activations list is empty"); IJ.log(" "); }
double showPlot() { if (plot!=null) { PlotWindow plotWindow = plot.show(); if (plotWindow!=null) plotID = plotWindow.getImagePlus().getID(); } plot = null; interp.getParens(); return Double.NaN; }
ImageProcessor setup(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi!=null) roi.endPaste(); ImageProcessor ip = imp.getProcessor(); int type = imp.getType(); int slice = imp.getCurrentSlice(); RGBImage = type==ImagePlus.COLOR_RGB; if (imp.getID()!=previousImageID || type!=previousType || slice!=previousSlice) setupNewImage(imp, ip); previousImageID = imp.getID(); previousType = type; previousSlice = slice; return ip; }
public String toString() { return "img[\""+getTitle()+"\" ("+getID()+"), "+getBitDepth()+"-bit, "+width+"x"+height+"x"+getNChannels()+"x"+getNSlices()+"x"+getNFrames()+"]"; }
/** Adds one image to the end of the Window menu. */ static synchronized void addWindowMenuItem(ImagePlus imp) { if (ij==null) return; String name = imp.getTitle(); String size = ImageWindow.getImageSize(imp); CheckboxMenuItem item = new CheckboxMenuItem(name+" "+size); item.setActionCommand("" + imp.getID()); window.add(item); item.addItemListener(ij); }
/** Adds one image to the end of the Window menu. */ static synchronized void addWindowMenuItem(ImagePlus imp) { if (ij==null) return; String name = imp.getTitle(); String size = ImageWindow.getImageSize(imp); CheckboxMenuItem item = new CheckboxMenuItem(name+" "+size); item.setActionCommand("" + imp.getID()); window.add(item); item.addItemListener(ij); }
public void windowActivated(WindowEvent e) { super.windowActivated(e); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { if (imageID!=0 && imp.getID()!=imageID) { showAll(SHOW_NONE); if (okToSet()) showAllCheckbox.setState(false); deselect(); imageID = 0; } } }