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

Method getNthImageID

ij/src/main/java/ij/WindowManager.java:274–290  ·  view source on GitHub ↗

Returns the ID of the Nth open image. Returns zero if n<=0 or n greater than the number of open image windows.

(int n)

Source from the content-addressed store, hash-verified

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. */
274 public synchronized static int getNthImageID(int n) {
275 if (n<=0) return 0;
276 if (Interpreter.isBatchMode()) {
277 int[] list = getIDList();
278 if (n>list.length)
279 return 0;
280 else
281 return list[n-1];
282 } else {
283 if (n>imageList.size()) return 0;
284 ImageWindow win = (ImageWindow)imageList.get(n-1);
285 if (win!=null)
286 return win.getImagePlus().getID();
287 else
288 return 0;
289 }
290 }
291
292
293 /** Returns the first image that has the specified title or null if it is not found. */

Callers 2

selectWindowMethod · 0.95
getImageMethod · 0.95

Calls 6

isBatchModeMethod · 0.95
getIDListMethod · 0.95
getImagePlusMethod · 0.95
getIDMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected