public int[] getIDList() { return WindowManager.getIDList(); }
/** 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 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 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; }
protected void handleImages(boolean addAsListener) { int[] ids = WindowManager.getIDList(); if (ids != null) for (int id : ids) handleImage(WindowManager.getImage(id), addAsListener); }
/** 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 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; }
public static void register(SliceListener listener) { int[] ids = WindowManager.getIDList(); if (ids != null) for (int id : ids) new SliceObserver(WindowManager.getImage(id), listener); }
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; }
/** * Gives the list of the open images in the ImageJ instance. * * @return List of open images */ public static String[] getListImages() { int[] is = WindowManager.getIDList(); String[] strings = new String[is.length]; for (int i = 0; i < is.length; i++) { ImagePlus imageplus = WindowManager.getImage(is[i]); strings[i] = imageplus.getTitle(); } return strings; }
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 void run(String arg) { if (arg.equals("imagej")) {showImageJ(); return;} int[] wList = WindowManager.getIDList(); if (arg.equals("show")) {showAll(wList); return;} if (wList==null) { IJ.noImage(); return; } if (arg.equals("tile")) tileWindows(wList); else cascadeWindows(wList); }
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(); } }
public void addImageChoice(String label, String defaultImage) { if (windowTitles == null) { windowIDs = WindowManager.getIDList(); if (windowIDs == null) windowIDs = new int[0]; windowTitles = new String[windowIDs.length]; for (int i = 0; i < windowIDs.length; i++) { ImagePlus image = WindowManager.getImage(windowIDs[i]); windowTitles[i] = image == null ? "" : image.getTitle(); } } addChoice(label, windowTitles, defaultImage); }
private static CustomStackWindow getInstance() { if(cached != null) return cached; // check if there's an existing SegmentationEditor int[] ids = WindowManager.getIDList(); for(int id : ids) { ImageWindow iw = WindowManager.getImage(id).getWindow(); if(iw instanceof CustomStackWindow) return (CustomStackWindow)iw; } newSegmentationEditor(); return cached; }
/** Repaints all open image windows. */ public synchronized static void repaintImageWindows() { int[] list = getIDList(); if (list==null) return; for (int i=0; i<list.length; i++) { ImagePlus imp2 = getImage(list[i]); if (imp2!=null) { imp2.setTitle(imp2.getTitle()); // update "(G)" flag (global calibration) ImageWindow win = imp2.getWindow(); if (win!=null) win.repaint(); } } }
@Override public List<ImageDisplay> getImageDisplays() { // Register all ImagePlus instances. This will generate ensure no // ImagePluses are missed by the standard getImageDisplays. final int[] idList = WindowManager.getIDList(); if (idList != null) { for (final int id : idList) { final ImagePlus imp = WindowManager.getImage(id); getImageMap().registerLegacyImage(imp); } } return imageDisplayService().getImageDisplays(); }
/** Repaints all open image windows. */ public synchronized static void repaintImageWindows() { int[] list = getIDList(); if (list==null) return; for (int i=0; i<list.length; i++) { ImagePlus imp2 = getImage(list[i]); if (imp2!=null) { imp2.setTitle(imp2.getTitle()); // update "(G)" flag (global calibration) ImageWindow win = imp2.getWindow(); if (win!=null) win.repaint(); } } }
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); }