Visualize artifact patterns from the results of pscrub. Requires pscrub(..., get_dirs==TRUE).

artifact_images(psx, idx = NULL, use_dt = TRUE)

Arguments

psx

A "scrub_projection" object containing projection scrubbing results.

idx

The timepoints or column indexes for which to compute artifact images. If NULL (default), use the outlying timepoints.

use_dt

If detrended components are available (the "U" matrix of PCA or "M" matrix of ICA), should they be used to compute the artifact images? Otherwise, use the non-detrended components. Default: TRUE.

Value

A list of three: idx, the timepoints for which the artifact images were computed; mean, the "mean" artifact images; and top, the "top" artifact images. The row names of the top artifact images matrix give the index of the top component ("V" in PCA and "S" in ICA) at each timepoint.

Details

Computes two types: "mean" artifact images based on a weighted sum of the projection directions, with weights determined by the scores for each component at the flagged timepoint, and "top" artifact images based on the projection direction with the greatest score at the flagged timepoint.