The fmriqa package provides an implementation of the fMRI quality assurance (QA)
analysis protocol detailed by Friedman and Glover (2006)
You can install the stable version of fmriqa from CRAN:
install.packages("fmriqa", dependencies = TRUE)
Or the the development version from GitHub (requires devtools
package):
install.packages("devtools") devtools::install_github("martin3141/fmriqa")
# load the package library(fmriqa) # get help on the options for run_fmriqa ?run_fmriqa # run the analysis - a file chooser will appear when a data_file argument is not given run_fmriqa()
library(fmriqa) fname <- system.file("extdata", "qa_data.nii.gz", package = "fmriqa") res <- run_fmriqa(data_file = fname, gen_png = FALSE, gen_res_csv = FALSE, tr = 3)
library(fmriqa) library(oro.nifti) # generate random data set.seed(1) sim_data <- array(rnorm(80 * 80 * 1 * 100), dim = c(80, 80, 1, 100)) sim_data[20:60, 20:60, 1, ] <- sim_data[20:60, 20:60, 1, ] + 50 sim_nifti <- oro.nifti::as.nifti(sim_data) fname <- tempfile() writeNIfTI(sim_nifti, fname) # perform qa res <- run_fmriqa(fname, gen_png = FALSE, gen_res_csv = FALSE) res$snr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.