antsImageSummary.Rd
Overloaded Summary for antsImage objects
# S4 method for class 'antsImage'
Summary(x, ..., mask = NULL, na.rm = FALSE)
max(x, ..., na.rm = FALSE)
min(x, ..., na.rm = FALSE)
# S4 method for class 'antsImage'
min(x, ..., mask = NULL, na.rm = FALSE)
# S4 method for class 'antsImage'
max(x, ..., mask = NULL, na.rm = FALSE)
range(x, ..., na.rm = FALSE)
prod(x, ..., na.rm = FALSE)
sum(x, ..., na.rm = FALSE)
any(x, ..., na.rm = FALSE)
all(x, ..., na.rm = FALSE)
vec <- 1:64
img01 <- as.antsImage(array(vec, c(4, 4, 4, 1)))
testthat::expect_equal(max(img01), max(vec))
max(img01)
#> [1] 64
testthat::expect_equal(min(img01), min(vec))
min(img01)
#> [1] 1
testthat::expect_equal(sum(img01), sum(vec))
range(img01)
#> [1] 1 64
testthat::expect_equal(range(img01), range(vec))
prod(img01 / 25)
#> [1] 0.4317738
testthat::expect_equal(prod(img01 / 25), prod(vec / 25), tolerance = 1e-5)