View source: R/template_matching.R
shift3D | R Documentation |
One axis of the three-dimensional array is translated by an integer amount. This is useful when applying convolution operators in the Fourier domain.
shift3D(A, s, type, fill = 0)
A |
is a three-dimensional array. |
s |
is the integer number of translation steps. |
type |
is a character string using anatomical coordinates assuming a transverse acquisition scheme (“LR” = left-right = x-axis, “AP” = anterior-posterior = y-axis, “SI” = superior-inferior = z-axis). |
fill |
is the quantity used to fill gaps induced by the translations (circular boundary conditions are NOT used). |
A three-dimensional array is returned, the same dimension as the original array, with one dimension translated.
Brandon Whitcher bwhitcher@gmail.com
convFFT
cube <- array(0, rep(20,3)) cube[9:12,9:12,9:12] <- 1 cube.shift <- shift3D(cube, 5, type="AP") par(mfrow=c(1,2), mar=rep(0.5,4)) image(cube[,,10], xlab="", ylab="", axes=FALSE) image(cube.shift[,,10], xlab="", ylab="", axes=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.