flags_to_nuis_spikes: Flags to nuisance spikes

View source: R/flags_to_nuis_spikes.R

flags_to_nuis_spikesR Documentation

Flags to nuisance spikes

Description

Convert flagged volumes to corresponding one-hot encoded vectors which can be used for nuisance regression.

Usage

flags_to_nuis_spikes(flags, n_time)

Arguments

flags

Numeric vector of integers indicating the indices of the flagged volumes. Or, a logical vector of length n_time where TRUE values indicate the flagged volumes.

n_time

The length of the vectors to obtain. For nuisance regression, this is the length of the BOLD data. The highest index in flags should not exceed n_time.

Value

A numeric matrix of ones and zeroes. The number of rows will be n_time and the number of columns will be the number of flags. Each column will have a 1 at the flag index, and 0 elsewhere.


fMRIscrub documentation built on Oct. 25, 2023, 9:07 a.m.