前言
这段时间被质量检查QC折磨的很惨,各种检查,要检查提取的被试数据质量是否有问题,病人组和正常组中是否出现个别质量差别较大,还有两组被试的质量方面是否有差异,会不会影响我们之后的数据分析处理。这都是需要考虑的,还要检查自己的代码提取的数据是否跟cat12计算的是不是一样的,这样便可以不需要cat12的GUI界面也能提取所需的指标。脱离GUI还有个好处是可用服务器直接调用,便于操作。由于看到一篇文章,在做结构网络分析时,采用欧拉数来排除可能会影响结果的被试。根据这个,下面写了一个小函数来提取IQR和欧拉数,来排除一些离群点的被试,综合考虑排除被试。仅供参考!
指标
指标提取的基于Matlab相关代码(仅供参考)
注:代码仅供参考,有的被改动过,目的希望读者能自己学会,而不是直接copy,当然这对于代码大神们就小菜一碟喽,也不需要小编这样的笔记。所以此篇写出只是给自己存档,看自己的笔记也可以重新捋一捋思路。
catNC_folder = dir([catsub_path, '\cat_NC*.mat']);
for NCsi = 1:length(catNC_folder)
cat_name = catNC_folder(NCsi).name;
load(['',catsub_path,'\',cat_name,'']);
for li=1:length(S.catlog)
if ~isempty(strfind(S.catlog{li,1},'IQR'))==1
IQR_NC(NCsi,1)=str2num(S.catlog{li,1}(isstrprop(S.catlog{li,1},'digit')))*0.0001;
end
end
Eulnum_NC(NCsi,1)=S.qualitymeasures.SurfaceEulerNumber;
end
catEP_folder = dir([catsub_path, '\cat_*.mat']);
for EPsi = 1:length(catEP_folder)
cat_name = catEP_folder(EPsi).name;
load(['' catsub_path '\' cat_name '']);
for li=1:length(S.catlog)
if ~isempty(strfind(S.catlog{li,1},'IQR'))==1
IQR_EP(EPsi,1)=str2num(S.catlog{li,1}(isstrprop(S.catlog{li,1},'digit')))*0.0001;
end
end
Eulnum_EP(EPsi,1)=S.qualitymeasures.SurfaceEulerNumber;
end
cat_folder = dir([catsub_path, '\cat_*.mat']);
for si = 1:length(cat_folder)
cat_name = cat_folder(si).name;
load(['' catsub_path '\' cat_name '']);
for li=1:length(S.catlog)
if ~isempty(strfind(S.catlog{li,1},'IQR'))==1
IQR_*(si,1)=str2num(S.catlog{li,1}(isstrprop(S.catlog{li,1},'digit')))*0.0001;
end
end
Eulnum_*(si,1)=S.qualitymeasures.SurfaceEulerNumber;
end
[h1,p1,ci1,stats1] = ttest2(IQR_NC(1:25,1),IQR_NC);
[h2,p2,ci2,stats2] = ttest2(IQR_NC(25:99,1),IQR);
[h3,p3,ci3,stats3] = ttest2(Eulnum_NC(1:25,1),Eulnum_*);
[h4,p4,ci4,stats4] = ttest2(Eulnum_NC(25:99,1),Eulnum_*);
figure('color','w')
subplot(2,2,1);
g = [repmat(1,length(IQR_NC(1:25,1)),1);repmat(2,length(IQR_EP),1)];
IQR1 = [IQR_NC(1:25,1);IQR_EP];
pos = ['NC';'EP'];
boxplot(IQR1,g, 'labels', pos)
subplot(2,2,2);
g = [repmat(1,length(IQR_NC(26:99,1)),1);repmat(2,length(IQR_*),1)];
IQR2 = [IQR_NC(26:99,1);IQR_*];
boxplot(IQR2,g, 'labels', pos)
subplot(2,2,3);
g = [repmat(1,length(Eulnum_NC(1:25,1)),1);repmat(2,length(Eulnum_EP),1)];
Eulnum1 = [Eulnum_NC(1:25,1);Eulnum_EP];
boxplot(Eulnum1,g, 'labels', pos)
subplot(2,2,4);
g = [repmat(1,length(Eulnum_NC(26:99,1)),1);repmat(2,length(Eulnum_*),1)];
Eulnum2 = [Eulnum_NC(26:99,1);Eulnum_*];
boxplot(Eulnum2,g, 'labels', pos)
结果
下图为IQR的提取结果:
下图为欧拉数的提取结果:
最后的问题就是要不要去除这些离群点呢?待之后的数据分析结果考虑。
很久没写笔记了,写了一篇可能也没啥用的笔记,哈哈哈,刷刷存在感吗?下篇认真写吧,应该是写FDR和FWE的操作吧!给自己定的计划和小目标,期待一下。