Arranging files correctly for DPARSF

Submitted by ahezghia on
Hello REST experts, I have a question about arranging files for DPARSF. When reading the instructions for choosing the working directory, it says: "If you start with NIFTI images (.hdr/.img pairs) before slice timing, you need to arrange each subject's fMRI NIFTI images in one directory" I am assuming this means that each volume should have one 3D .img/.hdr pair associated with it. Therefore, if there are 150 volumes then each participant should have 150 .img/.hdr pairs. However, my images were in .nii.gz format, which is a 4D image that includes the volumes in one file. How can I convert .nii.gz to .img/.hdr and also separate it into different files for each volume? I think this is what I need to do because when I convert the .nii.gz file to one .img/.hdr file, it says that there is only 1 volume. Thank you

YAN Chao-Gan

Thu, 03/15/2012 - 16:14

Hi! Please download the latest DPARSF and use the advanced edition (type in DPARSFA). Choose the Template Parameters in DPARSFA --- Standard Steps: Normalized by DARTEL (Start from .nii.gz files). You will see the checkbox "4D Fun .nii(.gz) to 3D" is already checked. DPARSFA will do the conversion automatically for you.

ahezghia

Thu, 03/15/2012 - 18:01

In reply to by YAN Chao-Gan

Hello Thank you for the help. I have tried the steps you have suggested and I receive this error message after I press Run: Undefined function 'spm' for input arguments of type 'char'. Error in DPARSFA_run (line 34) [SPMversion,c]=spm('Ver'); Error in DPARSFA>pushbuttonRun_Callback (line 1133) [Error]=DPARSFA_run(handles.Cfg); Error in gui_mainfcn (line 96) feval(varargin{:}); Error in DPARSFA (line 31) gui_mainfcn(gui_State, varargin{:}); Error while evaluating uicontrol Callback Any idea what is going wrong? Thank you once again

ahezghia

Thu, 03/15/2012 - 19:33

In reply to by YAN Chao-Gan

I have SPM 8 installed and it works properly without error when I use it. Does DPARSF have to be put into the spm folder? Thank you

No, doesn't have to. If you set up SPM8 correctly, you will not get "Undefined function 'spm' for input arguments of type 'char'."

ahezghia

Thu, 03/15/2012 - 20:37

In reply to by YAN Chao-Gan

Is there a way to check if my SPM8 is installed correctly? I believe the installation process was straightforward so I am not sure what could go wrong. Thank you once again

ahezghia

Thu, 03/15/2012 - 21:47

In reply to by YAN Chao-Gan

The output was: ans = SPM8 I tried it again after doing that and I received this error message this time: Undefined function 'rest_misc' for input arguments of type 'char'. Error in DPARSF_Nii2NiftiPairs (line 13) addpath(fullfile(rest_misc('WhereIsREST'), 'rest_spm5_files')); Error in DPARSFA_run (line 272) DPARSF_Nii2NiftiPairs(ImgFileList{x},PO); Error in DPARSFA>pushbuttonRun_Callback (line 1133) [Error]=DPARSFA_run(handles.Cfg); Error in gui_mainfcn (line 96) feval(varargin{:}); Error in DPARSFA (line 31) gui_mainfcn(gui_State, varargin{:}); Error while evaluating uicontrol Callback

That means you didn't install REST. Please pay some attention to the tips pop up when you start DPARSF, it will check if the environment is appropriate. By the way, spend some time to the video course (restfmri.net/forum/course) would be probably helpful for the further calculations and problems.
Forums