Problem in image fusion BigStitcher headless imageJ

I am having difficulty running BigStitcher in headless mode. Its failing with an exception when trying to fuse the image to tiff. in “Fuse dataset” step. I am using linux version of ImageJ with following macro Any suggestion is highly appreciated

Code:

run("Define dataset ...", "define_dataset=[Automatic Loader (Bioformats based)] project_filename=dataset.xml path="+basePath + file_pattern+" exclude=10 bioformats_series_are?=Tiles move_tiles_to_grid_(per_angle)?=[Move Tile to Grid (Macro-scriptable)] grid_type=["+grid_type+"] tiles_x="+tilesX+" tiles_y="+tilesY+" tiles_z="+tiles_z+" overlap_x_(%)="+overlap_x+" overlap_y_(%)="+overlap_y+" overlap_z_(%)="+overlap_z+" keep_metadata_rotation how_to_load_images=[Re-save as multiresolution HDF5] dataset_save_path="+basePath+" check_stack_sizes subsampling_factors=[{ {1,1,1}, {2,2,1} }] hdf5_chunk_sizes=[{ {32,32,4}, {32,32,4} }] timepoints_per_partition=1 setups_per_partition=0 use_deflate_compression export_path="+basePath+"dataset");



// calculate pairwise shifts
run("Calculate pairwise shifts ...",
    " select="+basePath+"dataset.xml process_angle=[All angles] process_channel=[All channels]" +
    " process_illumination=[All illuminations] process_tile=[All tiles] process_timepoint=[All Timepoints]" +
    " method=["+method+"] channels=[Average Channels] downsample_in_x=2 downsample_in_y=2 downsample_in_z=2");
 

// filter shifts with 0.7 corr. threshold
run("Filter pairwise shifts ...","select="+basePath+"dataset.xml filter_by_link_quality min_r=0.7 max_r=1 max_shift_in_x=0 max_shift_in_y=0 max_shift_in_z=0 max_displacement=0");
 
// do global optimization
run("Optimize globally and apply shifts ...","select="+basePath+"dataset.xml process_angle=[All angles] process_channel=[All channels] " +
    " process_illumination=[All illuminations] process_tile=[All tiles] process_timepoint=[All Timepoints]" +
    " relative=2.500 absolute=3.500 global_optimization_strategy=" +
    " [Two-Round using Metadata to align unconnected Tiles] fix_group_0-0,");
 
// fuse dataset, save as TIFF



run("Fuse dataset ...",
    " select="+basePath+"dataset.xml process_angle=[All angles] process_channel=[All channels] " +
    " process_illumination=[All illuminations] process_tile=[All tiles] process_timepoint=[All Timepoints]" +
    " bounding_box=[All Views] downsampling="+downsampling+" pixel_type=[16-bit unsigned integer] interpolation=[Linear Interpolation]" +
    " image=[Precompute Image] blend produce=[Each timepoint & channel] fused_image=[Save as (compressed) TIFF stacks] " +
    " output_file_directory=/tmp/out/");

Exception:

getDescription()
java.lang.NullPointerException
	at net.preibisch.mvrecon.fiji.plugin.fusion.FusionGUI.queryDetails(FusionGUI.java:218)
	at net.preibisch.mvrecon.fiji.plugin.Image_Fusion.fuse(Image_Fusion.java:98)
	at net.preibisch.mvrecon.fiji.plugin.Image_Fusion.run(Image_Fusion.java:89)
	at ij.IJ.runUserPlugIn(IJ.java:230)
	at ij.IJ.runPlugIn(IJ.java:193)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at ij.IJ.run(IJ.java:312)
	at ij.IJ.run(IJ.java:323)
	at ij.macro.Functions.doRun(Functions.java:624)
	at ij.macro.Functions.doFunction(Functions.java:97)
	at ij.macro.Interpreter.doStatement(Interpreter.java:275)
	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.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:145)
	at ij.IJ.runMacroFile(IJ.java:160)
	at net.imagej.legacy.IJ1Helper$4.call(IJ1Helper.java:1125)
	at net.imagej.legacy.IJ1Helper$4.call(IJ1Helper.java:1121)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1055)
	at net.imagej.legacy.IJ1Helper.runMacroFile(IJ1Helper.java:1121)
	at net.imagej.legacy.LegacyCommandline$Macro.handle(LegacyCommandline.java:187)
	at org.scijava.console.DefaultConsoleService.processArgs(DefaultConsoleService.java:102)
	at org.scijava.AbstractGateway.launch(AbstractGateway.java:97)
	at net.imagej.Main.main(Main.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)

Hi @salam03,

Sorry I took so long, but I actually ran into the same problem at some point. Looks like we try to (needlessly) access UI elements, even in headless mode.

It should be fixed with https://github.com/PreibischLab/multiview-reconstruction/commit/872f1f0ebc1a434ddc31d045c9b0983ef3ab8cc9 and will be included in the next update of BigStitcher.

Best,
David