Differences between revisions 4 and 5
 ⇤ ← Revision 4 as of 2006-08-21 21:58:09 → Size: 1777 Editor: Philip Baldwin Comment: ← Revision 5 as of 2006-08-21 22:06:39 → ⇥ Size: 1869 Editor: Philip Baldwin Comment: Deletions are marked like this. Additions are marked like this. Line 27: Line 27: . c) The first two lines of the second block of commands, could have been written as the second line of the first block of commands. . c) The first two lines of the second block of commands, could have been written as the second line of the first block of commands. This command sets RA to a rotation that rotates a 2D image by 25 degrees around the Z-axis.

Transform Class

# Usage

## Examples

• Here are some examples of creating a Transform3D object. Much more will be added later.

All angles are in degrees

Creating just rotations:

• RA=Transform3D(0,0,25); # Default is the ZXZ convention
• RA=Transform3D(EULER_SPIDER,0,0,25); # This is the typical ZYZ convention
• RA=Transform3D(m11,m12,m13,m21,m22,m23,m31,m32,m33) # create the transformation by entering
• components

Creating more complicated transformations using set :

• RA = Transform3D(); # this creates the 3D identity matrix
• RA.set_rotation(0,0,25); # creates a matrix that will rotate 2D images by 25 degrees
• RA.set_posttrans(Vec3f(1,0,0)); # the matrix will now also shift 1 pixel in the x-direction
• RA.set_scale(1); # Occaisionally one will wish to rescale.

Notes:

• a) We could have used EMAN, IMAGIC, SPIN, QUATERNION, SGIROT, MRC, XYZ, MATRIX instead of the SPIDER of EULER_SPIDER above.
• b) There is also a set_rotation via a dictionary object, which we will explain at length soon.
• c) The first two lines of the second block of commands, could have been written as the second line of the first block of commands. This command sets RA to a rotation that rotates a 2D image by 25 degrees around the Z-axis.
• d) There are corresponding "get" calls to extract the information from the transformation matrices. SPARX has some of its own, that are wrappers for these get calls. More later.

# Description

Purpose: to apply rotation/shift/scaling operations for 2D or 3D images via a variety of methods.

P. R. Baldwin

P. R. Baldwin

category 1
FUNDAMENTALS

libEM