Data Processing Assistant for Resting-State fMRI (DPARSF) V2.3


Data Processing Assistant for Resting-State fMRI (DPARSF) is a convenient plug-in software based on SPM and REST. 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 COURSEto know more about how to use this software. Add DPARSF's directory to MATLAB's path and enter "DPARSF" or "DPARSFA" in the command window to enjoy DPARSF basic edition or advanced edition.

The latest release is DPARSF_V2.3_130615.  


Multimedia Course: Data Processing of Resting-State fMRI



New features of DPARSF_V2.3_130615:
1. Apply downloaded reorient matrices. Given the amount of time and effort for interactive reorienting, the reorient matrices for online data such as 1000 Functional Connectomes Project (FCP) (Biswal et al., 2010) and Autism Brain Imaging Data Exchange (ABIDE) (Di Martino et al., 2013) could be downloaded and applied automatically. Please find here for “DownloadedReorientMats”, and then tick the checkbox "Apply Mats".
2. Save information of TR, Slice Number, Time Points and Voxel Size into TRInfo.tsv (under working directory) file for checking data correctness.
3. The slice order type could be specified for each participant into SliceOrderInfo.tsv (under working directory) file, thus allow different slice timing correction for different participants in a batch mode. Please find instructions for setting SliceOrderInfo.tsv from {DPARSF}/Docs/SliceOrderInfo.tsv_Instruction.txt.
4. The output format of DICOM to NIfTI were changed to 4D .nii images.
5. The midline of VMHC results were set to zero.


Biswal, B.B., Mennes, M., Zuo, X.N., Gohel, S., Kelly, C., Smith, S.M., Beckmann, C.F., Adelstein, J.S., Buckner, R.L., Colcombe, S., Dogonowski, A.M., Ernst, M., Fair, D., Hampson, M., Hoptman, M.J., Hyde, J.S., Kiviniemi, V.J., Kotter, R., Li, S.J., Lin, C.P., Lowe, M.J., Mackay, C., Madden, D.J., Madsen, K.H., Margulies, D.S., Mayberg, H.S., McMahon, K., Monk, C.S., Mostofsky, S.H., Nagel, B.J., Pekar, J.J., Peltier, S.J., Petersen, S.E., Riedl, V., Rombouts, S.A., Rypma, B., Schlaggar, B.L., Schmidt, S., Seidler, R.D., G, J.S., Sorg, C., Teng, G.J., Veijola, J., Villringer, A., Walter, M., Wang, L., Weng, X.C., Whitfield-Gabrieli, S., Williamson, P., Windischberger, C., Zang, Y.F., Zhang, H.Y., Castellanos, F.X., Milham, M.P., 2010. Toward discovery science of human brain function. Proc Natl Acad Sci U S A 107, 4734-4739.


   您好!我最近在学习DPARSFA,但一开始就遇到了问题,我将数据文件夹FunImg的上一级文件夹作为数据路径放入MATLAB,但是在DPARSFA中无法导入数据,DPARSFA和DPARSF放数据的路径Working Directory设置不一样吗?DPARSFA应该怎么设置Working Directory呢?



You'll see the subjects after you setting up "Starting Directory Name".





Error using handle.handle/set
Invalid or deleted object.
Error in DPARSF>pushbuttonRun_Callback (line 998)
    set(handles.pushbuttonRun ,'Enable', 'on','BackgroundColor',
Error in gui_mainfcn (line 96)
Error in DPARSF (line 47)
    gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback

Hi Hongru,
I think you closed some window, thus you got such a message.




Dear Chao-Gan,

I noticed a problem that the lastly defined ROI and it's ROI indices get lost when writing the ROI_OrderKey_*.csv files for the 'extract ROI signal' step. Could you please remove the following line at the bottom part of y_ExtractROISignal.m ?

MaskROILabel{1,length(ROIDef)} = []; % Force the undefined cells to empty


Hi Martin,

Thanks a lot for your report!

I fixed it by changing into:


    if size(MaskROILabel,2) < length(ROIDef) %YAN Chao-Gan, 131124. To avoid if the labels of the last ROI has been defined.

        MaskROILabel{1,length(ROIDef)} = []; % Force the undefined cells to empty


This will be updated in the next version.




Dear Mrs/Mr

Please, if possible, guide me how I can read the rest fmri data of ADHD-200 with nii suffix in DPARSF?

In your matlab based DPARSF, I can't load the my NIFTI file. Do I get the processed ADHD-200 competition data? I need the time course or BOLD signal for my research.

I will be grateful if you could help me.

Best regards,

Dear Hussain Montazery Kordy,

I've met this problem recently and solved already. I post the solution here, hope to help you.

ADHD-200 data are 4-D, so you have to covert it to 3-D first.



cd ([funcdir '/']);
for j=3:length(dirlist)
    cd (restdir);

[Data, vox,Head] = rest_readfile(PI,'all');
if size(Data, 4)>1
    for i=1:size(Data,4)
    [Path, fileN, extn] = fileparts(PO);


我在使用dparsf处理数据,我先处理了一个人的数据是可以的,但是批处理时在normalize后老是报index ceceeds matrix dimensions的错误,请指教!


Hi, What's the parameter setting and error message?



i am not able to process the 3d anatomy (T1) images. i put the 3d t1 images in a f0lder t1raw. I want to process only t1 to get the segmentation and later the AAL volumes for GM WM and CSF
please help
& Regards

Dr. Mohit Saxena 
(Ph.D Neurology)
Department of Neurology,
Room No. 702, 7th Floor, CN Center,
All India Institute of Medical Sciences,
Ansari Nagar, New Delhi-110029

On Monday, 14 July 2014 8:04 AM, The R-fMRI Network <> wrote:

Hi Ansari,

You can first select the template parameter of "VBM".

Then if you started with NIfTI images instead of DICOM images, change the starting directory name to the folder of "T1Img".



comment deleted

严老师:您好,我在nuisance coviariates regression时遇到这个问题,请问应该怎么处理呢,谢谢您
??? Error using ==> y_ExtractROISignal at 188
Wrong ROI definition, please check:
Error in ==> DPARSFA_run>(parfor body) at 2111
                Error in ==> parallel_function at 473
            F(base, limit);
Error in ==> DPARSFA_run at 2012
        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

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

Sent: Monday, December 07, 2015 7:41 PM


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


I want to do a correlation analysis between FC-Maps of a ROI and a text variable (duration of illness). What I did so far:
I use DPARSF --> statistical analysis --> Correlation analysis: Add FC-images of the patient-group (which are saved in the folder "FC-FunImgRWSDF) and add a text file with the respective duration of illness (in one column; I have 61 subjects, so 61 lines). The calculation works and I can open the result-file.
The first thing I am wondering about is that when I add the group images (so the folder "FC-FunImgRWSDF") the program immediatly reads in the standardized zFCmaps as well as the FCmaps. However I guess that I only want the zFCmaps to be included in the calculation, right? Do I just have to put the zFCmaps in a seperate folder and then add this folder as the image-folder or is there another way (like in one-sample-t-test, where I just type in a 0 for standardized and a 1 for unstandardized data).
Second, when I look at the result-image with a threshold of p=0.05 I see all significant (but uncorrected) correlations of the FCmap and the text-variable, am I right? If i now want to find out about the exact correlation of a respective cluster in this image, I can use the cluster-report. However this will only show me the correlation of the peak-voxel. Is there a way that the programm can tell me the overall correlation for the respective significant cluster?


1. "put the zFCmaps in a seperate folder and then add this folder as the image-folder"

2. If you want the mean correlation of the cluster. You can DPABI->Cluster->Save a single cluster to save an ROI file, and then use DPABI->Utilities->ROI Signals Extractor to extract it.



Thank you very much for the response. Another question: When I do a one-sample or two-sample t-test, do I always have to put the zFC maps in an extra folder? I thought that in a one-sample-t-test by setting the base to 0 (instead of 1) the program would automatically use just the zFC-maps. 

You have to put the zFC maps in an extra folder.


Thanks again :-)
I have another problem: I want to take a look at the individual zFCmaps. It works for almost every subject. However for 5 subjects I get the following error message once I try to open the zFCmaps in DPABI-Viewer:

Error using repmat
Replication factors must be a row vector of integers or integer scalars.
Error in y_AdjustColorMap (line 49)
    NewColorMap(Begin:End,:) = repmat(OriginalColorMap(iColor,:),[Segment 1]);
Error in w_OverlayList>RedrawOverlay (line 1348)
ColorMap = y_AdjustColorMap(ColorMap,...
Error in w_OverlayList>Accept_Callback (line 1416)
            OverlayHeader=RedrawOverlay(OverlayHeader, handles.MainFig);
Error in gui_mainfcn (line 96)
Error in w_OverlayList (line 42)
    gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)w_OverlayList('Accept_Callback',hObject,eventdata,guidata(hObject))
Error using waitfor
Error while evaluating uicontrol Callback

This is pretty weird. You can upload the images to have a look.


Ok, the problem with viewing the single subject zFCmaps didn't occur again :-)

However I have another problem. I did a two-sample-t-Test of zFCmaps and now want to do an FDR-correction. I first opened DPABI-viewer, loaded up the T2-image and then just click in "FDR" and set the q-value to 0.05. Am I right?
I did that and unfortunately no differences were found. However a colleaque of mine is using the same data but a different programm and somehow he finds a group difference after FDR-correction. So I was wondering whether I might do it wrong in DPARSF. Also, the other programm filters the z-FCmaps on a threshold of 0.4 before doing any calculations such as t-tests. Only those voxels which are higher than the threshold of 0.4 will be included in the t-test, is that possible in DPARSF as well?



Another question: What threshold for the T-Value would you recommend when looking at the seed-network of one group (using one-sample-test of zFCmaps). For the Default-Mode-Netork for instance and a group-size of N=60 I use a T-value of 8 and the network looks quite good, however I am wondering whether this is the proper threshold for checking network quality.

thanks in advance :-)

