I get a "Montage: Stack required" error in -batch or -macro job when calling Montage in a macro like this:
~/ImageJ/jre/bin/java -Xmx5120m -jar ~/ImageJ/ij.jar -ijpath ~/ImageJ -macro mosaicjob.ijm $path:basename
All required data (paths, filenames etc.) are parsed from various files accessed via the passed arguments. The macro code has:
run("Image Sequence...", "open="+sampleTIFF+" number="+numfiles+" starting=1 increment=1 scale=100 file=Crown_Filled_ sort use");
run("Make Montage...", "columns="+xLocations+" rows="+ NumSlices +" scale=1 first=1 last="+numfiles+" increment=1 border=0");
saveAs("Tiff", outDir+"unique_name+".tif");
where:
run("Image Sequence...) uses the Virtual Stack facility
sampleTIFF is the path to a TIFF that montage needs as an example
xLocations / yLocations are the number of image windows in X and Y
NumSlices is the number of virtual stack slices to be processed [ = floor(srcRows_in_pixels / imagechip_size_in_pixels); ]
numfiles = NumSlices * xLocations;
The same code works fine in an interactive version of the macro that is run from ImageJ's menu.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html