Skip to content

Instantly share code, notes, and snippets.

@romainGuiet
Last active April 10, 2024 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romainGuiet/8b59a90ad87e7c6a1af26194a45cd181 to your computer and use it in GitHub Desktop.
Save romainGuiet/8b59a90ad87e7c6a1af26194a45cd181 to your computer and use it in GitHub Desktop.
groovy command equivalent to 'close("\\others")' in macro language. #BIOP #Groovy #Macro
// https://forum.image.sc/t/macro-function-close-others-in-groovy/44630
// Using ID as proposed by @imagejan
import ij.WindowManager
#@ ImagePlus imp
WindowManager.getIDList()
.findAll{ it != imp.getID() }
.each{ WindowManager.getImage(it).close() }
null // suppress result processing by SciJava
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment