Login  Register

Re: Montage java.lang.NegativeArraySizeException

Posted by Mark J. Chopping on Aug 31, 2015; 10:11pm
URL: http://imagej.273.s1.nabble.com/Montage-java-lang-NegativeArraySizeException-tp5014201p5014206.html

Hi John,

Thanks. The values are hardcoded but since I'm increasingly good at making blunders, I get the macro to print stuff to stdout for debugging, so with

xvfb-run-safe ~/ImageJ/jre/bin/java -Xmx4096m -jar ~/ImageJ/ij.jar -ijpath ~/ImageJ -batch MosaicEm.ijm path:base > MLOG &

I can look at MLOG (names have been changed to protect the innocent):

$ more MLOG
path      =/correct/path/to/directories/
base      =g_WV01_12AUG080532155-P1BS-102001001CE43800_orth
log        =/correct/place/with/logs/g_WV01_12AUG080532155-P1BS-102001001CE43800_orth.log
tdi         =/correct/place/with/tdi/g_WV01_12AUG080532155-P1BS-102001001CE43800_orth.tdi
outDir    =/correct/path/to/the/TIFFDIR/
sampleTIFF=/correct/path/to/the/TIFFDIR/_Crowns/Crown_Filled_0000.tif
WSize:  800
srcCols  =43176
srcRows  =32636
xLocs     :  53
yLocs     :  40
NumSlices :  40
numfiles  :  2120
Mosaicing the 2120 (53 x 40) images...
Image Sequence run; doing Make Montage...
java.lang.NegativeArraySizeException

The macro code is:

  print("Mosaicing the "+numfiles+" ("+xLocations+" x "+ NumSlices +") images...");
  run("Image Sequence...", "open="+sampleTIFF+" number="+numfiles+" starting=1 increment=1 scale=100 file=.tif sort use");
  print("Image Sequence run; doing Make Montage...");
  run("Make Montage...", "columns="+xLocations+" rows="+ NumSlices +" scale=1 first=1 last="+numfiles+" increment=1 border=0");
  saveAs("Tiff", outDir+"CAN_"+base+".tif");

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