Hello,
I hope this is the right address to report a small bug.

Problem:
I use the calibration "Origin (pixels)" with different values for x and y. When I rotate an image by 90°, pixel width and pixel height are swapped as expected. But the origin stays the same. The attached code shows that only cal.pixelWidth and cal.pixelHeight are swapped but not cal.xOrigin and cal.yOrigin.

Code:
ij.plugin.filter.Transformer

public void run(ImageProcessor ip) {
        if (arg.equals("fliph")) {
            ip.flipHorizontal();
            return;
        }
        if (arg.equals("flipv")) {
            ip.flipVertical();
            return;
        }
        if (arg.equals("right") || arg.equals("left")) {
            StackProcessor sp = new StackProcessor(imp.getStack(), ip);
            ImageStack s2 = null;
            if (arg.equals("right"))
                s2 = sp.rotateRight();
            else
                s2 = sp.rotateLeft();
            Calibration cal = imp.getCalibration();
            imp.setStack(null, s2);
            double pixelWidth = cal.pixelWidth;
            cal.pixelWidth = cal.pixelHeight;
            cal.pixelHeight = pixelWidth;
            return;
        }

_______________________________________________
ImageJ-devel mailing list
ImageJ-devel@imagej.net
http://imagej.net/mailman/listinfo/imagej-devel

Reply via email to