## SA P - Sum Alignment - Positive rotation and shift

(8/01/01)

PURPOSE

Perform vector addition of rotation and shift values from two successive cycles of alignment of an image series. The summed values, saved in registers, can then be applied to the original images. Additive interpolation errors are thus avoided.
This operation is meant for use with the angles and shifts obtained from operations other than 'CC IC' and 'OR'. The angles are already compatible with signs in 'RT SQ'.   Example.

 SA [Sum Alignment] VO EPT [Vector Operation - Euler angle point rotation] VO IA [Vector Operation - Find Included Angle]

USAGE

.OPERATION: SA P [ango],[xo],[yo]
[This operation can return up to three optional register variables which are the the vector sums for the rotation and shifts.

 Variable Example Receives First [ango] Angle Second [xo] X shift Third [yo] Y shift

.INITIAL ROTATION ANGLE, X & Y SHIFTS: [ang],[xs],[ys]
[The rotation angle, the x-shift value, and the y-shift value from the initial alignment cycle. These values will typically have been retrieved from a document file by an UNSAVE ('UD') operation just prior to the call to 'SA'.

.REFINED ROTATION ANGLE, X & Y SHIFTS: [angr],[xsr],[ysr
[The rotation angle, the x-shift value, and the y-shift value from the refinement cycle. These three values can also have been unsaved in the above manner from another document file, or if the 'SA P' is performed in the same session (procedure run) as the second cycle, they may simply be current register contents (see below).

NOTES

1. Rotational matrix used in 'SA P' has form:
cos     -sin
sin     cos

2. 'SA P' may be applied most conveniently within the second cycle loop. The intermediate image series (rotated and translated by the amounts found in the first cycle) are realigned against a refined reference, and the values are stored in [angr],[xsr],[ysr]. The values from cycle 1 are then UNSAVEd into [ang],[xs],[ys], and 'SA' is used to obtain [xo],[yo],[zo]. These output values are finally applied to rotate and shift the unaligned original image series. They should also be saved in another document file, using 'SD'. Note that two input and one output series must be on disk at one time. The original images may be deleted individually (within the DO-loop) once the corresponding final, aligned images have been obtained.

3. After having obtained the resulting angle and shifts the 'RT SQ' operation can be applied to rotate and shift an image.

SUBROUTINES

SUMALI

CALLER

DRIV1