Active Image or Threading Problem
Posted by David Webster on Oct 31, 2009; 6:24am
URL: http://imagej.273.s1.nabble.com/Active-Image-or-Threading-Problem-tp3690601.html
All,
I am getting some funny results with the code fragment below. The
IJ.makeOval(...) method works on the current active image. In case 1, when
I leave IJ.log("2: The ... ) commented out, the oval shows up on drawn on
image ip1. I would have thought it would shown up on ip2. In case 2, I un-
comment IJ.log("2: The ... ), then the oval it does show up super-imposed
on ip2. Sometimes, things work the other way around, at least in the first
case. Am I getting some sort of multi-threading problem or does the method
call in the IJ.log(...) somehow change the active image? In any case, how
can I insure that ip2 is the active image.
David Webster
ImageProcessor ip1 = new ByteProcessor(100,100);
ImageProcessor ip2 = new ByteProcessor(100,100);
new ImagePlus("ip1", ip1).show();
new ImagePlus("ip2", ip2).show();
//IJ.log("2: The current image is "+WindowManager.getCurrentImage
().getTitle());
IJ.makeOval(0,0, 70,70);