AAL TC 提取

Submitted by yubing on
DPARSF 的AAL 提取还能做AAL 1-90
昨天我试着提取116个AAL

DPARSFRun.m 的提取AAL脑区的子程序所有“for iAAL=1:90”改为“for iAAL=1:116”
但是最后生成的 AALTC.mat 文件中。时间序列只有1-99

100以后的时间序列被加在1-15时间序列的后边

详细的 .mat文件见附件

多谢指教

YAN Chao-Gan

Mon, 05/21/2012 - 19:23

 你还需要把

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选项来提取时间序列。

yubing

Sat, 06/09/2012 - 10:57

In reply to by YAN Chao-Gan

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

**********************************



Forums