TransformJ: Affine
General Description
This plugin applies specified affine transformations to images. If an image has anisotropic voxels, this is taken into account, so there is no need to correct for it separately. This is the most generic and therefore also the most computationally demanding plugin of the TransformJ package. If only rotation, turning, scaling, or translation is required, it is better to use the Rotate, Turn, Scale, or Translate plugin, respectively.
Dialog Description
Matrix file
An affine transformation is determined by a 4 x 4 matrix, which is applied to input positions expressed in homogeneous coordinates [1,2] to calculate the output positions, as follows:
The matrix file should be a tab-delimited text file (comma- and space-delimited text files are also accepted) containing exactly four rows and four columns representing the affine transformation matrix. The full path of the file should be specified, which is most easily done by clicking the Browse button, and selecting the file in the file dialog. If needed, matrix files can be easily created, modified, and saved by clicking the Create button, which opens the Matrix dialog. The transformation corresponding to the selected matrix file is applied to every frame in every channel of a 5D image.
A right-handed coordinate system is assumed for transformation, where the origin is taken in the center of the image or volume, and 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 the z-axis is taken perpendicular to the screen (with increasing z-coordinate when moving away from the observer, that is "into the screen").
Interpolation
Affine transformation requires using some form of interpolation. The currently available interpolation schemes for this operation are: nearest-neighbor, linear, cubic convolution [3], cubic B-spline [4,5,6], cubic O-MOMS [7], and quintic B-spline [4,5,6] interpolation, where, in general, the quality of the result should increase in that order.
Background
Parts of the transformed image may not be filled, 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 specified value.
Adjust bounds to fit result
The affine transformation may cause parts of the input image to fall outside the result image, if the bounds of the latter are kept equal to those of the input image. Selecting this option causes the bounds of the result image to be adjusted so that the entire transformed image fits in.
Resample isotropically
By default, the result image has the same voxel size as the input image. In the case of anisotropic voxels this may cause a loss of information (for example when rotating the image such that the high-resolution x-y plane becomes the lower-resolution x-z plane). If this option is selected, the result image is resampled during affine transformation to obtain isotropic voxels, with all voxel edges equal to the smallest of the voxel width, height, and depth of the input image, so that no resolution is lost. Of course, this requires more computation time.
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 transformed 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 at the borders. By selecting this option, the borders in the copy of the input image are not mirrored, but entirely filled with the specified background value. This generally results in a smoother transition between the borders of the transformed image and the background.
Algorithmic Details
The algorithm internally uses 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 the image size.
References
G. Wolberg
Digital Image Warping
IEEE Computer Society Press, Washington, DC, 1990J. Foley, A. van Dam, S. K. Feiner, J. F. Hughes
Computer Graphics: Principles and Practice
Second Edition, Systems Programming Series, Addison-Wesley, Reading, MA, 1990R. G. Keys
Cubic Convolution Interpolation for Digital Image Processing
IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 29, no. 6, December 1981, pp. 1153-1160M. Unser
Splines: A Perfect Fit for Signal and Image Processing
IEEE Signal Processing Magazine, vol. 16, no. 6, November 1999, pp. 22-38P. Thevenaz, T. Blu, M. Unser
Interpolation Revisited
IEEE Transactions on Medical Imaging, vol. 19, no. 7, July 2000, pp. 739-758E. 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, June 2001, pp. 111-126T. Blu, P. Thevenaz, M. Unser
MOMS: Maximal-Order Interpolation of Minimal Support
IEEE Transactions on Image Processing, vol. 10, no. 7, July 2001, pp. 1069-1080