Learn R Programming

ANTsR (version 1.0)

frequencyFilterfMRI: Band pass filtering for BOLD image.

Description

This function works for a BOLD time-series data

Usage

frequencyFilterfMRI <- function( boldmat, tr, freqLo = 0.01, freqHi = 0.1 , opt=c("trig","stl","butt") )

Arguments

boldMatrix

Time series matrix for bold image

tr = <value>

The sequence's TR value , typically 3 or 4.

freqLo = <value>

The lower frequency limit, e.g. 0.01 in band-pass filter

freqHi = <value>

The higher frequency limit, e.g. 0.1 in band-pass filter

opt = c("trig","butt","stl")

Type of filter to use: butterworth, trigonometric, stl.

Value

output is the filtered time series.

Examples

Run this code
# NOT RUN {
fmat<-replicate(1000, rnorm(200))
k<-1
for ( ftype in c("butt","stl","trig") ) {
  myres<-frequencyFilterfMRI( fmat, tr = 4, freqLo = 0.01, freqHi = 0.05, opt = ftype )
  comparemat<-cbind(fmat[,k],myres[,k])
  plot(ts(comparemat),main=ftype)
  Sys.sleep(0.3)
}
# }

Run the code above in your browser using DataLab