efourier: Elliptical Fourier transforms

Description Usage Arguments Details Functions References See Also Examples

View source: R/core_efourier.R

Description

Elliptical Fourier transforms

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
efourier(x, ...)

## Default S3 method:
efourier(x, nb_h = NA, raw = FALSE, ...)

## S3 method for class 'coo_single'
efourier(x, nb_h = NA, raw = FALSE, ...)

## S3 method for class 'coo_list'
efourier(x, nb_h = NA, ...)

## S3 method for class 'mom_tbl'
efourier(x, nb_h = NA, keep_coo = FALSE, ...)

efourier_i(x, nb_h = NA, nb_pts = 120)

efourier_norm(x, ...)

## Default S3 method:
efourier_norm(x, first_point = FALSE, raw = FALSE, ...)

## S3 method for class 'coe_list'
efourier_norm(x, first_point = FALSE, ...)

## S3 method for class 'mom_tbl'
efourier_norm(x, first_point = FALSE, ...)

Arguments

x

coo_single, coo_list or mom_tbl

...

for generics. Useless here.

nb_h

int nb of harmonics. Default to 6 for efourier, to all of them for efourier_i

raw

logical whether to return raw and full results for efourier and efourier_norm

keep_coo

logical whether to retain coo column

nb_pts

int nb of points for the reconstruction

first_point

logical whether to normalize for the first point using efourier_norm

Details

For the maths behind see the paper in JSS.

Normalization of coefficients has long been a matter of trouble, and not only for newcomers. There are two ways of normalizing outlines: the first, and by far the most used, is to use a "numerical" alignment, directly on the matrix of coefficients. The coefficients of the first harmonic are consumed by this process but harmonics of higher rank are normalized in terms of size and rotation. This is sometimes referred as using the "first ellipse", as the harmonics define an ellipse in the plane, and the first one is the mother of all ellipses, on which all others "roll" along. This approach is really convenient as it is done easily by most software (if not the only option) and by Momocs too. It is the default option of efourier.

But here is the pitfall: if your shapes are prone to bad aligments among all the first ellipses, this will result in poorly (or even not at all) "homologous" coefficients. The shapes particularly prone to this are either (at least roughly) circular and/or with a strong bilateral symmetry. Also, and perhaps more explicitely, morphospace usually show a mirroring symmetry, typically visible when calculated in some couple of components (usually the first two).

If you see these upside-down (or 180 degrees rotated) shapes on the morphospace, you should seriously consider aligning your shapes before the efourier step, and performing the latter with norm = FALSE.

You have several options to align your shapes, using control points (or landmarks), by far the most time consuming (and less reproducible) but possibly the best one too when alignment is too tricky to automate. You can also try Procrustes alignment (see fgProcrustes) (<- todo link 4 here) through their calliper length (see coo_aligncalliper), etc. You should also make the first point homologous either with coo_slide or coo_slidedirection to minimize any subsequent problems.

I will dedicate (some day) a vignette or a paper to this problem.

Functions

References

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp. Ferson S, Rohlf FJ, Koehn RK. 1985. Measuring shape variation of two-dimensional outlines. Systematic Biology 34: 59-68.

See Also

Other morphometrics: dfourier(), npoly(), opoly()

Examples

1
2
3
bot %>% pick() %>% efourier(4) %>% print() %>% efourier_i()
bot$coo[1:2] %>% efourier(4) %>% print() %>% efourier_i() %>% class()
bot[1:3, ] %>% efourier(4) %>% efourier_norm()

MomX/Momocs2 documentation built on May 13, 2020, 4:28 a.m.