antsImagemath: Math for antsImage Objects

antsImage-mathR Documentation

Math for antsImage Objects

Description

Overloaded math for antsImage objects

Usage

## S4 method for signature 'antsImage'
Math(x)

## S4 method for signature 'antsImage'
abs(x)

## S4 method for signature 'antsImage'
sign(x)

## S4 method for signature 'antsImage'
sqrt(x)

## S4 method for signature 'antsImage'
ceiling(x)

## S4 method for signature 'antsImage'
round(x)

## S4 method for signature 'antsImage'
floor(x)

## S4 method for signature 'antsImage'
trunc(x)

## S4 method for signature 'antsImage'
log(x, base = exp(1))

## S4 method for signature 'antsImage'
log10(x)

## S4 method for signature 'antsImage'
log2(x)

## S4 method for signature 'antsImage'
acos(x)

## S4 method for signature 'antsImage'
asin(x)

## S4 method for signature 'antsImage'
atan(x)

## S4 method for signature 'antsImage'
acosh(x)

## S4 method for signature 'antsImage'
asinh(x)

## S4 method for signature 'antsImage'
atanh(x)

## S4 method for signature 'antsImage'
cos(x)

## S4 method for signature 'antsImage'
sin(x)

## S4 method for signature 'antsImage'
tan(x)

## S4 method for signature 'antsImage'
cosh(x)

## S4 method for signature 'antsImage'
sinh(x)

## S4 method for signature 'antsImage'
tanh(x)

## S4 method for signature 'antsImage'
cospi(x)

## S4 method for signature 'antsImage'
sinpi(x)

## S4 method for signature 'antsImage'
tanpi(x)

## S4 method for signature 'antsImage'
exp(x)

## S4 method for signature 'antsImage'
gamma(x)

## S4 method for signature 'antsImage'
lgamma(x)

## S4 method for signature 'antsImage'
!x

Arguments

x

is an object of class antsImage.

base

a positive or complex number: the base with respect to which logarithms are computed. Defaults to e=exp(1).

Examples

img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
testthat::expect_true(is.antsImage(abs(img01)))
testthat::expect_true(is.antsImage(sign(img01)))
testthat::expect_true(is.antsImage(sqrt(img01)))
testthat::expect_true(is.antsImage(ceiling(img01)))
testthat::expect_true(is.antsImage(floor(img01)))
testthat::expect_true(is.antsImage(trunc(img01)))
img01 <- as.antsImage(array(1:64, c(4, 4, 4, 1)))
testthat::expect_true(is.antsImage(log(img01)))
testthat::expect_true(is.antsImage(exp(img01)))

testthat::expect_true(is.antsImage(log(img01, base = exp(1))))
testthat::expect_true(is.antsImage(log(img01, base = 2)))
testthat::expect_true(is.antsImage(log(img01, base = 10)))
testthat::expect_true(is.antsImage(log10(img01)))
testthat::expect_true(is.antsImage(log2(img01)))

testthat::expect_true(is.antsImage(gamma(img01)))
testthat::expect_true(is.antsImage(lgamma(img01)))

testthat::expect_true(is.antsImage(cos(img01)))
testthat::expect_true(is.antsImage(cospi(img01)))
testthat::expect_true(is.antsImage(acos(img01)))
testthat::expect_true(is.antsImage(acosh(img01)))

testthat::expect_true(is.antsImage(sin(img01)))
testthat::expect_true(is.antsImage(sinpi(img01)))
testthat::expect_true(is.antsImage(asin(img01)))
testthat::expect_true(is.antsImage(asinh(img01)))

testthat::expect_true(is.antsImage(tan(img01)))
testthat::expect_true(is.antsImage(tanpi(img01)))
testthat::expect_true(is.antsImage(atan(img01)))
testthat::expect_true(is.antsImage(atanh(img01)))

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