Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

affine

Create, test for and print affine matrices


Description

isAffine returns a logical value indicating whether its argument is, or resembles, a 4x4 affine matrix. asAffine converts a suitable matrix to the affine class, attaching the source and target images as attributes. Affine transformations are a class of linear transformations which preserve points, straight lines and planes, and may consist of a combination of rotation, translation, scale and skew operations.

Usage

isAffine(object, strict = FALSE)

asAffine(object, source = NULL, target = NULL)

## S3 method for class 'affine'
print(x, ...)

Arguments

object

An R object.

strict

If TRUE, this function just tests whether the object is of class "affine". Otherwise it also tests for an affine-like 4x4 matrix.

source, target

Source and target images for the transformation.

x

An "affine" object.

...

Additional parameters to methods. Currently unused.

Details

NiftyReg's convention is for affine matrices to transform world coordinates (in the sense of voxelToWorld) from TARGET to SOURCE space, although transforms are logically applied the other way.

Value

A logical value, which is TRUE if object appears to be an affine matrix.

Note

2D affines are a subset of 3D affines, and are stored in a 4x4 matrix for internal consistency, even though a 3x3 matrix would suffice.

Author(s)

Jon Clayden <code@clayden.org>


RNiftyReg

Image Registration Using the 'NiftyReg' Library

v2.7.0
GPL-2
Authors
Jon Clayden [cre, aut] (<https://orcid.org/0000-0002-6608-0619>), Marc Modat [aut], Benoit Presles [aut], Thanasis Anthopoulos [aut], Pankaj Daga [aut]
Initial release
2020-09-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.