tf_align() applies the inverse warping function to unregistered data
to obtain aligned (registered) functions.
Usage
tf_align(x, warp, ...)
# S3 method for class 'tfd'
tf_align(x, warp, ..., keep_new_arg = FALSE)
# S3 method for class 'tfb'
tf_align(x, warp, ...)Arguments
- x
tfvector of functions. Fortf_warp(), these should be registered/aligned functions and unaligned functions fortf_align().- warp
tfvector of warping functions used for transformation. See Details.- ...
additional arguments passed to
tfd().- keep_new_arg
keep new
argvalues after (un)warping or returntfdvector onargvalues of the input (defaultFALSEis the latter)? See Details.
See also
Other registration functions:
tf_estimate_warps(),
tf_landmarks_extrema(),
tf_register(),
tf_registration,
tf_warp()
Examples
# Estimate warps, then align manually:
t <- seq(0, 2 * pi, length.out = 101)
x <- tfd(t(sapply(c(-0.3, 0, 0.3), function(s) sin(t + s))), arg = t)
warps <- tf_estimate_warps(x, method = "affine", type = "shift")
#> Warning: ℹ 10 evaluations were `NA`
#> ✖ Returning irregular <tfd>.
#> Warning: ℹ 10 evaluations were `NA`
#> ✖ Returning irregular <tfd>.
aligned <- tf_align(x, warps)
#> Warning: ℹ 10 evaluations were `NA`
#> ✖ Returning irregular <tfd>.
plot(aligned, col = 1:3)