remake_img | R Documentation |
Wrapper function to take a vector of values and result in a
nifti
object
remake_img(vec, img, mask = NULL, warn = FALSE, ...)
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 |
Object of class nifti
niftiarr
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.