FD: Framewise Displacement

View source: R/FD.R

FDR Documentation

Framewise Displacement

Description

Calculate Framewise Displacement (FD)

Usage

FD(
  X,
  trans_units = c("mm", "cm", "in"),
  rot_units = c("deg", "rad", "mm", "cm", "in"),
  brain_radius = NULL,
  detrend = FALSE,
  TR_for_resp_filt = NULL,
  lag = 1,
  cutoff = 0.4
)

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 (i.e. if it's "deg" or "rad"), the rotational RPs are transformed to a measure of the displacement on a sphere of radius brain_radius trans_units. So this argument should give the radius of the brain, in the units of trans_units. If NULL (default), brain_radius will be set to 50 mm (or 5 cm, or 50/25.4 inches).

If rot_units does not measure an angle, this argument is ignored.

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.

TR_for_resp_filt

Filter out the respiratory frequency? If so, provide the temporal resolution (TR) in seconds, which is needed to calculate the filter. Default: NULL (do not apply a filter).

Power et al. (2019) and Fair et al. (2020) have shown that in multiband data, the RPs may contain head movements which accompany normal respiration, as well as artifactual variance in the phase encode direction at the respiratory frequency. They propose applying a notch filter to the RPs to remove variance within the frequency range of respiration; in particular, Fair et al. (2020) used a second-order IIR filter between 0.31 and 0.43 Hz. Here, we use a 0.31-0.43 Hz Chebyshev Type II stop-gap filter, with 20 dB stopband ripple, from the gsignal package.

The filter will be applied after any detrending. If filtering, consider adjusting cutoff because the baseline FD value will be lowered. Pham (2023) used 0.2 mm.

lag

The difference of indices between which to calculate change in position. Default: 1 (the previous timepoint). Changing this argument sets \Delta x_i = x_{i-lag} - x_i (and similarly for the other RPs).

cutoff

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

Details

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).

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

  • Power, J. D., Barnes, K. A., Snyder, A. Z., Schlaggar, B. L., & Petersen, S. E. (2012). Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion. Neuroimage, 59(3), 2142-2154.

  • Power, J. D., Lynch, C. J., Silver, B. M., Dubin, M. J., Martin, A., & Jones, R. M. (2019). Distinctions among real and apparent respiratory motions in human fMRI data. NeuroImage, 201, 116041.

  • Fair, D. A., Miranda-Dominguez, O., Snyder, A. Z., Perrone, A., Earl, E. A., Van, A. N., ... & Dosenbach, N. U. (2020). Correction of respiratory artifacts in MRI head motion estimates. Neuroimage, 208, 116400.

  • Pham, D. D., McDonald, D. J., Ding, L., Nebel, M. B., & Mejia, A. F. (2023). Less is more: balancing noise reduction and data retention in fMRI with data-driven scrubbing. NeuroImage, 270, 119972.


fMRIscrub documentation built on March 19, 2026, 9:08 a.m.