[ImageJ-bugs] [Bug 1205] New: ImageProcessor.flipHorizontal()/flipVertical() requires use of updateImage()

bugzilla at fiji.sc bugzilla at fiji.sc
Fri Dec 11 19:00:10 CST 2015


http://fiji.sc/bugzilla/show_bug.cgi?id=1205

            Bug ID: 1205
           Summary: ImageProcessor.flipHorizontal()/flipVertical()
                    requires use of updateImage()
           Product: ImageJ
           Version: unspecified
          Hardware: PC
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Legacy
          Assignee: imagej-bugs at imagej.net
          Reporter: dloginov at mit.edu

I was using ImageProcessor.flipHorizontal()/flipVertical() and found that its
behavior is sometimes inconsistent, i.e. it may flip the image as referred to
by ImageProcessor, but not necessarily the same image when referred by
ImagePlus. In these cases I have to force the update using
ImagePlus.updateImage(). Could you please elaborate if that is the intended
behavior?

Specific instance is:

BufferedImage img = new BufferedImage(WIDTH, HEIGHT,
BufferedImage.TYPE_USHORT_GRAY);
img.getRaster().setDataElements(0, 0, WIDTH, HEIGHT, objImage);
ImagePlus imp = new ImagePlus("", img);
imp.show(); // shows original image
ImageProcessor ip = imp.getProcessor();
ip.flipVertical();
ip.flipHorizontal();
ImagePlus impNew = new ImagePlus("", ip);
impNew.show(); // flipped image
imp.show(); // old image (!)

If one now issues

imp.updateImage();

then imp.show() will show the correct (flipped) image.

I'm encountered this issue with the latest release version (1.50e).

Thank you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-bugs/attachments/20151212/5c13674d/attachment.html>


More information about the Imagej-bugs mailing list