Error using CWAS

Submitted by louislin28 on

Dear Prof Yan,

I came across an error when computing CWAS. Here is the error message:

'Computing CWAS with:    "/Users/hsiangyuanlin/Documents/ADHD_Sib/FunImgARWSFC"
Reading images from "/Users/hsiangyuanlin/Documents/ADHD_Sib/FunImgARWSFC/ConS_6307/CovRegressed_4DVolume_4mm.nii" etc.
Error using y_CWAS (line 60)
Not enough input arguments.

Error in DPARSFA_run (line 3990)
        [p_Brain, F_Brain, Header] =
        y_CWAS([AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},AutoDataProcessParameter.StartingDirName],
        ...

Error in DPARSFA>pushbuttonRun_Callback (line 1674)
    [Error]=DPARSFA_run(handles.Cfg);

Error in gui_mainfcn (line 96)
        feval(varargin{:});

Error in DPARSFA (line 30)
    gui_mainfcn(gui_State, varargin{:});
 
Error while evaluating uicontrol Callback'

 

I am using Matlab 2012b on iOSx 10.10.5. My spm is latest edition of spm8. Thank you very much in advance for your kind help.

Best,

Hsiang-Yuan Lin

YAN Chao-Gan

Mon, 09/21/2015 - 03:50

Hi,

Could you try to revise line 4036 in DPARSFA_run.m

from 

        % CWAS Calculation
        [p_Brain, F_Brain, Header] = y_CWAS([AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},AutoDataProcessParameter.StartingDirName], ...
            AutoDataProcessParameter.SubjectID, ...
            [AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},'Results',filesep,'CWAS',filesep,'CWAS.nii'], ...
            AutoDataProcessParameter.CWAS.Regressors, ...
            AutoDataProcessParameter.CWAS.iter);
 
to 
        % CWAS Calculation
        [p_Brain, F_Brain, Header] = y_CWAS([AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},AutoDataProcessParameter.StartingDirName], ...
            AutoDataProcessParameter.SubjectID, ...
            [AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},'Results',filesep,'CWAS',filesep,'CWAS.nii'], ...
            AutoDataProcessParameter.MaskFileForEachSubject{i}, ...
            AutoDataProcessParameter.CWAS.Regressors, ...
            AutoDataProcessParameter.CWAS.iter,...
            0,...
            [],...
            0);

 

Best,

Chao-Gan

louislin28

Mon, 09/21/2015 - 15:52

Hi, Prof. Yan

I followed your instruction to revise the script as suggested, however I came across another error:

Warning: File: DPARSFA_run.m Line: 673 Column: 66
The temporary variable SliceOrder will be cleared at the beginning of each iteration of the parfor loop.
Any value assigned to it before the loop will be lost.  If SliceOrder is used before it is assigned in
the parfor loop, a runtime error will occur.
See Parallel for Loops in MATLAB, "Temporary Variables". 
> In DPARSFA>pushbuttonRun_Callback at 1674
  In gui_mainfcn at 96
  In DPARSFA at 30 
Warning: File: DPARSFA_run.m Line: 928 Column: 83
The temporary variable RefFile will be cleared at the beginning of each iteration of the parfor loop.
Any value assigned to it before the loop will be lost.  If RefFile is used before it is assigned in
the parfor loop, a runtime error will occur.
See Parallel for Loops in MATLAB, "Temporary Variables". 
> In DPARSFA>pushbuttonRun_Callback at 1674
  In gui_mainfcn at 96
  In DPARSFA at 30 
Warning: File: DPARSFA_run.m Line: 2632 Column: 24
The temporary variable DirImg will be cleared at the beginning of each iteration of the parfor loop.
Any value assigned to it before the loop will be lost.  If DirImg is used before it is assigned in
the parfor loop, a runtime error will occur.
See Parallel for Loops in MATLAB, "Temporary Variables". 
> In DPARSFA>pushbuttonRun_Callback at 1674
  In gui_mainfcn at 96
  In DPARSFA at 30 
Warning: File: DPARSFA_run.m Line: 4205 Column: 32
The temporary variable DirImg will be cleared at the beginning of each iteration of the parfor loop.
Any value assigned to it before the loop will be lost.  If DirImg is used before it is assigned in
the parfor loop, a runtime error will occur.
See Parallel for Loops in MATLAB, "Temporary Variables". 
> In DPARSFA>pushbuttonRun_Callback at 1674
  In gui_mainfcn at 96
  In DPARSFA at 30 
 
Resample Masks (/Users/hsiangyuanlin/Documents/MATLAB/DPABI_V1.3_150710/Templates/BrainMask_05_91x109x91.img) to the resolution of functional images.
 
Resample Masks (/Users/hsiangyuanlin/Documents/MATLAB/DPABI_V1.3_150710/Templates/CsfMask_07_91x109x91.img) to the resolution of functional images.
 
Resample Masks (/Users/hsiangyuanlin/Documents/MATLAB/DPABI_V1.3_150710/Templates/WhiteMask_09_91x109x91.img) to the resolution of functional images.
 
Resample Masks (/Users/hsiangyuanlin/Documents/MATLAB/DPABI_V1.3_150710/Templates/GreyMask_02_91x109x91.img) to the resolution of functional images.
Warning: Directory already exists. 
> In DPARSFA_run at 3987
  In DPARSFA>pushbuttonRun_Callback at 1674
  In gui_mainfcn at 96
  In DPARSFA at 30 
 
Computing CWAS with: "/Users/hsiangyuanlin/Documents/ADHD_Sib/FunImgARWSFC"
Reading images from "/Users/hsiangyuanlin/Documents/ADHD_Sib/FunImgARWSFC/ConS_6307/CovRegressed_4DVolume_4mm.nii" etc.
Error using initclient (line 37)
Java exception occurred:
java.lang.NullPointerException
at java.util.logging.Logger.demandLogger(Logger.java:286)
at java.util.logging.Logger.getLogger(Logger.java:321)
 
Error in distcomp/schema (line 11)
initclient;
 
Error in parallel_function (line 430)
if W > 0 && PCTInstalled && distcomp.remoteparfor.tryRemoteParfor
 
Error in y_CWAS (line 60)
parfor i = 1:nSubjectNum
 
Error in DPARSFA_run (line 3990)
        [p_Brain, F_Brain, Header] =
        y_CWAS([AutoDataProcessParameter.DataProcessDir,filesep,FunSessionPrefixSet{iFunSession},AutoDataProcessParameter.StartingDirName],
        ...
 
Error in DPARSFA>pushbuttonRun_Callback (line 1674)
    [Error]=DPARSFA_run(handles.Cfg);
 
Error in gui_mainfcn (line 96)
        feval(varargin{:});
 
Error in DPARSFA (line 30)
    gui_mainfcn(gui_State, varargin{:});
 
Error while evaluating uicontrol Callback
 
 
 
Thank you very much again.
Best,
Hsiang-Yuan