Skip to content

Instantly share code, notes, and snippets.

@lacan
Last active January 21, 2021 13:04
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 lacan/333d4d471f8736687017e8ae006ab201 to your computer and use it in GitHub Desktop.
Save lacan/333d4d471f8736687017e8ae006ab201 to your computer and use it in GitHub Desktop.
[MultiStackMonage in a script] This script will use MultiStackMontage to create a montage for all open images in Fiji #Fiji #groovy #biop
// Makes a montage with the selected settings from all open images
// By Olivier Burri, EPFL - SV - BIOP
// For Matjaz Panjan, Jožef Stefan Institute
// This needs the StackMontage plugin, which is available from the PTBIOP update site
def nRows = 2
def nCols = 1
// SCRIPT START
// Pick up all the currently open image names
def imageIDs = WindowManager.getIDList() as List
// Get a list of the actual images
def allImages = imageIDs.collect{
def image = WindowManager.getImage( it )
if ( image.getType() == ImagePlus.COLOR_256 ) new ImageConverter(image).convertToRGB()
return image
}
def montage = StackMontage.montageImages( allImages, nRows, nCols);
montage.show()
// Imports
import ch.epfl.biop.montage.StackMontage
import ij.WindowManager
import ij.process.ImageConverter
import ij.ImagePlus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment