Data Processing Assistant for Resting-State fMRI (DPARSF) V4.1

Data Processing Assistant for Resting-State fMRI (DPARSF)
Data Processing Assistant for Resting-State fMRI (DPARSF) is a convenient plug-in software within DPABI, which is based on SPM. You just need to arrange your DICOM files, and click a few buttons to set parameters, DPARSF will then give all the preprocessed (slice timing, realign, normalize, smooth) data, functional connectivity, ReHo, ALFF/fALFF, degree centrality, voxel-mirrored homotopic connectivity (VMHC) results. DPARSF can also create a report for excluding subjects with excessive head motion and generate a set of pictures for easily checking the effect of normalization. You can use DPARSF to extract ROI time courses efficiently if you want to perform small-world analysis. DPARSF basic edition is very easy to use while DPARSF advanced edition (alias: DPARSFA) is much more flexible and powerful. DPARSFA can parallel the computation for each subject, and can be used to reorient your images interactively or define regions of interest interactively. You can skip or combine the processing steps in DPARSF advanced edition freely. Please download a MULTIMEDIA COURSE to know more about how to use this software. As a component of DPABI, please add with subfolders for DPABI in MATLAB's path setting and enter "dpabi" in the command window to enjoy this powerful toolbox.
The latest release is DPARSF_V4.1_160415. Please download DPABI to enjoy it!  
New features of DPARSF V4.1_160415:
1. Fixed a bug in DPARSF Basic Edition. The bug is that the white matter signal is always removed in nuisance regression (only exist in the Basic Edition). Thanks to the report of Liviu Badea.
2. DPARSF Advanced Edition: Add an option of “Add mean back” for nuisance regression. The mean will be added back to the residual after nuisance regression. This is useful for circumstances of ICA or task-based analysis.
3. DPARSF Advanced Edition: Re-run with global signal regression (DPARSFA_RerunWithGSR). Fixed a bug when “Remove first X time points” was defined, the number of time points will be adjusted accordingly now. Thanks to the report of Hua-Sheng Liu.
4. DPARSF Advanced Edition: Add a slice timing batch mode for MultiBand data. Users could specify a text timing file for a given participant in SliceOrderInfo.tsv. Please see for more details.
New features of DPARSF_V4.0_151201 (together with DPABI_V2.0_151201) :
1. Compatible with MATLAB 2014b and later versions.
2. Process the data both with and without global signal regression (GSR). Check “Nuisance regressors setting” -> “Both with & without GSR”. Alternatively, you can call DPARSFA_RerunWithGSR.m. E.g., DPARSFA_RerunWithGSR(DPARSFACfg.mat); where DPARSFACfg.mat stores the previous parameters without GSR.
3. The processing steps are affixed to Results directories. The R-fMRI calculation parameters are also written to the header of the result files.
4. V4 template is added. No smoothing before R-fMRI measure calculation (except for VMHC). This is used for comparing across studies and accumulate processed data.
5. DPABI Statistical Analysis. Add multiple comparison test after ANOVA, e.g., 'tukey-kramer' or 'hsd', 'lsd', 'dunn-sidak', 'bonferroni’ or ‘scheffe' procedures.
6. DPABI_VIEW: compatible with BrainNet Viewer 1.5. 
7. Fixed a "File too small" bug when .hdr/.img files are used.
8. Fixed a bug in y_Standardize.m: error when multiple files are defined.
9. Fixed a bug in DPABI Image Calculator: error in standard deviation calculation along the 4th dimension.
10. Results Organizer module: with this module, the users could organize the intermediate files for future processing with DPABI. In addition, the results could be organized for future use, and to be accumulated for the future R-fMRI maps project.
New features of DPARSF_V3.2_150710:
1. SPM12 Compatible.
2. DPARSF for Rat data released.
The Rat module is based on a Rat T2 template generated by Dr. Adam J. Schwarz et al. Please cite this paper when appropriate: Schwarz, A.J., Danckaert, A., Reese, T., Gozzi, A., Paxinos, G., Watson, C., Merlo-Pich, E.V., Bifone, A., 2006. A stereotaxic MRI template set for the rat brain with tissue class distribution maps and co-registered anatomical atlas: application to pharmacological MRI. Neuroimage 32, 538-550. (A T1 template was included as well. It's generated by normalizing 50 rats (two scans at PND45 or PND60) to that T2 template and then averaging (by Dr. Chao-Gan Yan)).
A video for rat data processing is available at
3. Fixed a bug in generating Voxel Specific Head Motion: missing gmdmp.
New features in DPARSF_V3.1_141101.
1. DPARSF V3.1 Basic Edition: Fixed a bug of missing DPARSF_run.
2. DPARSF V3.1: Fixed a bug that can not find ROI templates.
1. New features in DPARSF 3.0 Advanced Edition.
1.1.  Quality control. Integrated GUI for QCing the functional and structural images, users can give ratings and comments during the step of interactive reorientation.
1.2.  Automask generation. For checking EPI coverage and generating group mask, the automasks (as in AFNI) will be generated based on EPI images.
1.3.  Brain extraction (Skullstrip). This step can improve the coregistration between functional and structural images. Most registration issues of previous DPARSF versions can be solved by including this step. For Linux and Mac users: Need to install FSL. For Windows users: Thanks to Chris Rorden's compiled version of bet in MRIcroN, the modified version can work on NIfTI images directly.
1.4.  Nuisance Regression. 1) Masks can be generated based on segmentation or SPM apriori masks; 2) Methods can be mean or CompCor [Note: for CompCor, detrend (demean) and variance normalization will be applied before PCA, according to (Behzadi et al., 2007)]; 3) Global Signal can be extracted based on Automasks.
2. New features in DPARSF 3.0 Basic Edition.
2.1.  DPARSF Basic Edition now is using the engine of DPARSF Advanced Edition.
2.2.  Nuisance Regression (in MNI space) is placed before filtering, according to (Hallquist et al., 2013).
3. New features in DPARSF for Monkey data.
3.1.  The monkey module is based on Rhesus Macaque Atlases for functional and structural imaging studies generated by Wisconsin ADRC Imaging Core. Please cite their papers when appropriate: (McLaren et al., 2010; McLaren et al., 2009).
3.2.  Of note, the origin of monkey atlas is different from human MNI atlas. Please make sure the correct origins are set at the steps of "reorienting Fun*" and "reorienting T1*".

