antsImageStats <- function(image, mask = NULL, na.rm = FALSE) {
if (!is.null(mask)) {
mask <- check_ants(mask)
}
image <- antsImageClone(image, out_pixeltype = "double")
res <- ANTsRCore::AntsImageStats(image, mask, na.rm)
check <- !any(sapply(res, is.raw))
if (!check) {
stop("raw output form antsImageStats, please report this bug")
}
res <- lapply(res, drop)
return(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.