TransformJ: Rotate


General Description

This plugin enables one to rotate an image any given angle about the z-, y-, and x-axis. If only rotations over multiples of 90 degrees are required, it is better to use the Turn plugin, which is computationally much faster and does not use interpolation.

Rotate Dialog

Dialog Description

z-, y-, x-angle (degrees). The angles (in degrees) of rotation about the z-, y-, and x-axis. Rotation about the different axes is carried out in that order and the operation is applied to every time frame in every channel of a 5D image.

A right-handed coordinate system is assumed for rotation, where the origin is taken precisely in the center of the image or volume, and where the x-axis is taken horizontally on the screen (with increasing x-coordinate when moving from left to right), the y-axis is taken vertically on the screen (with increasing y-coordinate when moving from top to bottom), and finally the z-axis is taken perpendicular to the screen (with increasing z-coordinate when moving away from the observer, that is "into the screen").


Right-Handed Coordinate System

A rotation of +90 degrees about the z-axis implies that the positive x-axis is mapped onto the positive y-axis. A rotation of +90 degrees about the y-axis maps the positive z-axis onto the positive x-axis. And a rotation of +90 degrees about the x-axis maps the positive y-axis onto the positive z-axis.

Interpolation scheme. Rotation over arbitrary angles can be done only by applying some form of interpolation. The currently available interpolation schemes for this operation are: nearest-neighbor interpolation, linear interpolation, cubic convolution interpolation [1], cubic B-spline interpolation [2,3,4], cubic O-MOMS interpolation [5], and quintic B-spline interpolation [2,3,4], where, in general, the quality of the interpolations should increase in this order.

Background value. Parts of the rotated image may not be filled, simply because the image elements in those regions do not correspond to positions within the input image. These remaining parts of the result image are filled with the given value.

Adjust size to fit result. The rotation may cause parts of the input image to fall outside the result image, if the size of the latter is kept equal to that of the input image. Selecting this option adjusts the size of the result image so that it fits the entire rotated image.

Anti-alias borders. In order for the linear and higher-order interpolation schemes to operate properly, a bordered copy of the input image is used internally. The standard setting is that the borders of this copy are filled by mirroring the image values. Since the elements in the rotated image corresponding to positions outside the borders of the input image are always filled with the background value, this may cause a "stair-casing" effect (also referred to as "aliasing" by some) at the borders. By selecting this option, the borders in the copy of the input image are not mirrored, but entirely filled with the given background value. This generally results in a smoother transition between the borders of the rotated image and the background. However, when using this option in the case of 3D or higher-dimensional data sets, the first and last few slices of the volume(s) in the result may have a reduced intensity. It is therefore recommended to use this option only when rotating 2D photographs (as with the clown image on the TransformJ front page).


Algorithmic Details

The algorithm works with a bordered copy of the input image, not only to solve the boundary problem, but also because some of the interpolation schemes require recursive prefiltering of the input image. Since the prefiltering operations need to be carried out with high accuracy, the bordered copy is always stored in floating-point format, which may require quite some memory, depending on image size.


References

[1]R. G. Keys. Cubic Convolution Interpolation for Digital Image Processing. IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 29, no. 6, 1981, pp. 1153-1160.
[2]M. Unser. Splines: A Perfect Fit for Signal and Image Processing. IEEE Signal Processing Magazine, vol. 16, no. 6, 1999, pp. 22-38.
[3]P. Thevenaz, T. Blu, M. Unser. Interpolation Revisited. IEEE Transactions on Medical Imaging, vol. 19, no. 7, 2000, pp.739-758.
[4]E. H. W. Meijering, W. J. Niessen, M. A. Viergever. Quantitative Evaluation of Convolution-Based Methods for Medical Image Interpolation. Medical Image Analysis, vol. 5, no. 2, 2001, pp. 111-126.
[5]T. Blu, P. Thevenaz, M. Unser. MOMS: Maximal-Order Interpolation of Minimal Support. IEEE Transactions on Image Processing, vol. 10, no. 7, 2001, pp. 1069-1080.
Copyright © 1996 - 2012 Erik Meijering