antsImageSummary: Summary for antsImage Objects

antsImage-summaryR Documentation

Summary for antsImage Objects

Description

Overloaded Summary for antsImage objects

Usage

## S4 method for signature 'antsImage'
Summary(x, ..., mask = NULL, na.rm = FALSE)

max(x, ..., na.rm = FALSE)

min(x, ..., na.rm = FALSE)

## S4 method for signature 'antsImage'
min(x, ..., mask = NULL, na.rm = FALSE)

## S4 method for signature '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)

Arguments

x

is an object of class antsImage.

...

further arguments passed to summary methods

mask

binary mask of values to subset

na.rm

logical: should missing values be removed?

Examples

vec <- 1:64
img01 <- as.antsImage(array(vec, c(4, 4, 4, 1)))
testthat::expect_equal(max(img01), max(vec))
max(img01)
testthat::expect_equal(min(img01), min(vec))
min(img01)
testthat::expect_equal(sum(img01), sum(vec))
range(img01)
testthat::expect_equal(range(img01), range(vec))
prod(img01 / 25)
testthat::expect_equal(prod(img01 / 25), prod(vec / 25), tolerance = 1e-5)

stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.