Macro recording doesn't pick up all paramters under certain circumstances

Hello dear Community,

I found a problem using our own ilastik plugin for imagej :o and I have zero clue how this is caused.

But first the symptom:

When running pixel classification with macro recording turned on, and selecting probabilities as the output type the macro recorder correctly records all parameters (that have a label in the relevant code):

run("Run Pixel Classification Prediction", "projectfilename=/xxxxx/2dcells_pc.ilp inputimage=2d_cells_apoptotic_1channel.png pixelclassificationtype=Probabilities");

When output type is set to segmentation , it will only record the following:

run("Run Pixel Classification Prediction");

There is a lot of magic happening which is just far beyond my knowledge. But maybe the experts (@imagejan ???!) can help?

Thanks a lot in advance!

Hm, that’s interesting. The only cases I know where commands are recorded without the option string are caused by premature triggering of the recorder due to the use of IJ.run() in plugins, see these related discussions:


But all these are specific to ImageJ1, and as far as I can see, your plugin is exclusively using IJ2 functionality, so I assume your issue is unrelated.

When quickly reading through the code, it seems the code path for the two conditions, Probabilities and Segmentation, is quite similar, and mostly differing in this additional if clause:

So, without having tested anything: would it make a difference if you add quotes to the command line, in agreement with the ilastik documenation?

    commandLine.add("--export_source=\"Simple Segmentation\"");

I don’t know why this should change the recording behavior, but it might be worth trying :slightly_smiling_face:


Other than that, I’d suggest to file an issue in imagej-legacy, as I assume it’s a bug with one of these:

2 Likes

Hey @imagejan,

thank you so much for your extensive reply. In the meantime @wolny found the issue and I thought it might be interesting to share here. You were spot-on! There was the following code:

    public static void applyLUT(String lutName) {
        try {
            IJ.run(lutName);
        } catch (Exception e) {
            throw new UnsupportedOperationException("LUT not found: " + lutName);
        }
    }

so there was an IJ.run after all. Should’ve grepped…

1 Like