FD: Framewise Displacement

Description Usage Arguments Details Value References

View source: R/FD.R

Description

Calculate Framewise Displacement (FD)

Usage

1
2
3
4
5
6
7
8
FD(
  X,
  trans_units = c("mm", "cm", "in"),
  rot_units = c("deg", "rad", "mm", "cm", "in"),
  brain_radius = NULL,
  detrend = FALSE,
  cutoff = 0.3
)

Arguments

X

An N by 6 matrix in which the first three columns represent the translational RPs (trans_units), and the second three columns represent the rotational RPs (rot_units). If rot_units measures an angle, it will be converted to trans_units by measuring displacement on a sphere of radius brain_radius trans_units.

Alternatively, this can be the file path to an N by 6 matrix which can be read with read.table (fields separated by white-space; no header).

trans_units

"mm" for millimeters (default), "cm" for centimeters, or "in" for inches.

rot_units

"deg" for degrees (default), "rad" for radians, or one of the trans_units options.

brain_radius

If rot_units measures an angle, the rotational RPs are transformed to a spatial measurement representing the displacement on a sphere of radius brain_radius trans_units.

If brain_radius is NULL (default), its value will be set to (the equivalent of) 50 mm.

detrend

Detrend each RP with the DCT before computing FD? Default: FALSE. Can be a number of DCT bases to use, or TRUE to use 4.

cutoff

FD values higher than this will be flagged. Default: .3.

Details

The FD formula is taken from Power et. al. (2012):

FD_i = | Δ x_i | + | Δ y_i | + | Δ z_i | + | Δ α_i | + | Δ β_i | + | Δ γ_i |

where i is the timepoint; x, y and z are the translational realignment parameters (RPs); α, β and γ are the rotational RPs; and Δ x_i = x_{i-1} - x_i (and similarly for the other RPs).

Value

A list with components

measure

A length N vector of FD values in trans_units.

measure_info

"FD"

outlier_cutoff

cutoff

outlier_flag

A length-N logical vector, where TRUE indicates suspected outlier presence.

References


neuroconductor/fMRIscrub documentation built on Dec. 22, 2021, 1:10 a.m.