http://imagej.273.s1.nabble.com/Thresholder-in-headless-macro-mode-results-in-NullPointerException-tp5009940p5009968.html
This bug is fixed in the latest ImageJ daily build (1.49i13). The GenericDialog.getChoices() method call at line 74 in Thresholder.java returns null in headless mode.
> at ij.plugin.Thresholder.run(Thresholder.java:48)
> at ij.IJ.runPlugIn(IJ.java:172)
> at ij.Executer.runCommand(Executer.java:131)
> at ij.Executer.run(Executer.java:64)
> at ij.IJ.run(IJ.java:272)
> at ij.macro.Functions.doRun(Functions.java:591)
> at ij.macro.Functions.doFunction(Functions.java:89)
> at ij.macro.Interpreter.doStatement(Interpreter.java:227)
> at ij.macro.Interpreter.doStatements(Interpreter.java:215)
> at ij.macro.Interpreter.run(Interpreter.java:112)
> at ij.macro.Interpreter.run(Interpreter.java:82)
> at ij.macro.Interpreter.run(Interpreter.java:93)
> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153)
> at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:137)
> at ij.IJ.runMacroFile(IJ.java:133)
> at net.imagej.legacy.IJ1Helper.runMacroFile(IJ1Helper.java:802)
> at
> net.imagej.legacy.LegacyCommandline$Macro.handle(LegacyCommandline.java:178)
> at
> org.scijava.console.DefaultConsoleService.processArgs(DefaultConsoleService.java:75)
> at net.imagej.Main.launch(Main.java:64)
> at net.imagej.Main.main(Main.java:73)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:258)
> at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
> at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
>
> After inspecting the Plugin's source code, I can't find any reason this
> exception might occur at that location. I'm guessing this has to do with
> the way Fiji is instrumenting the dialog portions of the plugin to remove
> the dependency on AWT?
>
> The exception seems very similar to the one I was getting when I was trying
> to use run("Colors...", "background=black"). I was able to fix that by
> switching to setBackgroundColor(), so I wonder if there's also a workaround
> for running the thresholder.
>
> I should mention that I've tried using various versions of Fiji, including
> the lifeline versions and the latest build.
>
> Thank you,
> Konrad
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html