Saving with no open windows
Posted by kt7 on Feb 05, 2017; 10:32pm
URL: http://imagej.273.s1.nabble.com/Plugin-to-adjust-threshold-without-opening-window-tp5018002p5018032.html
I'm working on developing a java plugin where I am converting images to binary without opening them by using:
ImagePlus image1 = IJ.openImage("/Path/to/file");
IJ.setThreshold(image1, thresholdLower, thresholdUpper, "Black & White");
Prefs.blackBackground = true;
IJ.run(image1, "Convert to Mask", "");
IJ.save(image1, "/Path/to/output");
I have tried IJ.saveAs and both give me the error that there are no open windows. How do I save these changes that I have made without needing the window to be open?
Thanks,
Kyle