R/ants.extract.R

Defines functions ants.extract

Documented in ants.extract

#' @title Extract values from antsImage from mask
#'
#' @description Just helpful wrapper to convert to array and then take
#' values for which mask is 1
#' @param img image either in array or class \code{antsImage}
#' @param mask binary image either in array or class \code{antsImage}
#' @return Numeric vector
#' @export
ants.extract <- function(
  img, # image either in array or class \code{antsImage}
  mask # binary image either in array or class \code{antsImage}
){
  img = as.array(img)
  mask = as.array(mask)
  img[ mask == 1]
}
neuroconductor/extrantsr documentation built on Sept. 28, 2020, 11:31 a.m.