powered by
Randomize the values within a mask
randomize_mask(img, mask)
Object of class nifti
Object of class nifti with values to be randomized
Binary mask indicating which values should be randomized.
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)
Run the code above in your browser using DataLab