Stack conversion works from GUI and fails in headless mode

Hi,

I have a macro that includes a line:

run(“Stack to RGB”, “frames”);

that executes correctly from the FIJI GUI but fails in headless mode with a message that begins with :

java.lang.NullPointerException
at ij.plugin.RGBStackConverter.dialogItemChanged(RGBStackConverter.java:265)
at net.imagej.patcher.HeadlessGenericDialog.showDialog(HeadlessGenericDialog.java:213)
at ij.plugin.RGBStackConverter.showDialog(RGBStackConverter.java:252)
at ij.plugin.RGBStackConverter.compositeToRGB(RGBStackConverter.java:93)
at ij.plugin.RGBStackConverter.run(RGBStackConverter.java:38)

The input is a composite stack.

I am trying to see if scripting this with jython instead of using the macro language will work but I’m not successful at that yet. My ultimate goal is to have a headless way to combine three single channel tif stacks into one RGB or composite stack that displays with only one slider for the time dimension (and none for the channels).

I’d appreciate guidance here and can create a MCVE if that’s helpful.

thanks,
Mark

Good day Mark,

just a short first question:

Does the operation execute from a macro if you run run your macro from the macro (editor) window (Plugins >> New >> Macro)?

Regards

Herbie

Hi Herbie,

Yes, when I have the macro in the macro editor window and select run, it executes correctly.

Mark

Ok thanks, then your issue needs some attention of the ImageJ informatics-experts.

I’m sure they will soon chime in!

Good luck

Herbie