Posted by
Burger Wilhelm on
Mar 30, 2009; 8:16am
URL: http://imagej.273.s1.nabble.com/Contradiction-with-show-method-tp3693120p3693131.html
Running IJ 1.42h (under Windows XP, Java 1.6) I cannot confirm the described behavior for cases 1 and 2.
Without the call to updateAndDraw() the inverted image never shows.
--Wilhelm
________________________________
Von: ImageJ Interest Group im Auftrag von David William Webster
Gesendet: So 29.03.2009 22:34
An:
[hidden email]
Betreff: Contradiction with show() method
I am learning Java via th "monkey see, monkey do" method and get what seems
to be a contradiction.
I ran a test similar to the one shown in Burger and Berge on page 502.(see
run method below). Without the updateAndDraw(), the invert()
result should not be display'ed. But,
In case 1, with the wait(2000) and updateAndDraw() commented out,
I get the inverted image being displayed (It shouldn't be).
In case 2, I use the wait(200) and get only the original image being
displayed.
In case 3, I add the updateAndDraw() and get the inverted image.
Only case 3 makes any sense
public void run(ImageProcessor ip) {
ImageProcessor ip1 = ip.duplicate();
ImagePlus im1 = new ImagePlus("im1",ip1);
im1.show();
//IJ.wait(2000);
ip1.invert();
//im1.updateAndDraw();
}
David Webster