Error using save
No variable matched the pattern 'AAL\w\wTC'.
Error in DPARSF_run (line 1274)
save([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep,AutoDataProcessParameter.SubjectID{i},'_AALTC.mat'],'-regexp',
'AAL\w\wTC');
Error in DPARSF>pushbuttonRun_Callback (line 976)
[Error]=DPARSF_run(handles.Cfg);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in DPARSF (line 43)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback
***********************************************************
我自己修改过的DPARSF_run.m的提取116个AAL Time Course的代码附后,麻烦指教,多谢!
*******
%Extract AAL Time Cources (116 areas)
if (AutoDataProcessParameter.IsExtractAALTC==1)
if (AutoDataProcessParameter.DataIsSmoothed==1)
FunImgDir='FunImgNormalizedSmoothedDetrendedFilteredCovremoved';
else
FunImgDir='FunImgNormalizedDetrendedFilteredCovremoved';
end
cd([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir]);
mkdir([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep])
[AALData, Vox, Head] = rest_readfile([ProgramPath,filesep,'Templates',filesep,'AAL_61x73x61_YCG.nii']);
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['AAL',AreaName,'Index=find(AALData==',num2str(iAAL),');']);
end
for i=1:AutoDataProcessParameter.SubjectNum
cd(AutoDataProcessParameter.SubjectID{i});
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['AAL',AreaName,'TC=[];']);
end
DirImg=dir('*.img');
for j=1:AutoDataProcessParameter.TimePoints
%Filename=['0000000',num2str(j)];Filename=Filename(end-7:end);Filename=[Filename,'.img'];
Filename=DirImg(j).name;
[Data, Vox, Head] = rest_readfile(Filename);
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['Temp=mean(Data(AAL',AreaName,'Index));']);
eval(['AAL',AreaName,'TC=[AAL',AreaName,'TC;Temp];']);
end
end
cd('..');
save([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep,AutoDataProcessParameter.SubjectID{i},'_AALTC.mat'],'-regexp', 'AAL\w\wTC');
fprintf(['Extract AAL Time Cources: ',AutoDataProcessParameter.SubjectID{i},' OK']);
end
fprintf('\n');
end
Re
AreaName=['0',num2str(iAAL)];
AreaName=AreaName(end-1:end);
改成AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
这段代码我以后修改一下吧,直接存在一个矩阵里好了。
另外,也可以用REST->Utilities->Extract ROI Signals中的multiple labels选项来提取时间序列。
按照您的指示修改以后,还是报错
No variable matched the pattern 'AAL\w\wTC'.
Error in DPARSF_run (line 1274)
save([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep,AutoDataProcessParameter.SubjectID{i},'_AALTC.mat'],'-regexp',
'AAL\w\wTC');
Error in DPARSF>pushbuttonRun_Callback (line 976)
[Error]=DPARSF_run(handles.Cfg);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in DPARSF (line 43)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback
***********************************************************
我自己修改过的DPARSF_run.m的提取116个AAL Time Course的代码附后,麻烦指教,多谢!
*******
%Extract AAL Time Cources (116 areas)
if (AutoDataProcessParameter.IsExtractAALTC==1)
if (AutoDataProcessParameter.DataIsSmoothed==1)
FunImgDir='FunImgNormalizedSmoothedDetrendedFilteredCovremoved';
else
FunImgDir='FunImgNormalizedDetrendedFilteredCovremoved';
end
cd([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir]);
mkdir([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep])
[AALData, Vox, Head] = rest_readfile([ProgramPath,filesep,'Templates',filesep,'AAL_61x73x61_YCG.nii']);
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['AAL',AreaName,'Index=find(AALData==',num2str(iAAL),');']);
end
for i=1:AutoDataProcessParameter.SubjectNum
cd(AutoDataProcessParameter.SubjectID{i});
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['AAL',AreaName,'TC=[];']);
end
DirImg=dir('*.img');
for j=1:AutoDataProcessParameter.TimePoints
%Filename=['0000000',num2str(j)];Filename=Filename(end-7:end);Filename=[Filename,'.img'];
Filename=DirImg(j).name;
[Data, Vox, Head] = rest_readfile(Filename);
for iAAL=1:116
AreaName=['00',num2str(iAAL)];
AreaName=AreaName(end-2:end);
eval(['Temp=mean(Data(AAL',AreaName,'Index));']);
eval(['AAL',AreaName,'TC=[AAL',AreaName,'TC;Temp];']);
end
end
cd('..');
save([AutoDataProcessParameter.DataProcessDir,filesep,FunImgDir,'_AALTC',filesep,AutoDataProcessParameter.SubjectID{i},'_AALTC.mat'],'-regexp', 'AAL\w\wTC');
fprintf(['Extract AAL Time Cources: ',AutoDataProcessParameter.SubjectID{i},' OK']);
end
fprintf('\n');
end
**********************************
Re
现在先用这个:http://www.restfmri.net/forum/node/1059
好的,谢谢您