Calculate Framewise Displacement (FD)
FD(
X,
trans_units = c("mm", "cm", "in"),
rot_units = c("deg", "rad", "mm", "cm", "in"),
brain_radius = NULL,
detrend = FALSE,
cutoff = 0.3
)
X | An \(N\) by \(6\) matrix in which the first three columns represent the
translational RPs ( Alternatively, this can be the file path to an \(N\) by \(6\) matrix which can be
read with |
---|---|
trans_units |
|
rot_units |
|
brain_radius | If If |
detrend | Detrend each RP with the DCT before computing FD?
Default: |
cutoff | FD values higher than this will be flagged. Default: |
A list with components
A length \(N\) vector of FD values in trans_units
.
"FD"
cutoff
A length-N logical vector, where TRUE
indicates suspected outlier presence.
The FD formula is taken from Power et. al. (2012):
$$FD_i = | \Delta x_i | + | \Delta y_i | + | \Delta z_i | + | \Delta \alpha_i | + | \Delta \beta_i | + | \Delta \gamma_i |$$
where \(i\) is the timepoint; \(x\), \(y\) and \(z\) are the translational realignment parameters (RPs); \(\alpha\), \(\beta\) and \(\gamma\) are the rotational RPs; and \(\Delta x_i = x_{i-1} - x_i\) (and similarly for the other RPs).