How to hide the ImageJ Thresholding window

Hello all,

I am using an ImageJ library in my program and during the thresholding part of my image manipulations the ImageJ thresholding window pops-up. I am using the ImageJ library in my own GUI, so I would like to hide the threshold window that opens when I run my code.

Here is the part that deals with thresholding:

IJ.setAutoThreshold(imp, "Default");
//Change thresh
imp.getProcessor().setThreshold(imp.getProcessor().getMinThreshold(), imp.getProcessor().getMaxThreshold()*0.65, 1);
Prefs.blackBackground = false;, "Convert to Mask", "");"Close");
println("Thresholding complete...");

Is there any way to stop the window from opening or turn the window visibility off?

Thank you,


Better than hiding it, don’t even show it in the first place.

I suggest you delete the following line from your code:

1 Like

That did the trick. Thank you!