[ImageJ-devel] Calibration bug when rotating an image by 90°

Barry DeZonia bdezonia at gmail.com
Thu Mar 21 16:21:03 CDT 2013


Hi Michael,

This is the email list for ImageJ2 development. We are happy to help people
with issues with ImageJ1 here as well when we can. But in general questions
pertaining to ImageJ1 are best directed to the ImageJ1 mailing list (
http://rsbweb.nih.gov/ij/list.html) as it will get read by many more people.

In this case I think you want the ImageJ1 code changed which is something
we don't have the access to do. You should bring your issue to the
attention of the primary ImageJ1 developer Wayne Rasband by posting your
question on the list I've referenced above.


On Thu, Mar 21, 2013 at 4:45 AM, Michael Epping <m.epping at arcor.de> wrote:

> 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 at imagej.net
> http://imagej.net/mailman/**listinfo/imagej-devel<http://imagej.net/mailman/listinfo/imagej-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130321/f352b482/attachment.html>


More information about the ImageJ-devel mailing list