# Fast Template Matching via Cross-Correlation

### Description

Motion correction and/or co-registration of three-dimensional arrays (medical imaging data) are performed by applying a user-defined mask of voxels. Normalized cross-correlations (in 3D) are computed using the FFT.

### Usage

1 2 3 4 | ```
fastTemplateMatching(input, ...)
## S4 method for signature 'array'
fastTemplateMatching(input, ...)
``` |

### Arguments

`input` |
is a four-dimensional array of signal intensities. |

`...` |
Additional variables passed to the |

### Details

An extremely basic method of motion correction/co-registration is
implemented by estimating “local” cross-correlations based on a
binary mask that is a subset of the original three-dimensional volume. All
convolutions are preformed via the FFT (`fft`

) and repetitive
calculations are minimized where possible.

Only whole-voxel translations are considered. This does not begin to capture the true effects of motion in soft tissue, but we assume that the object of interest (e.g., tumor) is a fairly rigid structure. Potential extensions include rigid-body, affine and nonlinear registration techniques along with interploation schemes in order to capture intra-voxel manipulations of the data.

### Value

A list of objects are returned:

`out` |
Motion-corrected version of the four-dimensional array. |

`offset` |
Translations (in 3D) for each volume in the 4D array. |

`t.center` |
Estimated center of the binary mask. |

### Author(s)

Brandon Whitcher bwhitcher@gmail.com

### References

Lewis, J.P. (2003) Fast normalized cross-correlation.

www.idiom.com/~zilla/

### See Also

`convFFT`

, `findCenter`

,
`shift3D`