; SOURCE: spider/docs/techs/recon/newprogs/shiftvol.spi ; ; PURPOSE: Compares two volumes do find shift for max cross-correlation. ; X,Y,Z shift values are written to a document file. ; Shifts first input volume to align with second ; ; ------------ Input files -------------------------------------------- [ref] = '../reference_volume' ; Reference volume [vol] = 'test_volume' ; Volume to be shifted to align with reference vol. ; --------------- Output files ------------------------------------- [doc] = 'shiftdoc' ; Cross correlation peak cooordinates [out] = 'aligned_volume' ; Shifted version of test_volume ; -------------- END BATCH HEADER ---------------------------------- CC N ; Normalized cross correlation [vol] ; Volume (input) [ref] ; Volume (input) _1 ; Cross correlation volume (output) DE ; Remove existing peak doc file [doc] PK 3D [isx],[isy],[isz], [sx],[sy],[sz], [v7] _1 ; Cross correlation (input) + (1,0) N N [doc] ; Doc file with shift values (output) ; The first 3 columns in the docfile: [isx],[isy],[isz] are the ; integer X,Y,Z shifts needed to bring test_volume into ; alignment with the reference_volume. ; [sx],[sy],[sz] contain these values in floating point format. SH [vol] ; Volume to be shifted (input) [out] ; Aligned_volume (output) -[sx],-[sy],-[sz] ; Shifts EN