Login  Register

Re: ImagePlus not drawing updates with in a loop

Posted by Richard Zorger on Apr 25, 2014; 8:51pm
URL: http://imagej.273.s1.nabble.com/ImagePlus-not-drawing-updates-with-in-a-loop-tp5007405p5007446.html

Hi Michael,

Thank you for your response! Unfortunately I have tried the ImagePlus.updateAndDraw() method and it did not work. I have also tried:
- Setting the ImageProcessor to a different ImageProcessor and then setting it back with imp3.setProcessor()
- ImageWindow winID = imp3.getWindow(); then winID.updateImage(imp3); and winID.show();
- imp3.changes = true;
- WindowManager.repaintImageWindows()

Is there anything else you can think of that I can try? Is there some other field like ImagePlus.changes that ImageJ looks at when deciding whether to update the image?

thanks
Richard


>Hi Richard,
>
>ImagePlus.setProcessor(ImageProcessor ip) updates the ImagePlus only if you have a new ImageProcessor (i.e., if it is a >different object, irrespective of whether its contents have changed).
>In your case, you use always the same ImageProcessor, so the operation is unnecessary except for the first time, and >ImageJ recognizes that there is no new ImageProcessor.
>
>To update the displayed ImagePlus, use the ImagePlus.updateAndDraw() method.
>
>Michael

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html