objectCleanse {IFC} | R Documentation |
Object Cleanser
Description
Removes abnormalities (clipped/debris) from image.
Usage
objectCleanse(mat, msk, add_noise = TRUE, random_seed = NULL, bg = 0, sd = 0)
Arguments
mat |
a numeric matrix (image). |
msk |
a numeric matrix (mask identifying abnormalities). |
add_noise |
if TRUE adds normal noise to background using rnorm(), from Rcpp. Default is TRUE. |
random_seed |
a list of elements to pass to set.seed or a single value, interpreted as an integer, or NULL to be used when 'add_noise' is set to TRUE. Default is NULL. Note that NA_integer_ or list(seed = NA_integer_) can be used to not call set.seed at all. |
bg |
mean value of the background added if add_noise is TRUE. Default is 0. |
sd |
standard deviation of the background added if add_noise is TRUE. Default is 0. |
Value
According to msk, pixel values in mat are substituted by either bg [add_noise == FALSE] or rnorm(n = prod(dim(mat), mean=bg, sd=sd)) [add_noise == TRUE].