博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
频谱分析代码片段2
阅读量:5773 次
发布时间:2019-06-18

本文共 2336 字,大约阅读时间需要 7 分钟。

%% 原始数据datacell_4d   = load_untouch_nii('C:\Users\Administrator\Desktop\workspace\phycaa_plus_2104_03_27\func_4d.nii'); ldim = size(datacell_4d.img);%% 制造模板ldcca_tms = img_To_4D_array('C:\Users\Administrator\Desktop\contrast\2014-05-26-20-00.img');spm_tms = img_To_4D_array('C:\Users\Administrator\Desktop\contrast\no_phycaa.img');mask_ldcca_tms = ldcca_tms > 0;inv_mask_ldcca_tms = ~mask_ldcca_tms;mask_spm_tms = spm_tms > 0;inv_mask_spm_tms = ~mask_spm_tms;tmp_spm = spm_tms .* inv_mask_ldcca_tms;mask_big_left_spm_tms = tmp_spm>0;tmp_ldcca = ldcca_tms .* inv_mask_spm_tms;mask_big_left_ldcca_tms = tmp_ldcca > 0; %% 原始数据激活区能量谱均值original_fullMsk = repmat( mask_spm_tms, [1,1,1,ldim(4)] );original2d_img = reshape( datacell_4d.img(original_fullMsk>0), [], ldim(4) );TR =2;Fny    = 0.5 * (1/ TR);                 NFFT   = 2^nextpow2(70);          f      = Fny*linspace(0,1,NFFT/2+1);   powMat  = abs( fft( double(original2d_img) , NFFT ,2) ) / 70; powMat  = powMat(:,1:NFFT/2+1);figure(1);mean_powMat = mean(powMat);plot(f,mean_powMat);hold on;%% 新数据激活区能量谱均值new_fullMsk = repmat( mask_ldcca_tms, [1,1,1,ldim(4)] );new2d_img = reshape( datacell_4d.img(new_fullMsk>0), [], ldim(4) );TR =2;Fny    = 0.5 * (1/ TR);                 NFFT   = 2^nextpow2(70);          f      = Fny*linspace(0,1,NFFT/2+1);   powMat  = abs( fft( double(new2d_img) , NFFT ,2) ) / 70; powMat  = powMat(:,1:NFFT/2+1);mean_powMat = mean(powMat);plot(f,mean_powMat,'Color','red');%% 去除激活区的能量谱均值substruct_fullMsk = repmat( mask_big_left_spm_tms, [1,1,1,ldim(4)] );substruct_img_2d = reshape( datacell_4d.img(substruct_fullMsk>0), [], ldim(4) );TR =2;Fny    = 0.5 * (1/ TR);                 NFFT   = 2^nextpow2(70);          f      = Fny*linspace(0,1,NFFT/2+1);   powMat  = abs( fft( double(substruct_img_2d) , NFFT ,2) ) / 70; powMat  = powMat(:,1:NFFT/2+1);mean_powMat = mean(powMat);plot(f,mean_powMat,'Color','blue');hold on;%% 新增加的激活区的能量谱均值add_fullMsk = repmat( mask_big_left_ldcca_tms, [1,1,1,ldim(4)] );add_spm_tms_2d = reshape( datacell_4d.img(add_fullMsk>0), [], ldim(4) );TR =2;Fny    = 0.5 * (1/ TR);                 NFFT   = 2^nextpow2(70);          f      = Fny*linspace(0,1,NFFT/2+1);   powMat  = abs( fft( double(add_spm_tms_2d) , NFFT ,2) ) / 70; powMat  = powMat(:,1:NFFT/2+1);mean_powMat = mean(powMat);plot(f,mean_powMat,'Color','yellow');hold on;

  

转载地址:http://iexux.baihongyu.com/

你可能感兴趣的文章
单例模式
查看>>
使用Nginx反向代理 让IIS和Tomcat等多个站点一起飞
查看>>
老旧的金融机构,是时候赶赶云计算的时髦了
查看>>
晶澳向埃及11MW混合发电项目供应光伏组件
查看>>
国产x86 CPU性能达Intel的80%?
查看>>
用友网络陈强兵:企业互联网需解决五大问题
查看>>
SMA推出Powerwall兼容Sunny Boy Storage逆变器
查看>>
[UI] Pull menu interaction concept - 下拉菜单交互
查看>>
maven总结
查看>>
SQL语句
查看>>
对话大神Scott Shenker:从物理博士到SDN's Uncle
查看>>
Nginx 状态监控
查看>>
mysql语句大全(1)
查看>>
onhashchange事件与Ajax History manage
查看>>
win8本地连接无法禁用
查看>>
Mysql数据库引擎(MyISAM、InnoDB)
查看>>
头文件
查看>>
一条sql语句在mysql中是如何执行的
查看>>
FSMT:文件服务器从03迁移到08R2实战演练
查看>>
Openfire+Spark+Pandion搭建实验(二)
查看>>