Licence: GNU General Public Licence (GPL)

Old versions:
V1.0 V2.0 V2.1 V2.2 V2.3



Dr Yan,

there is an error in my preprocessing procedure as below, My spm is version 8 and the matlab version is R2010b, is there any problem about this ? Thank you!


Please re-add with subfolders for SPM8 path.



Dr. Yan:
Hi, I used DPARSF, the 1st step epi dicom to nii and remove the first 10 time points, it showed as follows, and in the FunRaw, there are 240 dcm of every sub, in the FunImg, there is only one nii of every subject. I do not know what to do. Thank you so much.
??? Undefined function or method 'file2mat' for input arguments of type 'struct'.
Error in ==> file_array.subsref>subfun at 80
t = file2mat(sobj,varargin{:});
Error in ==> file_array.subsref at 60
    t = subfun(sobj,args{:});
Error in ==> nifti.subsref>rec at 219
            t = subsref(t,subs(2:end));
Error in ==> nifti.subsref at 45
varargout = rec(opt,subs);
Error in ==> DPARSFA_run>(parfor body) at 560
Error in ==> parallel_function at 491
            S = F(base, limit);
Error in ==> DPARSFA_run at 528
        parfor i=1:AutoDataProcessParameter.SubjectNum
Error in ==> DPARSFA>pushbuttonRun_Callback at 1601
Error in ==> gui_mainfcn at 96
Error in ==> DPARSFA at 33
    gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback

Thank you

From: RFMRI.ORG [] on behalf of The R-fMRI Network []

Sent: Tuesday, December 01, 2015 8:59 PM


Subject: Re: [RFMRI] Data Processing Assistant for Resting-State fMRI (DPARSF) V4.0


One .nii is OK, as it contains 240 volumes.

The error you encountered is caused by the conflict between REST and SPM8. REST contains some spm5 files, thus please DO NOT add with subfolders for REST. Or remove REST path to have a try.








I am new to DPARSFA and I hope you can help me. I got the following error after specifying my working directory and starting directory (FunImg): "Too many .nii.gz files in each subject's directory, should only keep one 4D .nii.gz file". However, it is only a test run with one subject, so I have one .nii file for this subject in FunImg folder and one .nii.gz file for this subject in the T1Img folder (so one file in each folder in total). What can cause the problem?


Thanks a lot!




Dr Yan,

I have an error in my preprocessing procedure for resting state as below, I use spm8  、  matlab 2007a and DPARSF_V2.3。Is there any problem about this ? Thank you!


Running 'New Segment'

Failed  'New Segment'

Error using ==> zeros

Out of memory. Type HELP MEMORY for your options.

In file "F:\MATLAB\R2007a\work\spm8\toolbox\Seg\spm_preproc_write8.m" (v2531), function "rgrid" at line 435.

In file "F:\MATLAB\R2007a\work\spm8\toolbox\Seg\spm_preproc_write8.m" (v2531), function "spm_preproc_write8" at line 241.

In file "F:\MATLAB\R2007a\work\spm8\toolbox\Seg\spm_preproc_run.m" (v2281), function "run_job" at line 112.

In file "F:\MATLAB\R2007a\work\spm8\toolbox\Seg\spm_preproc_run.m" (v2281), function "spm_preproc_run" at line 27.


The following modules did not run:

Failed: New Segment


??? Error using ==> cfg_util.m>local_runcj at 251

Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing the exact #job as displayed in this error message)


Running job #1




Error in ==> DPARSFA>pushbuttonRun_Callback at 1601



Error in ==> gui_mainfcn at 95



Error in ==> DPARSFA at 33

    gui_mainfcn(gui_State, varargin{:});


??? Error using ==> DPARSFA('pushbuttonRun_Callback',gcbo,[],guidata(gcbo))

Error using ==> cfg_util.m>local_runcj at 251

Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing the exact #job as displayed in this error message)


Running job #1




??? Error while evaluating uicontrol Callback




This is an out of memory error. Please refer to #2.










1. 试着安装一下最新的DPABI/DPARSF。

2. 可以批量处理。请见:。







Seems you don't have permission on your windows  computer to execute "mklink"?





This is the error show in my preprocessing procedure as below, My dpabi version is 4.0,spm is version 8 and the matlab is R2013b, is there any problem about this ?

Error using nifti/subsref>rec (line 104)

BLAS loading error:
dlopen: cannot load any more object with static TLS
Error in nifti/subsref (line 45)
varargout = rec(opt,subs);
Error in y_Write (line 62)
Error in DPARSFA_run>(parfor body) (line 578)
Error in DPARSFA_run (line 546)
        parfor i=1:AutoDataProcessParameter.SubjectNum
Error in DPARSFA>pushbuttonRun_Callback (line 1761)
Error in gui_mainfcn (line 96)
Error in DPARSFA (line 30)
    gui_mainfcn(gui_State, varargin{:});
Caused by:
    Error using  * 
    BLAS loading error:
    dlopen: cannot load any more object with static TLS
Error while evaluating uicontrol Callback
Error using hgload>localCheckRecursion (line 129)
recursively loaded itself.
Error in hgload (line 42)
Error in openfig (line 72)
    [fig, savedvisible] = hgload(filename, struct('Visible','off'));
Error in gui_mainfcn>local_openfig (line 286)
    gui_hFigure = openfig(name, singleton, visible);
Error in gui_mainfcn (line 159)
        gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt,
Error in DPARSF (line 52)
    gui_mainfcn(gui_State, varargin{:});
Error in dpabi>pushbutton_DPARSFB_Callback (line 141)
Error in gui_mainfcn (line 96)
Error in dpabi (line 42)
    gui_mainfcn(gui_State, varargin{:});
Error in
Error using struct2handle
Error while evaluating uicontrol Callback

Thank you!

Is SPM running properly?

thanks chaogan,

The problem has been sloved. It seems you need to open the SPMwhen running DPARSF.






I was using DPARFS to calculate VMHC for resting state fMRI.

I got the results but they look like a mask!

What could i have done wrong? What should i do to fix this?


thanks in advance,




This is weird. Please check your data input for VMHC calculation.



Yes, i know it's weird which is why i am asking!

Could you please be more precise? Is there somewhere i should be looking that might have given this output?

I checked my input and i think it is Ok..

Any helpful advice on the matter is highly appreicated!


What's your input for VMHC calculation. E.g., the starting directory name.

Thank you for your reply. I understand.    

I will share with you the file structure.



Inside dpabi folder






























Inside the Results folder 













Inside the results folder









If you would like to see the setting file, please let me know where to send it because i couldnt attach it here.


Thank you again,






Inside VMHC_FunRawRCWSFsym

Should be something like this:




Inside VMHC_FunRawRCWSFsym  i have files (See below)



Inside each file i have 



Is this wrong?
Shoiuld i copy the sym_Filtered_4DVolume.nii to outside the file e.g. b106 for all file and rename them something like this: VMHCMap_Sub_001.nii?

The fiels seems right. Could you have a test run on the sample data at

The fiels seems right. Could you have a test run on the sample data at


I am using DPARSFA on a Mac with OS Sierra. Unfortunately, I cannot get my segmentation to work (NewSegment+DARTEL)  and I am already getting a warning during coregistration:

Warning: Too many optimisation iterations

> In spm_powell at 46

  In spm_coreg at 149
  In spm_run_coreg at 22
  In matlabbatch/private/cfg_run_cm at 29
  In cfg_util>local_runcj at 1688
  In cfg_util at 959
  In spm_jobman>fill_run_job at 458
  In spm_jobman at 247
  In DPARSFA_run>(parfor body) at 1622
  In parallel_function at 472
  In DPARSFA_run at 1558
  In DPARSFA>pushbuttonRun_Callback at 1779
  In gui_mainfcn at 95
  In DPARSFA at 30 
Afterwards, creating the automasks works fine, but then segmantation fails with the following error:
Failed  'Segment'
Error using svd
Input to SVD must not contain NaN or Inf.
In file "/Users/agggold/Desktop/spm12/spm_get_closest_affine.m" (v6137), function "spm_get_closest_affine" at line 68.
In file "/Users/agggold/Desktop/spm12/spm_preproc_write8.m" (v6881), function "spm_preproc_write8" at line 337.
In file "/Users/agggold/Desktop/spm12/spm_preproc_run.m" (v6365), function "run_job" at line 146.
In file "/Users/agggold/Desktop/spm12/spm_preproc_run.m" (v6365), function "spm_preproc_run" at line 41.
In file "/Users/agggold/Desktop/spm12/config/spm_cfg_preproc8.m" (v6798), function "spm_local_preproc_run" at line 418.
The following modules did not run:
Failed: Segment
Error using MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing
the exact #job as displayed in this error message)
Running job #1
Error while evaluating uicontrol Callback
I have tried to interactively reorient my FUN and T1 Images, but it doesn't seem to help.
Thank you very much for your help!


I guess there might be some problem with your data. Try the demo data first.