-1

I'm learning ImageJ now but I got a problem.

First, I added an overlay to an image (using Image-Overlay-AddImage in menu). Now I want to rotate the image and keep the upper overlay remained as a reference. But when I use the rotate command(Image-Transform-rotate), the overlay is removed.

However, this operation is fine with rotating 90 degrees(Image-Transform-Rotate 90 degrees left/gight) and the translate command(Image-Transform-translate). These are just what I want, keeping the overlay remained and make the origin image change.

I'm wondering why these are different, especially the 'rotate' and the 'rotate 90 degrees', and how to rotate correctly with out removing the overlay. Anybody can help me? Thanks!

SMartQi
  • 3
  • 1

1 Answers1

0

The observed behavior is due to different code performing the different rotations:

Image > Transform > Rotate 90 Degrees Leftij.plugin.filter.Transformer("left") Image > Transform > Rotate 90 Degrees Rightij.plugin.filter.Transformer("right")

whereas

Image > Transform > Rotate...ij.plugin.filter.Rotator

(You can get this information in ImageJ by pressing [L] or running Plugins > Utilities > Find Commands... and then typing Rotate in the search field)

If you take a look at the ij.plugin.filter.Rotator class, you'll see that it invokes ImageCanvas#setDisplayList(null) which will remove the current Overlay (see also the javadoc) even if no grid lines are displayed in preview.

This behavior is a little unintuitive and might be changed by the developers if you report it through the mailing list or via Fiji's bugzilla.

Jan Eglinger
  • 3,876
  • 1
  • 22
  • 49