The creation of a new JFrame is hardcoded into ImageJ's ImagePlus
class:
if (stackSize>1)
win = new StackWindow(this);
else
win = new ImageWindow(this);
If you want to adapt the GUI, you can extend the ImageWindow
or StackWindow
classes. See the Trainable Weka Segmentation plugin for a nice example.
Alternatively, use the data structures of ImageJ2, namely ImgLib's ImgPlus
. These are designed to be independent of any user interface.