SPM批量将功能项配准到结构像和MNI

本文介绍了一个使用SPM12进行正电子发射断层成像(PET)数据标准化处理的MATLAB脚本示例。该脚本通过读取指定路径下的文件,实现了PET图像与模板之间的配准及标准化过程。

petmni.m

global sub filelist

pathname='C:\Users\86191\Desktop\AD数据整理';
filelist=dir(pathname);
filelist=filelist(~ismember({filelist.name},{'.','..'}));

for i=1:length(filelist)
    sub=filelist(i).name;


% List of open inputs
nrun = 1; % enter the number of runs here
jobfile = {'C:\Users\86191\Desktop\2.0ruijinprocess\petmni_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(0, nrun);
for crun = 1:nrun
end
spm('defaults', 'PET');
spm_jobman('run', jobs, inputs{:});

end


petmni_job.m

global sub
inputpath=['C:\Users\86191\Desktop\AD数据整理\',sub];

%load raw data
pathname1=[inputpath '/'];
name_t1=dir([pathname1,'*FDGcoT1.nii']);
imgfile_t1=[pathname1 name_t1.name];

name_FDG=dir([pathname1,'*_oFDG.nii']);
imgfile_FDG=[pathname1 name_FDG.name];


%-----------------------------------------------------------------------
% Job saved on 09-Nov-2020 22:10:48 by cfg_util (rev $Rev: 7345 $)
% spm SPM - SPM12 (7487)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
matlabbatch{1}.spm.spatial.normalise.estwrite.subj.vol = {imgfile_t1};
matlabbatch{1}.spm.spatial.normalise.estwrite.subj.resample = {imgfile_FDG};
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasreg = 0.0001;
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasfwhm = 60;
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.tpm = {'C:\Program Files\MATLAB\R2018a\toolbox\spm12\tpm\TPM.nii'};
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.affreg = 'eastern';
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.reg = [0 0.001 0.5 0.05 0.2];
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.fwhm = 0;
matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.samp = 3;
matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.bb = [NaN NaN NaN
                                                             NaN NaN NaN];
matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.vox = [2 2 2];
matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.interp = 4;
matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.prefix = 'w';



总体的分析逻辑Dicom转Nifti,去掉前10个由于机器因素不稳定的时间点,手动将结构像的图像的original定位到AC(前联合),并且如果结构像的方向旋转地太厉害也需要人工调整一下,使用的是SPM中的Display工具,先set orient再reorient。Temporal preprocessing:Slice Timing时间层校正Spatial preprocessing:Realign头动校正,会生成rp开头的头动参数文件,头动过大标为2mm2°。Coregister(将结构像功能像位置对)Segment分割(将与功能结构像分割成灰质,白质,脑脊液),在这一步的Deformation fields中选择Forward就会把分割的文件normalise到MNI空间(这一点跟VBM分析中使用DARTEL的Normaliseto MNI是不同的,VBM中使用的是原始的结构像文件而不是与功能后的结构像文件)。Deformationfield生成的是y开头的nii文件。Normalise归一化,将头动校正后的功能像文件与归一化到MNI空间,这一步就需要用到上一步的y开头的文件。Normalise归一化,再做一次归一化是为了将bia corrected的结构像(在Segment阶段生成的m开头文件)也归一化到MNI空间,这样你就可以把归一化后的功能像w开头文件superimposed到归一化后的结构像w开头的文件上。Smooth平滑,Smooth是一种空间上的滤波,而之后的去线性趋势低通滤波是时间上的滤波,其作用如下图(图片来自于北京师范大学认知神经科学与学习国家重点实验室的PPT):下面两步是SPM的预处理过程中没有的,但是一般也需要做,我之后应该会用DPARSF或者REST来做这两步吧,现在这里写出来,避免有人觉得只做到Smooth就结束了Detrend去线性趋势,也就是高通滤波(让高频的信号留下来,而把低频的信号去掉就叫做高通滤波,反之就叫做低通滤波),在SPM的1-st level分析中包括了这一步,所以如果处理的是任务态的功能像数据就可以只使用SPM了。Filter低频滤波(0.01~0.08Hz)去除协变量,这一步多用在静息态的数据处理中。与时间上的滤波相关的问题:Temporal Filtering FAQ
最新发布
11-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值