## RT 3D - RoTate - volume, fast, tri-quadratic interpolation

(04/11/02)

PURPOSE

Rotate a volume by three Eulerian angles using tri-quadratic interpolation.

 RT [RoTate - image or volume, use average as background, bilinear interpolation] RT 3 [RoTate - volume, slow] RT 3A [RoTate - volume, arbitrary center, quadratic interpolation] RT 3DS [RoTate - volume, fast, tri-linear interpolation] RT 3L [RoTate - volume around an arbitrary line] RT 90 [RoTate - image or volume, by 90, 180, or 270 degrees] RT B [RoTate - image or volume, supply Background, bilinear interpolation] RT M [RoTate - image or volume, use minimum as background, bilinear interpolation]

USAGE

.OPERATION: RT 3D

.INPUT FILE: PIC001
[Enter name of the file to be rotated.]

.OUTPUT FILE: ROT001
[Enter name of the file where the rotated volume is to be stored.]

.PHI, THETA, & PSI: 10.5, 13.7, 45.8
[Enter the rotation angles Phi (around Z), Theta (around Y), and Psi (around Z).]

NOTES

1. Program reads first volume into the memory - larger volumes may not fit. In this case use 'RT 3' instead. Unfortunately 'RT 3' gives slightly incorrect results, does not use the proper interpolation scheme, and has sign of theta reversed.

2. First rotation is done around Z-axis (clockwise), second rotation is done around Y-axis (clockwise) and third rotation is done around Z-axis (clockwise). All rotations are done in space coordinate system.

3. Rotation matrix used:
```
R = R(psi) * R(theta) * R(phi)
c  s  0        c  0 -s      c  s  0
-s  c  0    *   0  1  0   * -s  c  0
0  0  1        s  0  c      0  0  1
```

4. In the 'corners', old values are left. Sometimes this leads to non-intuitive results. E.g. a simple rotation around the Z axis (psi = 0) leave the first and last slices of a volume unrotated. If this causes problems you will have to mask the resulting volume.

5. How to determine parameters to match volumes:
If both X and Y axis rotations are needed, it may be simpler to use two rotations consecutively.
Pick a slice (either X or Y) from the volume and do a test rotation in 2D using operation: 'RT'.
Change the sign of the angle you determined using 'RT' and apply the angles as shown here.
For X rotation: 90, -angle, -90
For Y rotation: 0, -angle, 0
(Note provided by: Mike Marko) (Interpolation quality will be poorer.)

6. Implemented by A. Leith.

SUBROUTINES

ROTAS3, ROTS3Q, BLDR

CALLER

UTIL3