• We are sorry, but NCBI web applications do not support your browser and may not function properly. More information
Logo of plosonePLoS OneView this ArticleSubmit to PLoSGet E-mail AlertsContact UsPublic Library of Science (PLoS)
PLoS One. 2011; 6(9): e25031.
Published online Sep 20, 2011. doi:  10.1371/journal.pone.0025031
PMCID: PMC3176805

REST: A Toolkit for Resting-State Functional Magnetic Resonance Imaging Data Processing

Ben J. Harrison, Editor


Resting-state fMRI (RS-fMRI) has been drawing more and more attention in recent years. However, a publicly available, systematically integrated and easy-to-use tool for RS-fMRI data processing is still lacking. We developed a toolkit for the analysis of RS-fMRI data, namely the RESting-state fMRI data analysis Toolkit (REST). REST was developed in MATLAB with graphical user interface (GUI). After data preprocessing with SPM or AFNI, a few analytic methods can be performed in REST, including functional connectivity analysis based on linear correlation, regional homogeneity, amplitude of low frequency fluctuation (ALFF), and fractional ALFF. A few additional functions were implemented in REST, including a DICOM sorter, linear trend removal, bandpass filtering, time course extraction, regression of covariates, image calculator, statistical analysis, and slice viewer (for result visualization, multiple comparison correction, etc.). REST is an open-source package and is freely available at http://www.restfmri.net.


Most functional magnetic resonance imaging (fMRI) studies focus on task-state conditions. However, since the first paper of resting-state fMRI (RS-fMRI) [1], RS-fMRI has been drawing more and more attention, especially in recent years [2]. A few studies have indicated that the RS-fMRI signal, i.e., the resting-state blood oxygenation level dependent (BOLD) signal, reflects spontaneous brain activity [3][5]. Compared with resting-state position emission tomography (PET) and single photon emission computerized tomography (SPECT), RS-fMRI has no ionizing radiation. Compared with task-state fMRI, RS-fMRI is easier to perform for both the investigators and participants. Together with recent studies showing promising reliability for RS-fMRI [6][8], the evidence indicates that RS-fMRI may be very helpful in clinical studies. However, data processing toolkit specialized for RS-fMRI is still lacking. The current paper would introduce a novel and open source software package.

