We are trying to learn your programs to do functional connectivity in TBI (traumatic brain injury).  We have a large group and have been using several MRI methods including DTI, SWI and MRS.  I’ve wanted to use Fc for some time now and found your programs while searching on the SPM website.   I was able to run an Fc analysis last night but without removing regressors of noninterest.  I would like to use all features of both programs but have some questions.  I did register but am in a time crunch so thought I might get faster answers to my questions.  I must say, that I’ve looked pretty hard on the internet but don’t see anything as comprehensive as these programs for this purpose.   Having said that, there are a few areas which are a bit unclear.  I’ll pose my questions now:


1.       I’m using matlab 7.1 and spm8.   Any compatibility issues here with your programs?

2.       Regarding DPARSF: is there an easy way to input the slice order, e.g., a text file, etc.?  What is the reference slice referring to?

3.       If you use DPARSF to do slice timing, realign, normalize, smoothing, does it call on SPM?  If so, does it matter what version of SPM?

4.       Halfway down in DPARSF, what does “Data with smooth” mean specifically? 

5.       If data is already preprocessed, e.g, realigned, normed, etc, is it necessary to name the folder appropriately, i.e, FunImgNormalizedSmoothedDetrended?  This seems needlessly tedious, since you are inputting what you want done and could enter the path explicitly.

6.       For nuisance covariates, do you enter them in using define ROI?  Then input the masks?  When you say 70% or 90% of an a priori image do you mean, e.g, 128 of 255 using MRIcro (50%) or 0.70 of 0.99 for scaled filter in MRIcro?  Seems pretty restrictive for CSF at 90%.

7.       Does DPARSF do functional connectivity as REST does?  If so, where do you input the ROI, voxel or covariate to regress your data against? 

8.       How do I view the power spectrum in ALFF?


These are the key questions I need answered to move forward.  I’d appreciate a quick response, if possible.


Thank you in advance,




Dear Randy,
        Thank you for your interests in our work!
        First of all, I strongly recommend you download the multimedia course (about 1 hour), this will keep you out of many unnecessary errors.

       1. You can use MATLAB 7.1 and SPM8. I have compared the results using DPARSF with both SPM5 and SPM8, the results are all the same.
       2. You can copy your text in to the slice order field. Or you can use some convenient MATLAB expression, for example, type in 1:2:31,2:2:30, you will get 1 3 5 ... 29 31 ... 2 4 6 ... 28 30. All slices would be corrected for different acquisition times of signals by shifting the signal measured in each slice relative to the acquisition of "REFERENCE SLICE" (usually the slice acquired at the middle time, 31 in this example) .
       3. Yes, It will call SPM. Both SPM5 and SPM8 are OK! The results are the same.
       4. If you choose "Data with smooth", then detrending, filtering, and later processing are based on the data after smooth. If you want to calculate functional connectivity, you may need to select this option. If you want to calculate ReHo, you need to choose "Data without smooth" option, since smooth should be performed after ReHo calculation.
       5. Yes! If data is already preprocessed, e.g, realigned, normed, etc, it is necessary to name the folder appropriately. You can get more information from the multimedia course.
       6. If you use the default option, the covariates are extract by using thresholded SPM5's apriori masks. CSF is set at 70%, WM is set at 90%. "128 of 255 using MRIcro"? I think you mean apriori masks in SPM2. In SPM5, the masks contains probability, thus just set a threshold of 0.7. If you want to remove other kind of covariates, please refer to the multimedia course to get more details.
       7. Yes! DPARSF is based on REST, so it does the same as REST. There is a button called "Define ROI", you can use it to define ROI. Covariates is regressed out in Step 6, so you need not to set the covariate again.
       8. You can click the Power Spectrum button in the ALFF GUI of REST, then you can see the Power Spectrum.
      Hope this information helpful, and hope DPARSF and REST useful for you work!
      Best wishes!



Thanks for your quick reply!  I was able to get dparsf to run and it ran for about 30 minutes before another error message which indicates a problem with a mask.  My mask is the same size, etc. as the EPI images.  On the other hand, the a priori images use a different dimensions/ different bounding box.  I wonder if that is the problem.  You didn’t say much about this in your documentation or your multimedia.  I have to assume that the csf.nii, wm.nii  in a priori of SPM must match the normalized EPI images.  Is this correct?  I don’t think it is flagging my brainmask image.  It matches the normed EPI images and was made from one.  What does it refer to?


Since the program ran long enough to produce the filtered images, I don’t need this step again.  Is there a command line  to rerun the program without prior steps?


How long should the program take to run to completion with 200 images at 2x2x2 and one ROI?  What is the optimal amount of RAM to run it?


Thanks again,




Ideal rectangular filter:                "C:\Data\TBI\FunctionalConnectivity\BENSON_RANDY_FMRI_TEST_050409\WorkingDirectory\FunImgNormalizedSmoothedDetrended\subject001"

                 Read 3D EPI functional images: "C:\Data\TBI\FunctionalConnectivity\BENSON_RANDY_FMRI_TEST_050409\WorkingDirectory\FunImgNormalizedSmoothedDetrended\subject001".........................................


                 Load mask "".

                 Build band pass filtered mask.   Wait...

                 Band Pass Filter working.             Wait.......................

                 ReConstructing 3D+time Dataset.            Wait.......................

                 Saving filtered images. Wait...........................................

                 Band pass filter over.

                Elapsed time is 1643.337812 seconds.

Moving Filtered Files:subject001 OK


                 Read these 3D EPI functional images.    wait...

                 Read 3D EPI functional images: "C:\Data\TBI\FunctionalConnectivity\BENSON_RANDY_FMRI_TEST_050409\WorkingDirectory\FunImgNormalizedSmoothedDetrendedFiltered\subject001".........................................

??? Error using ==> rest_loadmask

There are no appropriate default mask file:

                Volume size=79*95*69 ,Voxel size=2*2*2;

                Volume size=53*63*46, Voxel size=3*3*3;

                Volume size=91*109*91, Voxel size=2*2*2;

                Volume size=61*73*61, Voxel size=3*3*3;

 Please set bMask = 0.


Error in ==> reho at 63

mask=rest_loadmask(nDim1, nDim2, nDim3, AMaskFilename);


Error in ==> DPARSF_run at 511

        reho(         [AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,filesep,AutoDataProcessParameter.SubjectID{i}], ...


Error in ==> DPARSF>pushbuttonRun_Callback at 806



Error in ==> gui_mainfcn at 75



Error in ==> DPARSF at 31

    gui_mainfcn(gui_State, varargin{:});


??? Error while evaluating uicontrol Callback.

Dear Randy,
        1. If the resolution of your data is not 61*73*61, you need to extract the covariates by REST and then remove it. (Or just replace the "BrainMask_05_61x73x61.img" with your mask to cheat DPARSF). Please refer to Slice 63 to Slice 75 in the multimedia course, you can get enough information for how to extract covariates and remove them.
        2. Please call DPARSF_run.m if you want to use command line. But I suggest you rename the directory as DPARSF wanted ("

FunImgNormalizedSmoothedDetrendedFiltered", refer to Slice 73) and just select the checkbox with the processes you wanted.
        3. I am sorry I do not know it. The time depends on you computer. I think 2GB is OK.
        4. The error you report is not refer to "Regress out Covariates", but refer to ReHo calculation. As mentioned in Slice 57, if the resolution of your data is not 61*73*61, you can not select "Default mask", but select "User's defined mask". Slice 56 will tell you how to reslice the resolution of your mask to the resolution of your EPI data.
        Hope you can listen to the Course for a while, it may be help for you to avoid further errors.
        Best wishes!