View source: R/randomize_mask.R
randomize_mask | R Documentation |
Randomize the values within a mask
randomize_mask(img, mask)
img |
Object of class nifti with values to be randomized |
mask |
Binary mask indicating which values should be randomized. |
Object of class nifti
set.seed(5)
dims = rep(10, 3)
arr = array(rnorm(prod(dims)), dim = dims)
nim = oro.nifti::nifti(arr)
mask = abs(nim) > 1
randomize_mask(nim, mask)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.