/** Get ImagePlus from Windows-Vector vwins. */ public ImagePlus getImageFromVector(int n) { if (vwins == null || n<0 || vwins.size() < n+1) return null; ImagePlus imp; imp = WindowManager.getImage(((Integer)vwins.elementAt(n)).intValue()); return imp; }
ImageWindow getWindow(int id) { ImageWindow win = null; ImagePlus imp = WindowManager.getImage(id); if (imp!=null) win = imp.getWindow(); return win; }
@Override public <T> T convert(final Object src, final Class<T> dest) { if (!legacyEnabled()) throw new UnsupportedOperationException(); if (!(src instanceof Double)) return null; final Double imageID = (Double) src; final ImagePlus imp = WindowManager.getImage(imageID.intValue()); @SuppressWarnings("unchecked") final T typedImp = (T) imp; return typedImp; }
ImageWindow getWindow(int id) { ImageWindow win = null; ImagePlus imp = WindowManager.getImage(id); if (imp!=null) win = imp.getWindow(); return win; }
/** Returns the first image that has the specified title or null if it is not found. */ public synchronized static ImagePlus getImage(String title) { int[] wList = getIDList(); if (wList==null) return null; for (int i=0; i<wList.length; i++) { ImagePlus imp = getImage(wList[i]); if (imp!=null && imp.getTitle().equals(title)) return imp; } return null; }
@Override public void populateInputCandidates(final Collection<Object> objects) { final int[] imageIDs = WindowManager.getIDList(); if (imageIDs == null) return; for (final int imageID : imageIDs) { final ImagePlus imp = WindowManager.getImage(imageID); if (imp != null) objects.add(new ImageTitle(imp)); } }
/** Returns the first image that has the specified title or null if it is not found. */ public synchronized static ImagePlus getImage(String title) { int[] wList = getIDList(); if (wList==null) return null; for (int i=0; i<wList.length; i++) { ImagePlus imp = getImage(wList[i]); if (imp!=null && imp.getTitle().equals(title)) return imp; } return null; }
/** Returns a list of the titles of all open images. */ public synchronized static String[] getImageTitles() { int[] list = getIDList(); if (list==null) return new String[0]; String[] titles = new String[list.length]; for (int i=0; i<list.length; i++) { ImagePlus img = getImage(list[i]); titles[i] = img.getTitle(); } return titles; }
public static void register(SliceListener listener) { int[] ids = WindowManager.getIDList(); if (ids != null) for (int id : ids) new SliceObserver(WindowManager.getImage(id), listener); }
protected void handleImages(boolean addAsListener) { int[] ids = WindowManager.getIDList(); if (ids != null) for (int id : ids) handleImage(WindowManager.getImage(id), addAsListener); }
private String[] openImages() { int[] ids = WindowManager.getIDList(); String[] titles = new String[ids.length - 1]; for(int i = 0, c = 0; i < ids.length; i++) { int id = ids[i]; ImagePlus im = WindowManager.getImage(id); if(im != this.image) titles[c++] = im.getTitle(); } return titles; }
/** Returns a list of the titles of all open images. */ public synchronized static String[] getImageTitles() { int[] list = getIDList(); if (list==null) return new String[0]; String[] titles = new String[list.length]; for (int i=0; i<list.length; i++) { ImagePlus img = getImage(list[i]); titles[i] = img.getTitle(); } return titles; }
private static Frame getImageWindow(String title) { int[] wList = getIDList(); int len = wList!=null?wList.length:0; for (int i=0; i<len; i++) { ImagePlus imp = getImage(wList[i]); if (imp!=null) { if (imp.getTitle().equals(title)) return imp.getWindow(); } } return null; }
public static void closeAllWithoutConfirmation() { int[] wList = WindowManager.getIDList(); if (wList==null) { return; } for (int i=0; i<wList.length; i++) { ImagePlus imp = WindowManager.getImage(wList[i]); imp.changes=false; imp.getWindow().close(); } }
private void load(int n) { ImagePlus image = WindowManager .getImage("Displacement_dim" + n); if(image == null) return; for(int z = 0; z < d; z++) { u[n][z] = (float[])image.getStack() .getProcessor(z+1).getPixels(); } }
protected void registerTool() { int[] ids = WindowManager.getIDList(); if (ids != null) for (int id : ids) registerTool(WindowManager.getImage(id)); if (toolbarMouseListener != null) toolbar.addMouseListener(toolbarMouseListener); ImagePlus.addImageListener(this); IJ.getInstance().addWindowFocusListener(this); }
double isOpen() { interp.getLeftParen(); if (isStringArg()) { String title = getString(); interp.getRightParen(); return isOpen(title)?1.0:0.0; } else { int id = (int)interp.getExpression(); interp.getRightParen(); return WindowManager.getImage(id)==null?0.0:1.0; } }
public static void addVolume(final String image, final String c, final String name, final String r, final String g, final String b, final String resamplingF) { final Image3DUniverse univ = getUniv(); final ImagePlus grey = WindowManager.getImage(image); final Color3f color = ColorTable.getColor(c); final int factor = getInt(resamplingF); final boolean[] channels = new boolean[] { getBoolean(r), getBoolean(g), getBoolean(b) }; univ.addVoltex(grey, color, name, 0, channels, factor); }
public static void addOrthoslice(final String image, final String c, final String name, final String r, final String g, final String b, final String resamplingF) { final Image3DUniverse univ = getUniv(); final ImagePlus grey = WindowManager.getImage(image); final Color3f color = ColorTable.getColor(c); final int factor = getInt(resamplingF); final boolean[] channels = new boolean[] { getBoolean(r), getBoolean(g), getBoolean(b) }; univ.addOrthoslice(grey, color, name, 0, channels, factor); }