ftm: Fast Template Matching via Cross-Correlation

Description Usage Arguments Details Value Author(s) References See Also


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.


ftm(input, mask, template, plot=FALSE, ...)



is a four-dimensional array of signal intensities.


is a three-dimensional array of logical values (voxels to be included are TRUE, and voxels to be excluded are FALSE).


is a three dimensional array (the same structure as mask) that contains the signal intensities associated with the reference data.


is a flag that determines if a plot of the motion correction as a function of the fourth dimension (default = FALSE).


Additional variables passed to the plot function.


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.


A list of objects are returned:


Motion-corrected version of the four-dimensional array.


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


Estimated center of the binary mask.


Brandon Whitcher


Lewis, J.P. (2003) Fast normalized cross-correlation. www.idiom.com/~zilla/

See Also

conv.fft, find.center, shift3D

Search within the dcemri package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.