Montage "Stack required" error in -batch or -macro calls

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Montage "Stack required" error in -batch or -macro calls

Mark J. Chopping
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
Reply | Threaded
Open this post in threaded view
|

Re: Montage "Stack required" error in -batch or -macro calls

Mark J. Chopping
p.s. the files to be mosaiced are sequentially numbered _0000.tif, _0001.tif, _0002.tif, and so on (although this is not the problem: the code works when run via a macro run using Run on the Macro menu).

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Montage "Stack required" error in -batch or -macro calls

Mark J. Chopping
In reply to this post by Mark J. Chopping
It was a dumb coding error -- my apologies. I am getting a java.lang.NegativeArraySizeException from -batch when the macro is called from a script with -batch but that's a separate issue.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html