randomize_mask: Randomize Image based on Mask

Description Usage Arguments Value Examples

View source: R/randomize_mask.R

Description

Randomize the values within a mask

Usage

1
randomize_mask(img, mask)

Arguments

img

Object of class nifti with values to be randomized

mask

Binary mask indicating which values should be randomized.

Value

Object of class nifti

Examples

1
2
3
4
5
6
  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)

neuroconductor-devel-releases/neurobase documentation built on May 6, 2020, 4:25 p.m.