Description Usage Arguments Value Author(s) Examples
View source: R/frequencyFilterfMRI.R
This function works for a BOLD time-series data
1 | frequencyFilterfMRI(boldmat, tr, freqLo = 0.01, freqHi = 0.1, opt = "butt")
|
boldmat |
Time series matrix for bold image |
tr |
The sequence's TR value , typically 3 or 4. |
freqLo |
The lower frequency limit, e.g. 0.01 in band-pass filter |
freqHi |
The higher frequency limit, e.g. 0.1 in band-pass filter |
opt |
one of 'trig','butt','stl' Type of filter to use: butterworth, trigonometric, stl. |
output is the filtered time series.
Avants BB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | fmat<-replicate(1000, rnorm(200))
k<-1
tr = 4
for ( ftype in c("butt","stl","trig") ) {
myres <- frequencyFilterfMRI( fmat, tr = tr, freqLo = 0.01, freqHi = 0.05, opt = ftype )
comparemat <- cbind( fmat[,k], myres[,k] )
plot( ts( comparemat ), main=ftype )
Sys.sleep(0.3)
# uncomment below to visualize effect of frequency filtering
# temp = spectrum( ts(fmat[,k], frequency=1/tr ) )
# plot( temp$freq, temp$spec, type='l' )
# temp = spectrum( ts(myres[,k], frequency=1/tr ) )
# plot( temp$freq, temp$spec, type='l' )
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.