rot_shift2D - Rotate, shift, mirror, and scale a 2-D image.
output = rot_shift2D(image, alpha, sx, sy, mirror, scale, interpolation_method)
- input image
in plane rotation angle (Note this angle is different from Euler in plane angle psi). Check I_O about 2D & 3D alignment parameter related conventions
- 2-D x shift
- 2-D y shift
- 0. does not mirror 1. mirror over x-axis
re-scale size ratio after applying rotation. The scale will change the 'physical pixel size' of the image (scale >1 will reduce the pixel size, scale<1 will increase it). Note re-scaling will not change the image size in pixels; to do that, use command resample.
- Attention: scale cannot be set as 0.
- interpolation method used to transform the image (default is set to "quadratic" in global_def.py).
- the transformed image
- "linear" use linear interpolation to sample the rotated image
- "quadratic" use quadratic interpolation to sample the rotated image
- "gridding" use gridding to sample the rotated image ( This method is very slow )
- The rotation, shift, and scaling are achieved using the following procedure:
- Construct a transformation matrix (a class objection of C++ or python) from the in_plane angles through Transform3D.
- set translation attribute of the object to take care of translation shifts.
- set scale attribute of the object to include scaling factor.
- apply the class object to input image.
See P. R. Baldwin et al. below to find out how to construct transformation class.
Author / Maintainer
- category 1
P R Baldwin , Pawel A Penczek, The Transform Class in SPARX and EMAN2. J. Struct. Biol. 157 (2007), pp. 251-261.
- works for most people, has been tested; test cases/examples available.
None. It is perfect.