After experimenting a bit with Commands I could implement a simple gaussian filter with the ImageJ2 API, and I would like to modify my code in order to preview the result of the filter for different values of the standard deviation sigma. What I want essentially is to see, in a separate window alongside the original, the effects of the filter as I change sigma, for instance via a slider.

For that purpose, I tried to mimic the commands-with-preview tutorial implementation, but despite all my efforts, I couldn’t get a working example. I’m actually having a hard time understanding:

which class/interface I should extend/implement,

which class (Data/DataView/Display/Other) I should use to be able to update the image displayed on the screen

which types (INPUT/OUTPUT/BOTH) I should use for my parameters.

I also took a look at the InteractiveImageCommand class and its super-classes to get a better understanding of how the Threshold and BrightnessContrast classes achieved similar goals but it seems specifically designed for interaction (feedback from displays?) rather than for previewing purposes, although I may be wrong.

So far, this is what I wrote:

by implementing the Command and Previewable interfaces, as advertised in the tutorial I mentionned,

Both my implementations fail at either displaying the result window while tweaking the parameters or updating it.

I would really appreciate if someone could point me out, at the very least, the bits that I’m missing (I may totally be wrong in the choices I made) or give me general guidelines as to how to exploit already implemented classes.

Thank you very much for sharing your findings with all necessary
code. It’s an old project and I don’t quite have the time just
right now to look into it but I will later on. I would be grateful
if you keep me posted about that.