MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getImage

Method getImage

ij/src/main/java/ij/WindowManager.java:249–270  ·  view source on GitHub ↗

For IDs less than zero, returns the ImagePlus with the specified ID. Returns null if no open window has a matching ID or no images are open. For IDs greater than zero, returns the Nth ImagePlus. Returns null if the ID is zero.

(int imageID)

Source from the content-addressed store, hash-verified

247 For IDs greater than zero, returns the Nth ImagePlus. Returns null if
248 the ID is zero. */
249 public synchronized static ImagePlus getImage(int imageID) {
250 if (imageID>0)
251 imageID = getNthImageID(imageID);
252 if (imageID==0 || getImageCount()==0)
253 return null;
254 ImagePlus imp2 = Interpreter.getBatchModeImage(imageID);
255 if (imp2!=null)
256 return imp2;
257 ImagePlus imp = null;
258 for (int i=0; i<imageList.size(); i++) {
259 ImageWindow win = (ImageWindow)imageList.get(i);
260 imp2 = win.getImagePlus();
261 if (imageID==imp2.getID()) {
262 imp = imp2;
263 break;
264 }
265 }
266 imp2 = getCurrentImage();
267 if (imp==null &&imp2!=null && imp2.getID()==imageID)
268 return imp2;
269 return imp;
270 }
271
272 /** Returns the ID of the Nth open image. Returns zero if n<=0
273 or n greater than the number of open image windows. */

Callers 15

selectWindowMethod · 0.95
runMethod · 0.95
getImageTitlesMethod · 0.95
getImageWindowMethod · 0.95
activateWindowMethod · 0.95
repaintImageWindowsMethod · 0.95
updatePlotMethod · 0.95
fromPlotMethod · 0.95
isOpenMethod · 0.95
selectImageMethod · 0.95
closeMethod · 0.95

Calls 11

getNthImageIDMethod · 0.95
getImageCountMethod · 0.95
getBatchModeImageMethod · 0.95
getImagePlusMethod · 0.95
getIDMethod · 0.95
getCurrentImageMethod · 0.95
getIDListMethod · 0.95
getTitleMethod · 0.95
sizeMethod · 0.45
getMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected