Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2014 Feb 28;9(2):e89470.
doi: 10.1371/journal.pone.0089470. eCollection 2014.

Analytic programming with FMRI data: a quick-start guide for statisticians using R

Affiliations

Analytic programming with FMRI data: a quick-start guide for statisticians using R

Ani Eloyan et al. PLoS One. .

Abstract

Functional magnetic resonance imaging (fMRI) is a thriving field that plays an important role in medical imaging analysis, biological and neuroscience research and practice. This manuscript gives a didactic introduction to the statistical analysis of fMRI data using the R project, along with the relevant R code. The goal is to give statisticians who would like to pursue research in this area a quick tutorial for programming with fMRI data. References of relevant packages and papers are provided for those interested in more advanced analysis.

PubMed Disclaimer

Conflict of interest statement

Competing Interests: The authors have declared that no competing interests exist.

Figures

Figure 1
Figure 1. Anatomy of the HRF.
Figure 2
Figure 2. Resting state fMRI image for 1 subject.
The top panel shows one axial slice from the 3D image acquared at each of the 152 time points. formula image denotes a voxel in the brain with coordinates [46, 64, 37]. The plot below shows the intensity of the image at voxel formula image (on the y-axis) at each time point (the x-axis corresponds to time).
Figure 3
Figure 3. A slice of the fMRI image plotted by using the image() function in R (left) along with the corresponding smoothed slice (right).
Here the red color corresponds to high intensity values, followed by yellow and white as the values decrease.
Figure 4
Figure 4. Stimulus vectors for an event-related design (top) and a block design (bottom).
The spikes correspond to the onsets of stimuli. There is a sustained period of activity/task in the block design. In both cases, the spacings between events can be unequal.
Figure 5
Figure 5. P-value histogram from a group-level test.
Figure 6
Figure 6. A slice of the thresholded output map overlaid on a template brain using the image() function.
Figure 7
Figure 7. Permutation histograms of t-statistics for two voxels.
Figure 8
Figure 8. The default brain network obtained via fastICA and overlaid on a template brain.

References

    1. R Development Core Team (2011) R: a language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. Available: http://www.R-project.org/. ISBN 3-900051-07-0.
    1. Avants BB, Tustison N, Song G (2009) Advanced normalization tools (ANTS). Insight J.
    1. Bordier C, Dojat M, Lafayede Micheaux P (2009) AnalyzeFMRI: an R package to perform statistical analysis on fMRI datasets. Software: R Package, AnalyzeFMRI, version: 1–1.
    1. Whitcher B, Schmid V, Thornton A (2011) oro.nifti: Rigorous-NIfTI input/output. R package version 02 6.
    1. Whitcher B (2010) oro.dicom: Rigorous-DICOM input/output. R package version 02 7.

Publication types