Last active
August 9, 2024 11:19
-
-
Save romainGuiet/8b59a90ad87e7c6a1af26194a45cd181 to your computer and use it in GitHub Desktop.
groovy command equivalent to 'close("\\others")' in macro language. #BIOP #Groovy #Macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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