Hi Markus,

You can perform one sample t-tests for each group, then combine the significant voxels across the two groups as a mask. This is achievable in DPABI.

For threshold in one sample t-test, you can perform GRF correction. Or some people set at p<1E-5 to get better visualization.



Hi Chao-Gan,

thanks for the reponse :-)
It sounds very interesting, however, I am not sure whether I am doing it right. How do I create a mask upon the significant voxels of both one-sample-t-tests? I tried uploaing both t-test images (of patients and controls) in the DPABI-Viewer, then I set the threshold to 0.000001 and then clicked on save all clusters. This will produce a mask which I then uploaded as a mask when doing the FDR-Correction. Is that the procedure you were talking about or should I do it differently?

Also, which parameters should I use in a GRF-correction. Would you recommend both p=0.05 in Voxel and cluster p-value?

Greetings from Germany


Hi Markus,
1. Open one-sample t-test map for one group, set p<0.000001, click save clusters to save as mask.

2. Save a mask for one-sample t-test for another group.

3. Open DPABI-Utilities-Image Calculator. Input the above maps as image 1 and image2, and put the expression as (i1+i2~=0). You will get the combined mask.



Allright, thanks :-)

When I load up the images in the image calculator, do I have to add anything under "Group images"?
I then do FDR correction with the two-sample-t-test and load up the mask in the FDR-correction-window, is that right?

Also, when doing GRF correction, what p-value for cluster respectively voxel would you recommend when using it in a one-sample-t-test to check for network quality. Do I have to load up a mask there as well?



Hi Markus,
1. You don't need to add "group images".

2. Correct. FDR or GRF or AlphaSim.

3. I will say voxel-level 0.001 and cluster-level 0.05 (see Yan, C.G., Wang, X.D., Zuo, X.N., Zang, Y.F., 2016. DPABI: Data Processing & Analysis for (Resting-State) Brain Imaging. Neuroinformatics 14, 339-351.).



Ok, thanks that was helpful :-)
When I view the one-sample-t-test for a network of one group and set the threshold to p<0.000001 should I do an additional FDR correction or is that unnecessary since the p-value is that small?

Also, when I do an GRF-correction on a one-sample-t-test to check network quality, do I have to upload a mask as well?

1. I think that's OK without further FDR correction.

2. Yes, you need to apply a mask.




我使用matlab 2016, spm8, DPARSF_V2.3_130615 run前置分析


Error using DPARSFA_run (line 1129)
Using exist to check for a variable in the transparent
workspace is not supported.  To check for a function, folder,
file, or class, specify the appropriate second input argument
to exist: 'builtin', 'class', 'dir' or 'file'.
Error in DPARSFA>pushbuttonRun_Callback (line 1601)
Error in gui_mainfcn (line 95)
Error in DPARSFA (line 33)
    gui_mainfcn(gui_State, varargin{:});
Error while evaluating UIControl Callback
Error using matlab.ui.control.UIControl/get
Invalid or deleted object.
Error in DPARSFA>editStartingDirName_Callback (line 1493)
Error in gui_mainfcn (line 95)
Error in DPARSFA (line 33)
    gui_mainfcn(gui_State, varargin{:});
Error while evaluating DestroyedObject Callback

Please try the newest version of DPABI/DPARSF.