pad_vol {fMRItools} | R Documentation |
Pad 3D Array
Description
Pad a 3D array by a certain amount in each direction, along each dimension. This operation is like the opposite of cropping.
Usage
pad_vol(x, padding, fill = NA)
uncrop_vol(x, padding, fill = NA)
Arguments
x |
A 3D array, e.g.
|
padding |
A |
fill |
Value to pad with. Default: |
Value
The padded array
Examples
x <- array(seq(24), dim=c(2,3,4))
y <- pad_vol(x, array(1, dim=c(3,2)), 0)
stopifnot(all(dim(y) == dim(x)+2))
stopifnot(sum(y) == sum(x))
z <- crop_vol(y)$data
stopifnot(identical(dim(x), dim(z)))
stopifnot(max(abs(z - x))==0)
[Package fMRItools version 0.4.7 Index]