The analytical approaches for RS-fMRI can be divided into two categories. One is for measuring the functional relationship between distinct brain regions. This procedure is usually referred to as functional connectivity analysis, for which linear correlation [1] and independent component analysis (ICA) [9] are two frequently used methods. Several toolkits have been proposed for functional connectivity analysis, including the Group ICA of fMRI Toolbox (GIFT; http://icatb.sourceforge.net/groupica.htm) [10], Multivariate Exploratory Linear Optimized Decomposition into Independent Components (MELODIC) [11], the MATLAB Toolbox for Functional Connectivity [12], and the Functional Connectivity Toolbox (http://web.mit.edu/swg/software.htm). Functional connectivity measures the similarity or synchronization of the time courses between distinct brain regions. However, for clinical studies, a result of abnormal functional connectivity between two or more distinct brain regions could not provide direct information as to which brain region is abnormal, as functional connectivity assesses only the relationship between them.

Another category of analytical approaches for RS-fMRI is based on depicting local features of the spontaneous BOLD signal. Two examples are the measurements of regional homogeneity (ReHo) [13] and the amplitude of low frequency fluctuation (ALFF) [1], [14]. By calculating the Kendall coefficient of concordance (KCC), ReHo measures the similarity or synchronization of the time courses within a cluster (e.g., 27 neighboring voxels) [13]. For each single voxel, ALFF measures the magnitude of the fluctuation of the voxel [14]. ReHo and ALFF have been used to study brain disorders including attention deficit hyperactivity disorder (ADHD) [14], [15], schizophrenia [16][18], depression [19], [20], Alzheimer's disease (AD) [21][23], mild cognitive impairment [24], Parkinson disease (PD) [25], epilepsy [26], and posttraumatic stress disorder [27]. Accurate localization of the abnormal spontaneous brain activity is crucial in the clinical treatment of some specific diseases, e.g., focal resection of intractable epilepsy and deep brain stimulation (DBS) for PD and depression. To this end, a convenient toolkit is necessary and important for the analysis of RS-fMRI data for basic and clinical neuroscientists.

Previously, most procedures for data preprocessing and group level statistical analysis have been well implemented in freely available analysis packages such as Statistical Parametric Mapping (SPM) [28], Analysis of Functional NeuroImages (AFNI) [29], and the FMRIB Software Library (FSL) [30]. Meanwhile, there exist implementations of RS-fMRI data analysis combining various commands from AFNI and FSL without an integrated graphical user interface (GUI), among which fcon_1000_script integrates both seed-based and ICA-based functional connectivity analyses and is publicly available [2].

Here we present a MATLAB package named REST (RESting-state fMRI data analysis Toolkit). It represents a publicly available, systematically integrated, and ease-to-use implementation of various RS-fMRI analyses. The software configures various parameters for data analysis easily and quickly with an integrated GUI and also supports batch jobs. Based on MATLAB, REST can exchange files/data with SPM, AFNI, and FSL under the NIfTI-1.1 or ANALYZE™ 7.5 formats. Two measures of local features for RS-fMRI signal analysis, ReHo and ALFF, were implemented as core features in the current version of REST. Given that the Pearson linear correlation is a widely used method in RS-fMRI analysis, it was also implemented in REST. Some additional functions were implemented in REST, including DICOM sorter, linear trend removal, bandpass filtering, regression of covariates, time course extraction, statistical analysis, image calculator, and slice viewer (for result visualization, multiple comparison correction, etc.).


1. Algorithms

In this section, we introduce the three main algorithms in REST: functional connectivity, ReHo, and ALFF.

1.1. Functional connectivity

Since the seminal RS-fMRI study by [1], the Pearson linear correlation has been the most widely used algorithm to measure the functional connectivity in RS-fMRI studies. REST also uses the Pearson correlation to calculate functional connectivity between two time courses:

equation image

where An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e002.jpg is the Pearson correlation coefficient, An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e003.jpg and An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e004.jpg are the mean values of time course x and y, respectively.

In the literature [31], some covariates are usually regressed out before functional connectivity analysis, including the time courses of head motion (three for translation and three for rotation), mean time course of the entire brain (or global trend), white matter, and cerebrospinal fluid (CSF). REST supports these regression procedures with some predefined (user-defined or default) masks. The default masks in REST were made from the a priori templates found in SPM (http://www.fil.ion.ucl.ac.uk/spm) as follows: the whole brain mask (named BrainMask_05_61x73x61.img/hdr) was from brainmask.nii with a threshold at 50% probability, the white matter mask (named WhiteMask_09_61x73x61.img/hdr) was from white.nii with a threshold at 90% probability, and the CSF mask (named CsfMask_07_61x73x61.img/hdr) was from csf.nii with a threshold at 70% probability. Partial correlation will be performed if the aforementioned covariates are added. It should be noted that removal of the global mean signal is still controversial in RS-fMRI [32], [33]. It has been proposed that the anti-correlation which has been widely reported (e.g., [31]) was most likely due to the removal of the global mean signal [33].

1.2. Regional homogeneity (ReHo)

The computation of ReHo in REST has been previously described in [13]. Briefly, Kendall's coefficient of concordance (KCC) for the time course of a voxel with those of its nearest neighbors (6, 18, and 26, respectively) is calculated in a voxel-wise way as follows:

equation image

where W is the KCC of a cluster, ranging from 0 to 1; An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e006.jpg is the sum rank of the ith time point; An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e007.jpg = (K(n+1))/2 is the mean of the An external file that holds a picture, illustration, etc.
Object name is pone.0025031.e008.jpg's; K is the number of time courses within a measured cluster (here, K = 7, 19, and 27, respectively; one chosen voxel plus the number of its neighbors); and n is the number of ranks. From this equation, an individual ReHo map is obtained. For PET studies, an individual image is usually divided by the global mean value to minimize inter-individual variability [34]. REST also includes this normalization procedure in the ReHo calculation. In the other words, an individual ReHo map could be divided by the mean ReHo value of voxels within a specific mask (whole brain mask or user-defined mask).

1.3. Amplitude of low frequency fluctuations (ALFF)

Many studies have suggested that the low frequency fluctuations found in RS-fMRI BOLD signals contain physiologically meaningful information and are closely related to spontaneous neuronal activities [1], [3], [35][37]. On the basis of the root mean square in the paper [1], Zang et. al. [14] used the average of the amplitude of the low frequency band (i.e., ALFF) as an index of magnitude for the spontaneous neuronal activity.

ALFF is defined as the mean square root of the power spectrum density over the low frequency band (usually 0.01~0.08 Hz). After an individual ALFF map is obtained, a standardization procedure can be performed as done in the ReHo analysis, i.e., the individual ALFF map is divided by the mean ALFF value of voxels within a specific mask (whole brain mask or user-defined mask).

It has been suggested that ALFF reflects the intensity of regional spontaneous brain activity. However, it is sensitive to the physiological noise found in some brain regions, such as in the cistern areas [14]. An improved ALFF approach, namely, fractional ALFF (fALFF) [38], is implemented in REST. fALFF is calculated as the ratio of the power spectrum of low-frequency signals (usually 0.01~0.08 Hz) to that of the entire frequency range (e.g., 0~0.25 Hz for TR = 2 s). This procedure has been used in near infrared spectroscopy study [39]. fALFF could significantly suppress the high frequency noise found in the cistern areas. It has been shown that the brain areas within the default mode network, including the posterior cingulate cortex (PCC), precuneus, medial prefrontal cortex (MPFC), and bilateral inferior parietal lobule (IPL), have significantly higher fALFF than the global mean fALFF [38].

Users can also choose specific frequency bands for analysis. A recent study found that the amplitude over a frequency band of 0.027~0.073 Hz is more specific to the basal ganglia than other frequency bands [7]. It was found that the decreased ALFF in amnestic mild cognitive impairment was more prominent in a frequency band of 0.01~0.027 Hz [40].

2. Usage

Installation of REST is quite easy: download the most recent version from http://www.restfmri.net, extract the compressed package to a predefined directory, and then add the full path to MATLAB's search path. REST is compatible with MATLAB version 6.5 or higher. And REST's compatibility has been tested under Windows Xp and Fedora 4. Almost all REST functions only need MATLAB basic run time environment.

Entering “rest” in the MATLAB command window will open REST's GUI (Fig. 1). The purple buttons seen in the GUI window allow access to the methods available for RS-fMRI data analysis. The “Help” button in REST will guide users to the RS-fMRI online forum (http://forum.restfmri.net) for more detailed information.

Figure 1
The main interface of REST.

2.1. Functional connectivity

Functional connectivity computation requires the user to define an ROI and optional covariates (such as the time courses of head motion, global mean, white matter, and CSF) as seen in the middle part of Fig. 2.

Figure 2
A demonstration of functional connectivity analysis.

After the user clicks the “Fun. Connectivity” button in Fig. 1, Fig. 2 will be displayed. The button marked “Voxel wise” allows the user to define parameters for calculating the linear correlation between a reference time course (from an ROI or elsewhere) and the time course of each voxel within the entire brain or within a predefined mask. The “ROI wise” button allows the definition of parameters for calculating the linear correlation between several ROIs, and pair-wise linear correlations will be calculated. The “Covariables” button allows the user to add covariates in a text file format.

If the option “Fisher Z-score transformation within the mask” is checked, the z map, in addition to the r map, will be generated.

2.2. ReHo

After the user selects the “ReHo” button in the main interface (Fig. 1), the window illustrated in Fig. 3 will be available for ReHo analysis. In the center of the window, “cluster size” refers to the number of nearest neighbor voxels (7, 19, or 27) to be used in the analysis. In the lower part of the window, the option to “Divide ReHo brain by the mean within the mask…” will generate results with this additional data. Other parameters in the interface are similar to those found in the functional connectivity analysis.

Figure 3
The ReHo computation GUI of REST.

2.3. ALFF and fALFF

After the user clicks on the “ALFF” button in the main interface (Fig. 1), the window found in Fig. 4 will come up for ALFF analysis. To transform time domain data to the frequency domain, REST uses the fft (MATLAB version below 7.3) or fftw (MATLAB version 7.3 or higher) function found in MATLAB. The amount of zero padding for the FFT is the same as the amount used in AFNI's power spectrum calculation with the option “shortest FFT length”. This specific zero padding can avoid default FFT length variability across MATLAB versions. Other parameters in the interface are similar to those in the ReHo analysis. The calculation of fALFF is similar to that of ALFF, although bandpass filtering should not be performed. The fraction of the amplitude at low frequency (0.01~0.08) to that of the full frequency spectrum is calculated.

Figure 4
The ALFF computation GUI of REST.

3. An example of RS-fMRI data analysis using REST

3.1. Participants and data acquisition

Twenty right-handed participants (11 males, aged 19–22 years) with no history of neurological or psychiatric disorders took part in this study. All participants were recruited from the campus of Beijing Normal University. The present study was approved by the Ethics Committee of State Key Laboratory of Cognitive Neuroscience and Learning, Beijing Normal University. Written informed consent was obtained from each participant.

MRI data were acquired using a SIEMENS TRIO 3-Tesla scanner in the Imaging Center for Brain Research, Beijing Normal University. Participants lay supine with their heads snugly fixed by a belt and foam pads to minimize head movement. The functional images were obtained by using an echo-planar imaging sequence with the following parameters: 33 axial slices, slice thickness/gap = 3/0.6 mm, in-plane resolution = 64×64, TR = 2000 ms, TE = 30 ms, flip angle = 90°, FOV = 200×200 mm2. In addition, a three-dimensional T1-weighted magnetization-prepared rapid gradient echo (MPRAGE) sagittal image was acquired covering the entire brain (128 slices, TR = 2530 ms, TE = 3.39 ms, slice thickness = 1.33 mm, flip angle = 7°, inversion time = 1100 ms, FOV = 256×256 mm, in-plane resolution = 256×192). During the fMRI scanning, participants were instructed to keep as motionless as possible and to not think systematically. After the scanning session, all participants reported that they did not fall asleep during scanning.

3.2. Data preprocessing

The first ten volumes of each functional time course were discarded to allow for T1 equilibrium and to allow the participants to adapt. Slice timing, head motion correction, and spatial normalization were conducted by using SPM5 (http://www.fil.ion.ucl.ac.uk/spm). No participant had head motion with more than 2.0 mm maximum displacement in any direction or 2.0° of any angular motion throughout the course of the scan. REST was then used for linear trend removal and temporal band-pass filtering (0.01~0.08 Hz) [1], [41].

3.3. Functional connectivity analysis

The preprocessed data were spatially smoothed (full width at half maximum (FWHM) = 6 mm) by SPM5. In the REST window for functional connectivity analysis, a spherical region of interest (ROI) (radius = 10 mm) was defined, centered at a coordinate (0, −56, 30) within the PCC [42]. For each participant, the mean time course within this ROI was used as the reference time course. A seed correlation analysis was then performed in a voxel-wise manner with the averaged time courses of the whole brain, the white matter, the CSF, and the six head motion parameters as covariates. Individual r-maps were normalized to Z-maps by using Fisher's Z transformation [43]. All Fisher's Z-maps were entered into a two-sided one-sample t-test to detect the regions showing significant functional connectivity with the PCC.

3.4. ReHo analysis

In this procedure, 27 nearest neighboring voxels were defined as a cluster and a KCC value (ranging from 0 to 1) was given to the voxel at the center of this cluster [13]. In the window controlling ReHo analysis for REST, the individual ReHo map was generated and divided by that participant's global mean KCC value within the brain mask for standardization purpose. The ReHo maps were then spatially smoothed (FWHM = 6 mm) using SPM5. One-sided one-sample t-tests were performed to show where in the brain the standardized KCC value was significantly larger than one.

3.5. ALFF analysis and fALFF

The preprocessed data were spatially smoothed (FWHM = 6 mm) by SPM5 before ALFF calculation. In the window for ALFF analysis within REST, the frequency band between 0.01 to 0.08 Hz was selected, and the individual ALFF map was generated [14]. The individual ALFF map was normalized by the individual's global mean ALFF as done in the ReHo analysis. One-sided one-sample t-tests were performed to show where in the brain the standardized ALFF value was significantly larger than one. The calculation of fALFF was similar to that of ALFF, but bandpass filtering was not performed. The fraction of the amplitude of low frequency signals (0.01~0.08) to that of the full frequency spectrum was calculated.

3.6. Statistical analysis

One-sample t-tests were performed on the above functional connectivity Z-maps, ReHo maps, ALFF maps, and fALFF maps, respectively, by using the “Statistical Analysis” methodology as implemented in REST (See “Additional Functions”). The statistical result of each method was corrected for multiple comparisons using the “AlphaSim” implementation in REST (See “Slice Viewer” in “Additional Functions”). This function is based on the Monte Carlo simulation in AFNI (see the AlphaSim command description at http://afni.nimh.nih.gov/afni/doc/manual/AlphaSim). A combination threshold of voxels' P<0.001 and cluster size >351 mm3 was considered significant, which corresponded with a corrected P<0.05. All within-group statistical maps obtained from the above steps were superimposed on the anatomical template (Ch2.nii) originally found in MRIcro (http://www.cabiatl.com/mricro/) by using the “Slice Viewer” routine in REST for presentation purpose.

3.7. Primary Results of the Example

As shown in Fig. 5, some brain areas including PCC, MPFC, and bilateral IPL showed significantly higher ReHo or ALFF than the global mean. Functional connectivity analysis showed that the PCC had significant positive functional connectivity with the default mode network and significant negative functional connectivity with the attention network. These results for functional connectivity, ReHo, ALFF, and fALFF were consistent with those reported in previous studies [7], [14], [31], [38], [42], [44], [45].

Figure 5
Results of one-sample t-tests (P<0.05, corrected).

4. Additional functions

4.1. REST DICOM Sorter

Most MRI scanners produce data in Digital Imaging and Communications in Medicine (DICOM) format. The “REST DICOM Sorter” reads DICOM files by using existing routines (dicominfo and dicomread) in the MATLAB distribution and then classifies the DICOM files participant by participant and session by session. There is an option to anonymize the participants' private information (name, ID, and birthday) within the DICOM files.

4.2. NIfTI.nii to NIfTI. Pairs

This routine is for converting single NIfTI.nii (3D or 4D) file(s) to NIfTI 3D pair(s) (.hdr/.img) for the convenience of FSL users. This utility supports batch mode.

4.3. Reslice Image

This routine is for reslicing images to a new voxel size and new bounding box. There are several options to keep the original space or to define the new target space with an input image. The new voxel size is specified by a 1×3 matrix (such as [3 3 3]). The interpolation method can be specified by 0, 1, 2, …, n (0: Nearest Neighbor. 1: Trilinear. 2, …, n: 2nd, …, nth degree B-spline). The nearest neighbor is applied on the mask file (only integer). The routine is based on SPM (http://www.fil.ion.ucl.ac.uk/spm/).

4.4. Detrend

Previous studies have demonstrated that systematic signal increase or decrease occurs over time due to long-term physiological shifts, movement related noise remaining after realignment or instrumental instability [46], [47]. The linear trend is usually removed in fMRI data preprocessing. In REST, the linear trend is estimated with a least-square fitting of a straight line and then is subtracted from the data. After that, the original mean value of each time course is added back.

4.5. Bandpass filtering

REST uses an ideal rectangle window to do band-pass filtering as does the equivalent command in AFNI (3dFourier -retrend). The ideal filter transforms the time course into the frequency domain by using the discrete Fourier transform and adds zeros to extend the frequency coverage, then transforms back to the time domain by using the inverse discrete Fourier transform. If the user input for the lower limit of the band range is zero, REST will do a low-pass filtering and, similarly, if the input for higher limit of the band range is greater than the Nyquist frequency, REST will do a high-pass filtering.

4.6. Extract ROI Time Course

This routine is for extracting the mean time course of the voxels within a specified ROI. It could be also used to extract the time course of a single voxel. This utility supports batch mode. The extracted time courses are written as both text files and mat files.

4.7. Regress out covariates

This routine is for regressing out some nuisance covariates. The format for inputting the covariates should be in a text file. The text file must contain one or more columns, each representing a covariate.

4.8. REST Image Calculator

Inspired by the “ImCalc” GUI in SPM and “3dcalc” command line in AFNI, we developed the “REST Image Calculator” to support simple computation on individual images (referred to as i1, i2, i3, …) and group images (g1, g2, g3, …). The expression can be a standard MATLAB expression such as the following examples (a–g) or one of the special functions (h and i):

4.8.1. g1-1: Subtract 1 from each image in group 1 (g1).

4.8.2. g1-g2: Subtract an image in group 2 (g2) from its corresponding image in group 1 (g1).

4.8.3. i1-i2: Subtract an image (i2) from another image (i1).

4.8.4. i1>100: Make a binary mask image at an intensity threshold of 100.

4.8.5. g1>100: Make binary mask images of g1 at an intensity threshold of 100.

4.8.6. g1.* (i1>100): Make a mask image from an image (i1) and then apply it to each image in group 1 (g1).

4.8.7. mean (g1): Generate a mean image of group 1 (g1).

(g) (i1-mean(g1))./std(g1): This example is for the comparison of an individual image with a large group of images, e.g., a patient image with a large group of normal images. The distribution for group 1 (g1) should be normal and the sample size must be large enough (e.g., >100). The resultant Z score map may indicate areas that may be considered to be ‘abnormal’.

4.8.8. corr (g1, g2, “temporal”): Calculate the temporal correlation between 2 4D-images g1 and g2. This can also be used to calculate the correlation between two groups of 3D images, e.g., the correlation between ReHo and ALFF across participants in a voxel-wise way. The output is a correlation coefficient map.

4.8.9. corr (g1, g2, “spatial”): Calculate the spatial correlation between two corresponding 3D images in two groups (number of images ranging from 1 to n). The output is a text file.

4.9. Statistical Analysis

This section currently supports one-sample T-test, two sample T-test (covariates are optional), paired T-test, one-way ANOVA (or ANCOVA), and linear correlation analysis (covariates are optional). The covariates could be a group of images. For example, the gray matter density can be regressed out in a voxel-wise way when a two-sample T-test is performed between two groups of functional images [48]. The covariates could also be text files. Each text covariate file must correspond to a group of images that are to be compared. The text files (e.g., two text files for two-sample T-test) will be concatenated during analysis. The correlation analysis supports correlation between a text file (e.g., IQ.txt) and a group of images (e.g., ReHo maps of a group of participants). If the covariates are added into the correlation analysis, a partial correlation will be performed. The “Statistical Analysis” portion of REST supports images as covariates in the same way as the function “voxel-dependent EVs” (explainable variables) in FSL (http://www.fmrib.ox.ac.uk/fsl/feat5/detail.html). An example for the “REST One-way ANOVA (or ANCOVA)” GUI is shown in Fig. 6 and the “REST Correlation Analysis” GUI is shown in Fig. 7.

Figure 6
The “REST One-way ANOVA (or ANCOVA)” GUI.
Figure 7
The “REST Correlation Analysis” GUI.

4.10. REST Slice Viewer

REST Slice Viewer is a routine for displaying results. The results can be overlaid on a structural image. A color-bar was designed to illustrate the threshold. By clicking the button “Click to Toggle hdr info”, miscellaneous information about the underlay image and the overlay image will be listed, including dimension, voxel size, and origin. It supports some common functions for image-displaying and image-processing, including yoking, montage, orthogonal views, threshold setting, and multiple comparison correction (false discovery rate and AlphaSim under the pulling menu “Misc”). For the false discovery rate, a one-tailed test (like that usually used in SPM, http://www.fil.ion.ucl.ac.uk/spm/) or a two-tailed test can be selected. We recommend using a two-tailed test in most cases. AlphaSim is the same as the command found in AFNI [29] also called ‘AlphaSim’ and is based on a Monte Carlo simulation. “REST Slice Viewer” also reports information about the clusters, including the number of voxels, peak coordinates (in MNI system), anatomical term of location, and peak intensity of each cluster. The cluster report is based on “xjview” (by Xu Cui, http://www.alivelearn.net/xjview/). The REST Slice Viewer GUI is shown in Fig. 8.

Figure 8
The REST Slice Viewer GUI.

4.11. Power Spectrum

This utility presents a voxel's time course and its power spectrum. It can be used to help check the quality of the fMRI signal. Users need to specify the folder which contains the functional images. As shown in Fig. 9, the time course and the corresponding power spectrum will be shown (Fig. 9A) when a voxel is selected (Fig. 9B). There is an option to remove any linear trend in the time course before calculating the power spectrum.

Figure 9
The power spectrum (upper plot in A) and corresponding time course (lower plot in A).


MATLAB is the runtime engine of REST and therefore some shortcomings of MATLAB, such as inefficient memory management, also exist in REST. Because MATLAB allocates continuous memory for a large matrix, it is a common phenomenon to encounter the “out of memory” error. To reduce the possibility of such a fatal error, REST uses a “space exchanging time” strategy. REST cuts a whole brain 4D dataset into several smaller 4D datasets, and after some memory consuming calculations, REST rebuilds the whole brain 4D dataset. With this strategy, REST can deal with large fMRI dataset with more than 1000 time points on most personal computers.

RS-fMRI studies have provided a few useful computational methods (e.g., functional connectivity, ReHo, and ALFF) for understanding both the physiology and pathophysiology of the spontaneous activity of the human brain. However, the analytic toolkits for RS-fMRI still largely need to be improved. REST was developed as a specialized software package for processing RS-fMRI data. It integrates many calculation methods used in RS-fMRI studies such as functional connectivity, ReHo, and ALFF. It also implements additional functions. REST is an open-source package and provides a framework for implementing more methods. For example, fractional ALFF (fALFF) [38] was implemented in REST v1.3 by Dr. CHENG Wen-lian (See Acknowledgements). A processing pipeline named the Data Processing Assistant for Resting-State fMRI (DPARSF, http://www.restfmri.net, [49]) was implemented based on REST and SPM. A Granger causality analysis package named REST-GCA was developed (Abstract by [50]; See also http://www.restfmri.net). REST is freely available at http://www.restfmri.net. It has been used in RS-fMRI data analysis in a number of recent publications (e.g., [18], [24], [27], [51][54]).

Availability and Future Directions

REST is freely available at http://www.restfmri.net (previously at http://resting-fmri.sourceforge.net before 2008-12-01). The test dataset is available on request. The website http://www.restfmri.net is dedicated to resting-state fMRI research online forum. Users can ask questions and give comments on REST and anything about RS-fMRI. The modular source code analysis of REST based on m2html (http://www.artefact.tk/software/matlab/m2html/, by Guillaume Flandin) is also available (http://restfmri.net/pub/rest_20090422/doc/) to help researchers easily extend REST function or implement new algorithms. Any possible extensions of REST would be welcome and appreciated, since REST is open source in the RS-fMRI community. The full application programming interface (API) could be checked in each REST's script and all the GUI scripts in REST could be regarded as calling samples. Furthermore, DPARSF (http://www.restfmri.net) could be thought as a very good REST's API calling example. ReHo, ALFF/fALFF, functional connectivity computation could be done in scripts like command lines. Some examples could be found in http://restfmri.net/forum/REST_in_scripts.


The authors wish to thank Dr. CHENG Wen-Lian (Department of Medical Imaging, Jinling Hospital, Nanjing University) for her fALFF implementation.


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

Funding: This work was funded by the National High Technology Program of China (863, No. 2008AA02Z405), the Natural Science Foundation of China (30770594, 81020108022), and the Program for Changjiang Scholars and Innovative Research Team in University (PCSIRT). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.


1. Biswal B, Yetkin FZ, Haughton VM, Hyde JS. Functional connectivity in the motor cortex of resting human brain using echo-planar MRI. Magn Reson Med. 1995;34:537–41. doi: 10.1002/mrm.1910340409. [PubMed]
2. Biswal BB, Mennes M, Zuo X-N, Gohel S, Kelly C, et al. Toward discovery science of human brain function. Proceedings of the National Academy of Sciences. 2010;107:4734–4739. doi: 10.1073/pnas.0911855107. [PMC free article] [PubMed]
3. Logothetis NK, Pauls J, Augath M, Trinath T, Oeltermann A. Neurophysiological investigation of the basis of the fMRI signal. Nature. 2001;412:150–7. doi: 10.1038/35084005. [PubMed]
4. Pelled G, Goelman G. Different physiological MRI noise between cortical layers. Magn Reson Med. 2004;52:913–6. doi: 10.1002/mrm.20229. [PubMed]
5. Rauch A, Rainer G, Logothetis NK. The effect of a serotonin-induced dissociation between spiking and perisynaptic activity on BOLD functional MRI. Proc Natl Acad Sci U S A. 2008;105:6759–64. doi: 10.1073/pnas.0800312105. [PMC free article] [PubMed]
6. Shehzad Z, Kelly AMC, Reiss PT, Gee DG, Gotimer K, et al. The Resting Brain: Unconstrained yet Reliable. Cerebral Cortex. 2009;19:2209–2229. doi: 10.1093/cercor/bhn256. [PMC free article] [PubMed]
7. Zuo XN, Di Martino A, Kelly C, Shehzad ZE, Gee DG, et al. The oscillating brain: complex and reliable. Neuroimage. 2010;49:1432–45. doi: 10.1016/j.neuroimage.2009.09.037. [PMC free article] [PubMed]
8. Zuo X-N, Kelly C, Adelstein JS, Klein DF, Castellanos FX, et al. Reliable intrinsic connectivity networks: Test-retest evaluation using ICA and dual regression approach. Neuro Image. 2010;49:2163–2177. doi: 10.1016/j.neuroimage.2009.10.080. [PMC free article] [PubMed]
9. Kiviniemi V, Kantola JH, Jauhiainen J, Hyvarinen A, Tervonen O. Independent component analysis of nondeterministic fMRI signal sources. Neuroimage. 2003;19:253–60. doi: 10.1016/S1053-8119(03)00097-1. [PubMed]
10. Calhoun VD, Adali T, Pearlson GD, Pekar JJ. A method for making group inferences from functional MRI data using independent component analysis. Hum Brain Mapp. 2001;14:140–51. doi: 10.1002/hbm.1048. [PubMed]
11. Beckmann CF, Smith SM. Probabilistic independent component analysis for functional magnetic resonance imaging. IEEE Trans Med Imaging. 2004;23:137–52. doi: 10.1109/TMI.2003.822821. [PubMed]
12. Zhou D, Thompson WK, Siegle G. MATLAB toolbox for functional connectivity. Neuroimage. 2009;47:1590–607. doi: 10.1016/j.neuroimage.2009.05.089. [PMC free article] [PubMed]
13. Zang Y, Jiang T, Lu Y, He Y, Tian L. Regional homogeneity approach to fMRI data analysis. Neuroimage. 2004;22:394–400. doi: 10.1016/j.neuroimage.2003.12.030. [PubMed]
14. Zang YF, He Y, Zhu CZ, Cao QJ, Sui MQ, et al. Altered baseline brain activity in children with ADHD revealed by resting-state functional MRI. Brain Dev. 2007;29:83–91. doi: 10.1016/j.braindev.2006.07.002. [PubMed]
15. Cao Q, Zang Y, Sun L, Sui M, Long X, et al. Abnormal neural activity in children with attention deficit hyperactivity disorder: a resting-state functional magnetic resonance imaging study. Neuroreport. 2006;17:1033–6. doi: 10.1097/01.wnr.0000224769.92454.5d. [PubMed]
16. Liu H, Liu Z, Liang M, Hao Y, Tan L, et al. Decreased regional homogeneity in schizophrenia: a resting state functional magnetic resonance imaging study. Neuroreport. 2006;17:19–22. doi: 10.1097/01.wnr.0000195666.22714.35. [PubMed]
17. Hoptman MJ, Zuo X-N, Butler PD, Javitt DC, D'Angelo D, et al. Amplitude of low-frequency oscillations in schizophrenia: A resting state fMRI study. Schizophrenia Research. 2010;117:13–20. doi: 10.1016/j.schres.2009.09.030. [PMC free article] [PubMed]
18. Lui S, Li T, Deng W, Jiang L, Wu Q, et al. Short-term Effects of Antipsychotic Treatment on Cerebral Function in Drug-Naive First-Episode Schizophrenia Revealed by “Resting State” Functional Magnetic Resonance Imaging. Arch Gen Psychiatry. 2010;67:783–792. doi: 10.1001/archgenpsychiatry.2010.84. [PubMed]
19. Yao ZJ, Wang L, Lu Q, Liu HY, Teng GJ. Regional homogeneity in depression and its relationship with separate depressive symptom clusters: A resting-state fMRI study. JOURNAL OF AFFECTIVE DISORDERS. 2009;115:430–438. doi: 10.1016/j.jad.2008.10.013. [PubMed]
20. Yuan Y, Zhang Z, Bai F, Yu H, Shi Y, et al. Abnormal neural activity in the patients with remitted geriatric depression: a resting-state functional magnetic resonance imaging study. J Affect Disord. 2008;111:145–52. doi: 10.1016/j.jad.2008.02.016. [PubMed]
21. Bai F, Zhang ZJ, Yu H, Shi YM, Yuan YG, et al. Default-mode network activity distinguishes amnestic type mild cognitive impairment from healthy aging: A combined structural and resting-state functional MRI study. NEUROSCIENCE LETTERS. 2008;438:111–115. doi: 10.1016/j.neulet.2008.04.021. [PubMed]
22. He Y, Wang L, Zang YF, Tian LX, Zhang XQ, et al. Regional coherence changes in the early stages of Alzheimer's disease: A combined structural and resting-state functional MRI study. NEUROIMAGE. 2007;35:488–500. doi: 10.1016/j.neuroimage.2006.11.042. [PubMed]
23. Liu Y, Wang K, Yu CS, He Y, Zhou Y, et al. Regional homogeneity, functional connectivity and imaging markers of Alzheimer's disease: A review of resting-state fMRI studies. NEUROPSYCHOLOGIA. 2008;46:1648–1656. doi: 10.1016/j.neuropsychologia.2008.01.027. [PubMed]
24. Wang Z, Yan C, Zhao C, Qi Z, Zhou W, et al. Spatial patterns of intrinsic brain activity in mild cognitive impairment and alzheimer's disease: A resting-state functional MRI study. Hum Brain Mapp. 2010:n/a–n/a. doi: 10.1002/hbm.21140. [PubMed]
25. Wu T, Long XY, Zang YF, Wang L, Hallett M, et al. Regional Homogeneity Changes in Patients With Parkinson's Disease. HUMAN BRAIN MAPPING. 2009;30:1502–1510. doi: 10.1002/hbm.20622. [PubMed]
26. Zhang Z, Lu G, Zhong Y, Tan Q, Yang Z, et al. Impaired attention network in temporal lobe epilepsy: A resting FMRI study. Neuroscience Letters. 2009;458:97–101. doi: 10.1016/j.neulet.2009.04.040. [PubMed]
27. Lui S, Huang X, Chen L, Tang H, Zhang T, et al. High-field MRI reveals an acute impact on brain function in survivors of the magnitude 8.0 earthquake in China. Proceedings of the National Academy of Sciences. 2009;106:15412–15417. doi: 10.1073/pnas.0812751106. [PMC free article] [PubMed]
28. Friston KJ, Holmes AP, Worsley KJ, Poline JB, Frith C, et al. Statistical Parametric Maps in Functional Imaging: A General Linear Approach. Human Brain Mapping. 1995;2:189–210. doi:
29. Cox RW. AFNI: software for analysis and visualization of functional magnetic resonance neuroimages. Comput. Biomed. Res. 1996;29:162–173. doi: 10.1006/cbmr.1996.0014. [PubMed]
30. Smith SM, Jenkinson M, Woolrich MW, Beckmann CF, Behrens TEJ, et al. Advances in functional and structural MR image analysis and implementation as FSL. NeuroImage. 2004;23:S208–S219. doi: 10.1016/j.neuroimage.2004.07.051. [PubMed]
31. Fox MD, Snyder AZ, Vincent JL, Corbetta M, Van Essen DC, et al. The human brain is intrinsically organized into dynamic, anticorrelated functional networks. Proc Natl Acad Sci U S A. 2005;102:9673–8. doi: 10.1073/pnas.0504136102. [PMC free article] [PubMed]
32. Fox MD, Zhang D, Snyder AZ, Raichle ME. The Global Signal and Observed Anticorrelated Resting State Brain Networks. Journal of Neurophysiology. 2009;101:3270–3283. doi: 10.1152/jn.90777.2008. [PMC free article] [PubMed]
33. Murphy K, Birn RM, Handwerker DA, Jones TB, Bandettini PA. The impact of global signal regression on resting state correlations: are anti-correlated networks introduced? Neuroimage. 2009;44:893–905. doi: 10.1016/j.neuroimage.2008.09.036. [PMC free article] [PubMed]
34. Raichle ME, MacLeod AM, Snyder AZ, Powers WJ, Gusnard DA, et al. A default mode of brain function. Proceedings of the National Academy of Sciences of the United States of America. 2001;98:676–682. doi: 10.1073/pnas.98.2.676. [PMC free article] [PubMed]
35. Goldman RI, Stern JM, Engel J, Cohen MS. Simultaneous EEG and fMRI of the alpha rhythm. Neuroreport. 2002;13:2487–2492. doi: 10.1097/01.wnr.0000047685.08940.d0. [PMC free article] [PubMed]
36. Lu H, Zuo Y, Gu H, Waltz JA, Zhan W, et al. Synchronized delta oscillations correlate with the resting-state functional MRI signal. Proceedings of the National Academy of Sciences. 2007;104:18265–18269. doi: 10.1073/pnas.0705791104. [PMC free article] [PubMed]
37. Mantini D, Perrucci MG, Del Gratta C, Romani GL, Corbetta M. Electrophysiological signatures of resting state networks in the human brain. Proceedings of the National Academy of Sciences. 2007;104:13170–13175. doi: 10.1073/pnas.0700668104. [PMC free article] [PubMed]
38. Zou QH, Zhu CZ, Yang Y, Zuo XN, Long XY, et al. An improved approach to detection of amplitude of low-frequency fluctuation (ALFF) for resting-state fMRI: fractional ALFF. J Neurosci Methods. 2008;172:137–41. doi: 10.1016/j.jneumeth.2008.04.012. [PMC free article] [PubMed]
39. Schroeter ML, Bücheler MM, Müller K, Uludag K, Obrig H, et al. Towards a standard analysis for functional near-infrared imaging. Neuro Image. 2004;21:283–290. doi: 10.1016/j.neuroimage.2003.09.054. [PubMed]
40. Han Y, Wang J, Zhao Z, Min B, Lu J, et al. Frequency-dependent changes in the amplitude of low-frequency fluctuations in amnestic mild cognitive impairment: A resting-state fMRI study. Neuro Image. 2011;55:287–295. doi: 10.1016/j.neuroimage.2010.11.059. [PubMed]
41. Lowe MJ, Mock BJ, Sorenson JA. Functional connectivity in single and multislice echoplanar imaging using resting-state fluctuations. Neuroimage. 1998;7:119–132. doi: 10.1006/nimg.1997.0315. [PubMed]
42. Fransson P. Spontaneous low-frequency BOLD signal fluctuations: An fMRI investigation of the resting-state default mode of brain function hypothesis. Human Brain Mapping. 2005;26:15–29. doi: 10.1002/hbm.20113. [PubMed]
43. Press WH, Teukolsky SA, Vetterling WT, Flannery BP. Numerical Recipes in C: The Art of Scientific Computing. Cambridge University Press. 1992. Available: http://apps.nrbook.com/c/index.html.
44. He Y, Zang Y, Jiang T, Liang M, Gong G. Detecting Functional Connectivity of the Cerebellum Using Low Frequency Fluctuations (LFFs). 2004. pp. 907–915. In: Medical Image Computing and Computer-Assisted Intervention – MICCAI 2004. Available: http://dx.doi.org/10.1007/978-3-540-30136-3_110. Accessed 22 Jul 2010.
45. Long X-Y, Zuo X-N, Kiviniemi V, Yang Y, Zou Q-H, et al. Default mode network as revealed with multiple methods for resting-state functional MRI analysis. Journal of Neuroscience Methods. 2008;171:349–355. doi: 10.1016/j.jneumeth.2008.03.021. [PubMed]
46. Lowe MJ, Russell DP. Treatment of baseline drifts in fMRI time series analysis. J Comput Assist Tomogr. 1999;23:463–473. doi: 10.1097/00004728-199905000-00025. [PubMed]
47. Turner R. Signal sources in bold contrast fMRI. Adv Exp Med Biol. 1997;413:19–25. [PubMed]
48. Oakes TR, Fox AS, Johnstone T, Chung MK, Kalin N, et al. Integrating VBM into the General Linear Model with voxelwise anatomical covariates. Neuro Image. 2007;34:500–508. doi: 10.1016/j.neuroimage.2006.10.007. [PMC free article] [PubMed]
49. Chao-Gan Y, Yu-Feng Z. DPARSF: a MATLAB toolbox for “pipeline” data analysis of resting-state fMRI. Front Syst Neurosci. 2010;4:13. doi: 10.3389/fnsys.2010.00013. [PMC free article] [PubMed]
50. Zang ZX, Dong ZY, Huang J, Yan CG, Zang YF. REST-GCA: a MATLAB toolkit for resting-state fMRI directional connectivity analysis. 2010. The 16th Annual Meeting of the Organization for Human Brain Mapping. June 6–10, 2010 in Barcelona, Spain.
51. Yang T, Cheng Y, Li H, Jiang H, Luo C, et al. Abnormal regional homogeneity of drug-naı ¨ve obsessive-compulsive patients. Neuro Report. 2010;21:786–790. doi: 10.1097/WNR.0b013e32833cadf0. [PubMed]
52. Hutchison RM, Mirsattari SM, Jones CK, Gati JS, Leung LS. Functional Networks in the Anesthetized Rat Brain Revealed by Independent Component Analysis of Resting-State fMRI. Journal of Neurophysiology. 2010;103:3398–3406. doi: 10.1152/jn.00141.2010. [PubMed]
53. Paakki J-J, Rahko J, Long X, Moilanen I, Tervonen O, et al. Alterations in regional homogeneity of resting-state brain activity in autism spectrum disorders. Brain Research. 2010;1321:169–179. doi: 10.1016/j.brainres.2009.12.081. [PubMed]
54. Zou Q, Wu CW, Stein EA, Zang Y, Yang Y. Static and dynamic characteristics of cerebral blood flow during the resting state. Neuroimage. 2009;48:515–524. doi: 10.1016/j.neuroimage.2009.07.006. [PMC free article] [PubMed]

Articles from PLoS ONE are provided here courtesy of Public Library of Science


Related citations in PubMed

See reviews...See all...

Cited by other articles in PMC

See all...


  • MedGen
    Related information in MedGen
  • PubMed
    PubMed citations for these articles

Recent Activity

Your browsing activity is empty.

Activity recording is turned off.

Turn recording back on

See more...