Skip to content

Instantly share code, notes, and snippets.

@imagejan
Created April 19, 2018 12:42
Show Gist options
  • Save imagejan/53d106e1bfe5faba9f1d2ffe7feb2a2f to your computer and use it in GitHub Desktop.
Save imagejan/53d106e1bfe5faba9f1d2ffe7feb2a2f to your computer and use it in GitHub Desktop.
Small Groovy code snippets useful when working with ImagePlus and other IJ1 classes
import ij.WindowManager
/**
* Get all open images as list of {@code ImagePlus}
*/
def getImagesAsList() {
count = WindowManager.getImageCount()
return (1..count).collect { WindowManager.getImage(it) }
}
println getImagesAsList()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment