Closed odinsbane closed 6 years ago
It seems you're using ij.ImageJ
(not net.imagej.ImageJ
) in your code snippet, so this issue rather belongs to imagej1
.
Why do you need to call ImageJ.main
at all?
True, this should probably be an imagej1 issue.
I don't always like to start my programs from imagej, especially when I am developing them. But I like to have imagej running so I can do things like save and adjust contrast. Which I cannot do with just an ImagePlus window.
I recommend using a main
method in your plugin then, modeled after the one in imagej/example-legacy-plugin
:
I am using my own main method in the example I pasted. The main difference is the new ImageJ()
instead of using ImageJ.main(String[] args)
. Which works!
Using ImageJ.main
will not start a new ImageJ window if one is running already.
Thank you
@odinsbane From the exchange above, I take it your issue is solved? Therefore I'm closing this issue. If I am incorrect and there is still a problem, please feel free to reopen with details.
I have some programs that I run, and they start imagej while running. For example.
If I run this once, everything works as expected. If I run this again while the first imagej window is still visible, the the second ImagePlus will open without an ImageJ window. I don't mind the lack of a second window, but I cannot access the second ImagePlus, eg save the file, process or adjust contrast.
I think this is a new behavior, but I am not sure. I am using ImageJ 1.51r