The function can be used to detrend the time series of an fMRI dataset data (of class ''fmridata'' using polynomials. If the argument degree is larger than 0 (default: 1) the polynomial trends up to the given degree are removed from the data. If the argument accoef is larger than 0 (default: 0) prewhitening using an AR(1) model is performed.
References
Polzehl, J. and Tabelow, K. (2007).
fmri: A Package for Analyzing fmri Data,
R News, 7:13-17.
# Example 1 data <- list(ttt=writeBin(rnorm(32*32*32*107),raw(),4),
mask=array(1,c(32,32,32)),dim=c(32,32,32,107))
class(data) <- "fmridata" data <- fmri.detrend(data,2)