Last active
January 21, 2021 13:04
-
-
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
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
// 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