??? Error using ==> rest_WriteNiftiImage at 92 Meet error while writing the data

Hi,

I would appreciate help with an issue I'm having with functional connectivity analysis through DPARSF and REST.  Every time I try to run functional connectivity analyses, I get the same error below.  I'm running the latest DPARSF (090911), the latest Matlab (2009b), and SPM5.  I'm using a Macbook Pro laptop.  I tried using an earlier Matlab (2009a), and SPM8 with no success.  I also used the REST_FIX_READ_WRITE_Error.m with no success.  It won't let me save an ROI mask based on the AAL or Broadmann templates, and I've tried using a seed ROI with no success.  However, I was able to get ReHo, ALFF, and fALFF with no difficulty at all.  Any help you could provide would be greatly appreciated.  Thank you.

Duke

??? Error using ==> rest_WriteNiftiImage at 92
Meet error while writing the data

Error in ==> rest_writefile at 79
    rest_WriteNiftiImage(data,Header,filename);

Error in ==> rest_SphereROI at 112
    rest_writefile(theMask, ...

Error in ==> fc at 126
            maskROI =rest_SphereROI( 'BallDefinition2Mask' , AROIDef,
                        BrainSize, VoxelSize, Header);

Error in ==> DPARSF_run at 762
            fc(
            [AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,filesep,AutoDataProcessParameter.SubjectID{i}],
            ...

Error in ==> DPARSF>pushbuttonRun_Callback at 841
    [Error]=DPARSF_run(handles.Cfg);

Error in ==> gui_mainfcn at 96
        feval(varargin{:});

Error in ==> DPARSF at 33
    gui_mainfcn(gui_State, varargin{:});
 
??? Error while evaluating uicontrol Callback 

Hi!
This error often occurs before running REST_FIX_READ_WRITE_Error.m. This error would also occur if there is any space or special character in the file path.
Since the toolbox have not been tested in Mac OS, the platform may also be a cause for this error, thus you can try Windows or Linux currently.
Best wishes!

Hi! 

I did run the REST_FIX_READ_WRITE_Error.m and I still get the same error.  I tried it on a Windows platform and I still get the same error.  Can you think of any other reasons why I get this error?  Do you think it has something to do with calling the MEX-files?  If so, can you provide step by step instructions for compiling the MEX files?  The wiki link that you provide is very complicated for someone who does not compile on a regular basis.

Thanks for your help with this issue!

Hi!
Before running REST_FIX_READ_WRITE_Error.m, you need to install SPM5 (or SPM8) correctly.
If you feel compiling SPM5 is too complicated, you may also try SPM5_Matlab7.1_Linux_MEX.tar.gz from ftp://ftp.fil.ion.ucl.ac.uk/spm/spm5_updates/.
Best wishes!

Hi!
It seems MATLAB 2009a no longer support finite() but use isfinite() instead.
I think the problem you reported may caused by this issue though I did not test it in MATLAB2009a (I do not have such a latest version now. :) ).
There are three strategies you can try:
1. Use a former version of MATLAB, such as 2008b.
2. Replace finite with isfinite in .m files under REST directory (including subfolders).
3. Wait for the new release of REST. We hope to release the latest version in this October.
Best wishes!

It looks like the Matlab version was the issue.  I went to Matlab 2008a, and the seed voxel functional connectivity worked just fine.  I don't have the Image Processing Toolbox for Matlab yet, so I will try the ROI functional connectivity when I get that.  Thanks for your help with this!