zero_pad | R Documentation |
This function zero pads an image by a certain number of dimensions, usually for convolution
zero_pad(img, kdim, invert = FALSE, pad_value = 0L, ...)
img |
Array or class nifti |
kdim |
Dimensions of kernel |
invert |
(logical) If |
pad_value |
Value to pad the image with. May use other values, such as -1024 for CT data |
... |
Options to |
Object of class nifti
kdim = c(3,3,5)
img = array(rnorm(30*30*36), dim = c(30, 30, 36))
pad = zero_pad(img, kdim)
back = zero_pad(pad, kdim, invert=TRUE)
all.equal(back, img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.