-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
72 lines (57 loc) · 2.23 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
fmriqa
======
[![Travis build status](https://travis-ci.org/martin3141/fmriqa.svg?branch=master)](https://travis-ci.org/martin3141/fmriqa)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/martin3141/fmriqa?branch=master&svg=true)](https://ci.appveyor.com/project/martin3141/fmriqa)
[![](http://cranlogs.r-pkg.org/badges/fmriqa)](http://cran.rstudio.com/web/packages/fmriqa/index.html)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/fmriqa)](https://cran.r-project.org/package=fmriqa)
[![Coverage Status](https://coveralls.io/repos/github/martin3141/fmriqa/badge.svg?branch=master)](https://coveralls.io/github/martin3141/fmriqa?branch=master)
## Overview
The fmriqa package provides an implementation of the fMRI quality assurance (QA)
analysis protocol detailed by Friedman and Glover (2006)
<doi:10.1002/jmri.20583>.
## Installation
You can install the stable version of fmriqa from CRAN:
```{r cran, eval = FALSE}
install.packages("fmriqa", dependencies = TRUE)
```
Or the the development version from GitHub (requires `devtools` package):
```{r github, eval = FALSE}
install.packages("devtools")
devtools::install_github("martin3141/fmriqa")
```
## Usage
```{r basic, eval = FALSE}
# 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()
```
## Real data example
```{r real_data, eval = TRUE}
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)
```
## Simulation example
```{r simulate, eval = TRUE}
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
```
## Plot output from real data showing RF spiking artifact
![](SPIKE_EG_qa_plot.png)