Bio-Formats 6.0.0-rc1 throwing NullPointerException exporting to ICS/IDS

Dear OME / Bio-Formats devs,

trying to export an image from an up-to-date Fiji with the Bio-Formats update site enabled throws a NullPointerException when using ICS/IDS as a format (or specifying the .ids suffix in a macro call):

[Tue Feb 12 16:06:24 CET 2019] [ERROR] Module threw exception
java.lang.NullPointerException
	at loci.formats.out.ICSWriter.setId(ICSWriter.java:263)
	at loci.formats.FormatWriter.changeOutputFile(FormatWriter.java:122)
	at loci.plugins.out.Exporter.run(Exporter.java:806)
	at loci.plugins.LociExporter.run(LociExporter.java:75)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
	at ij.IJ.runUserPlugIn(IJ.java:230)
	at ij.IJ.runPlugIn(IJ.java:192)
	at ij.IJ.runPlugIn(IJ.java:181)
	at net.imagej.legacy.command.LegacyCommand.run(LegacyCommand.java:59)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	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$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Here’s a short macro that is reproducing the issue for me (make sure the output file does not exist yet!):

run("Blobs (25K)");
run("Bio-Formats Exporter", "save=[/tmp/foo.ids] compression=Uncompressed");

Tried on Linux (Ubuntu 18.10) as well as on Windows 7, both the same.

Any ideas?

Thanks for looking into this!

~Niko

2 Likes

Hi Niko,

I tested with a few files locally and was able to reproduce the problem. It is being caused when trying to write the physical dimension sizes. When they are present the export completes without issue but when the sizes are missing it throws the exception you see. I have opened a Trello card on the Bio-Formats inbox to address the problem: https://trello.com/c/OG2iQY7q/329-ics-writer-npe-when-no-physical-size

2 Likes

Thanks for looking into this, David!

See also:

1 Like

Cross-referencing here, a Pull Request has been opened to fix this ICS writing issue and should be included in the upcoming patch release of Bio-Formats.

1 Like

Thanks for the update, Sébastien !