博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
一般的相关分析代码
阅读量:7304 次
发布时间:2019-06-30

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%--brain mask with the brain tissue
mask_name = 
'C:\Users\Administrator\Desktop\workspace\preprocessed\masks\within_brain_mask.nii'
;
M   = load_untouch_nii( mask_name ); % load mask NIFTI
mask     = 
double
(M.img>
0
);          % get 3d v
 
%--brain functional 4d data
data_4d = 
'C:\Users\Administrator\Desktop\workspace\preprocessed\4d\func_3d.nii'
;
% data_4d = 
'C:\Users\Administrator\Desktop\phycaa_workspace\phycaa_plus_2104_03_27\_PHYCAA_step1+2.nii'
;
 
V   = load_untouch_nii( data_4d );
 
%--transform 4d array to 2d array, using brain_mask
within_brain_voxels = nifti_to_mat(V,M);
 
nt_matrix = within_brain_voxels;
 
[V_c S_c temp] = svd( nt_matrix' * nt_matrix );
% PC-space representation
Q_c = V_c * sqrt( S_c );
 
offSet=
1
;
pcs=
4
;
 
% estimate temporal autocorrelation maximized 
"sources"
Q1 = Q_c( 
1
:(end-offSet) , 
1
:pcs ); % un-offset
Q2 = Q_c( (offSet+
1
):end , 
1
:pcs ); % offsetted timeseries
 
% canonical correlations on time-lagged data
[A,B,R,U,V,stats] = canoncorr(Q1,Q2);
 
% getting stable 
"average" 
autocorrelated timeseries
a=[U(
1
,:)]; b=[U(
2
:end,:) + V(
1
:end-
1
,:)./
2
]; c=[V(end,:)];
 
tset = [a;b;c];

  

本文转自二郎三郎博客园博客,原文链接:http://www.cnblogs.com/haore147/p/3797817.html,如需转载请自行联系原作者
你可能感兴趣的文章
王垠:不再推荐 Haskell_IT新闻_博客园
查看>>
ios开发学习--动画(Animation)效果源码分享
查看>>
Java进阶07 嵌套类
查看>>
美妙的模电2013/4/18
查看>>
转: 多线程编程指南【中文完整翻译版】
查看>>
转 SQL语句的添加、删除、修改多种方法
查看>>
【译】ISupportInitialize的用处
查看>>
Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs
查看>>
IIS中采用ISAPI-Rewrite防盗链
查看>>
【新年呈献】高性能 Socket 组件 HP-Socket v3.1.2 正式发布
查看>>
查询数据库的所有者
查看>>
Android PageAdapter翻译
查看>>
学习:erlang的不定长数据包头部。
查看>>
requirejs:杏仁的优化(almond)
查看>>
CATransition 实践
查看>>
js便签笔记(12)——浏览TOM大叔博客的学习笔记 part2
查看>>
Android发布应用前的代码混淆【转】
查看>>
Python-搭建Nginx+Django环境
查看>>
SendMessage、PostMessage原理
查看>>
如何使用Javascript XSLT 处理XML文件(支持Firefox)
查看>>