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

translate

Apply simple transformations


Description

These functions allow simple transformations to be applied quickly, or in a chosen order. They represent simplified interfaces to the buildAffine and applyTransform functions, and are compatible with the chaining operator from the popular magrittr package (although performing one single transformation may be preferable).

Usage

translate(source, translation, ...)

rescale(source, scales, anchor = c("none", "origin", "centre", "center"), ...)

skew(source, skews, anchor = c("none", "origin", "centre", "center"), ...)

rotate(source, angles, anchor = c("none", "origin", "centre", "center"), ...)

Arguments

source

A 2D or 3D image, in the sense of isImage.

translation

Translations along each axis, in pixunits units. May also be a list, such as that produced by decomposeAffine, with elements for translation, scales, skews and angles.

...

Additional arguments to applyTransform.

scales

Scale factors along each axis.

anchor

The fixed point for the transformation. Setting this parameter to a value other than "none" will override the translation parameter, with the final translation set to ensure that the requested point remains in the same place after transformation.

skews

Skews in the XY, XZ and YZ planes.

angles

Roll, pitch and yaw rotation angles, in radians. If source is two-dimensional, a single angle will be interpreted as being in the plane as expected.

Value

The transformed image.

Author(s)

Jon Clayden <code@clayden.org>

See Also


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.