Page history Edit this page How do I edit this website?
Original MediaWiki page

Multi Stack Montage

The content of this page has not been vetted since shifting away from MediaWiki. If you’d like to help, check out the how to help guide!




on GitHub


This plugin brings a bit more functionality that was not available using the Make Montage… Plugin, namely making montages out of multiple stacks and hyperstacks.


This plugin is available from the PTBIOP Update Site This places it in a “BIOP” Folder in the plugins directory of Fiji/ImageJ


Call up the plugin using PluginsBIOPMulti Stack Montage… and select the stacks that you wish to use.


Interface of the plugin

If you are going to make a montage, you need each stack to be as follows:

  • Same number of Channels, Slices and Timepoints
  • Same Data Type (8-bit, 16-bit, 32-bit or RGB)

In the case that there would be many images open, the plugin does not pre-select any images.


Example on RGB Stacks. Also works on multichannel, multislice, timepoints and any combination

This plugin is useful when montaging multiple views or when montaging RGB datasets all in one go.

Macro Recordable

Making use of the GenericDialog class, the plugin is macro-recordable.

run("Multi Stack Montage...", "stack_1=Image1 stack_2=[Another Image] stack_3=Image3 rows=2 columns=2");

Running from a Plugin

What you need to run this in a plugin is

import ch.epfl.biop.StackMontage;

And then call the static method

ImagePlus montaged_image = StackMontage.montageImages(ArrayList<ImagePlus> theimages, int nrows, int ncols);

You can have a look at this minimal plugin that runs StackMontage.

import ij.*;
import ij.plugin.*;

// Required by StackMontage
import java.util.ArrayList;
import ch.epfl.biop.StackMontage;

 * Short example on making hyperstack montages
 * @author Romain Guiet, Olivier Burri
 * @version 1.0
public class My_Plugin implements PlugIn {

    public void run(String arg) {

        // Make some nice images
        ImagePlus imp = IJ.openImage("");
        String imageName = imp.getTitle();

        // Recolor them
        ImagePlus imp1 = new Duplicator().run(imp, 1, 2, 1, 25, 1, 1);, "Blue", "");
        ImagePlus imp2 = new Duplicator().run(imp1, 1, 2, 1, 25, 1, 1);
        imp2.setC(2);, "Magenta", "");
        ImagePlus imp3 = new Duplicator().run(imp2, 1, 2, 1, 25, 1, 1);
        imp3.setC(1);, "Cyan", "");
       , "RGB Color", "slices");, "RGB Color", "slices");, "RGB Color", "slices");, "RGB Color", "slices");

        // Montage Options
        int nrows = 2;
        int ncols = 2;
        // Prepare container for images
        ArrayList<ImagePlus> images = new ArrayList<ImagePlus>();
        // Add images to ArrayList for the montage

        // Make the montage
        ImagePlus impr = StackMontage.montageImages(images, nrows, ncols);
        // Show the result;



The Dialog is limited to 10 elements so as not to make a window potentially larger than the monitor’s vertical resolution. However, it is unlimited if calling it from the macro recorder.

You do not need to enter “*None*” as the last stack.