remake_img {neurobase} | R Documentation |
Remake Image from Vector
Description
Wrapper function to take a vector of values and result in a
nifti
object
Usage
remake_img(vec, img, mask = NULL, warn = FALSE, ...)
Arguments
vec |
vector of values to be in resulting image |
img |
object of class |
mask |
binary array/ |
warn |
Should a warning be issued if defaulting to FLOAT32? |
... |
additional arguments passed to |
Value
Object of class nifti
See Also
Examples
set.seed(5)
dims = rep(10, 3)
arr = array(rnorm(prod(dims)), dim = dims)
arr[,,10] = 0
nim = oro.nifti::nifti(arr)
remake_img(c(nim), nim)
mask = nim > 5
vals = nim[mask]
vals = sqrt(vals)
remake_img(vals, nim, mask = mask)
[Package neurobase version 1.32.4 Index]