SH - Shift - using bilinear/trilinear interpolation ||

(03/25/12)

PURPOSE

Shifts a image or image series by a specified vector using bilinear interpolation. Shifts volumes using trilinear interpolation.   Example.

SEE ALSO

SH F [Shift - using Fourier interpolation ||]

USAGE

.OPERATION: SH

.INPUT FILE NAME OR TEMPLATE (E.G. STK@****): PIC001
[Enter the name of the file to be shifted. This name can be for a single file, a whole stack (ending in @), or a template for a set of images (e.g stack3@****** or fil***). Templates containing asterisks will have the astericks substituted with a number for the file.]

If there is only a single input file specified the following final two prompts appear:

.OUTPUT FILE: SHI001
[Enter the name of the file where the shifted image is to be placed. ]

.SHIFT COMPONENTS IN X, Y, & Z: -5.2, 6.5
[Enter the shift vector components.]

Otherwise if the input file name contains astericks for a set of images the following prompts appear:

.FILE NUMBERS OR SELECTION DOC. FILE NAME: select_03
[Enter the file numbers to be substituted into the file name template or name of a selection document file that contains the input file numbers in the first register.]

.OUTPUT FILE NAME OR TEMPLATE (E.G. IMGSTK@****):
[Enter template for the names of the output file(s).]

.SHIFT DOCUMENT FILE: savdocstksh
[Name of document file containing the shifts.]

.REG. #'S FOR X & Y SHIFTS (OR * FOR: 2,3): 2, 3
[Enter the register column positions in the document file where these parameters are retrieved from.]

Otherwise if the input file is a whole stack the following prompts appear:


.OUTPUT STACK FILE: STACK03@
[Enter the name of the file where the centerd images are to be placed. This output file will be a whole stack. Image numbers within the stack will correspond to the input stack]

.SHIFT DOCUMENT FILE: savdocstksh
[Name of document file containing the shifts.]

.REG. #'S FOR X & Y SHIFTS (OR * FOR: 2,3): 2, 3
[Enter the register column positions in the document file where these parameters are retrieved from.]

Different prompt variations occur for other possible combinations of input and output file stacks.

NOTES

  1. The action of the operation depends on the shift specified. For integer shift vector components a simple index permutation is done. For non-integer shift values, bilinear interpolation is used.

  2. Due to the use of circular shift, 'SH' has the effect of multiplying the Fourier transform with:
    exp (2 [pi] j (KSH * KX/NX + ISH * KY/NY))

  3. This shift operation may have the unpleasant effect of moving a discontinuity into the image field (this happens whether or not the shift is circular). If this is not desired, and cannot be removed by subsequent masking, the image should be recreated from its original field by rewindowing. The new window coordinates must be offset by -KSH,-ISH to correspond to an application of 'SH' with +KSH,+ISH.

  4. The shift parameters can be specified input from register variables: -[shix],-[shiy], will input the components (with inverted sign) of a shift vector found in a previous 'CC' and 'PK [shix],[shiy]' operation. Whether or not the sign has to be inverted follows from the order of argument files in the 'CC' operation.

SUBROUTINES

SHIFTS, SHIFT3, SHIFTT, SHIFT_3D

CALLER

UTIL_1110

© Copyright Notice /       Enquiries: spider@wadsworth.org