NullPointerException when running the Grid/Collection Stitcher

Hi all,

I’ve been running a macro in FIJI for batch stitching .tif files in multiple folders using the Grid/Collection Stitcher tool. However, randomly after a few minutes, the program gives a Null Pointer Exception and halts. I am unsure what the issue could be…

(Fiji Is Just) ImageJ 2.0.0-rc-69/1.52p; Java 1.8.0_172 [64-bit]; Linux 4.19.94-300.el7.x86_64; 634MB of 6000MB (10%)

java.lang.NullPointerException
at javax.swing.RepaintManager.getVolatileOffscreenBuffer(RepaintManager.java:1030)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1489)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:306)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
at javax.swing.JComponent.paintImmediately(JComponent.java:4981)
at sun.awt.X11.XTextAreaPeer$AWTTextArea.repaintNow(XTextAreaPeer.java:964)
at sun.awt.X11.XTextAreaPeer.repaintText(XTextAreaPeer.java:262)
at sun.awt.X11.XTextAreaPeer.setText(XTextAreaPeer.java:458)
at java.awt.TextComponent.setText(TextComponent.java:237)
at ij.macro.Functions.handleEditorCommand(Functions.java:3542)
at ij.macro.Functions.printToWindow(Functions.java:3524)
at ij.macro.Functions.print(Functions.java:3480)
at ij.macro.Functions.doFunction(Functions.java:103)
at ij.macro.Interpreter.doStatement(Interpreter.java:275)
at ij.macro.Interpreter.doBlock(Interpreter.java:671)
at ij.macro.Interpreter.doStatement(Interpreter.java:320)
at ij.macro.Interpreter.doIf(Interpreter.java:1049)
at ij.macro.Interpreter.doStatement(Interpreter.java:296)
at ij.macro.Interpreter.doBlock(Interpreter.java:671)
at ij.macro.Interpreter.doStatement(Interpreter.java:320)
at ij.macro.Interpreter.doFor(Interpreter.java:593)
at ij.macro.Interpreter.doStatement(Interpreter.java:302)
at ij.macro.Interpreter.doBlock(Interpreter.java:671)
at ij.macro.Interpreter.doStatement(Interpreter.java:320)
at ij.macro.Interpreter.doFor(Interpreter.java:593)
at ij.macro.Interpreter.doStatement(Interpreter.java:302)
at ij.macro.Interpreter.doStatements(Interpreter.java:261)
at ij.macro.Interpreter.run(Interpreter.java:157)
at ij.macro.Interpreter.run(Interpreter.java:91)
at ij.macro.Interpreter.run(Interpreter.java:102)
at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
at ij.IJ.runMacro(IJ.java:148)
at ij.IJ.runMacro(IJ.java:137)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1108)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1104)
at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1055)
at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1104)
at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:147)
at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:228)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

The macro itself is actually a fairly basic one, looping over different folders with files and executing the run(“Grid/Collection stitching”, “type=[Positions from file] order=[Defined by TileConfiguration] directory=[”+folder3+"] layout_file=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=0 absolute_displacement_threshold=0 subpixel_accuracy computation_parameters=[Save memory (but be slower)] image_output=[Fuse and display]");
command, after which it saves the resulting image to a new folder.

Any help would be very much appreciated!