plot act data( Act in *.act.mat ) to analyze file vb_plot_act_to_analyze(analyzefile,brainfile,actfile,act_number) --- Input analyzefile : String analyze image (T1) file name (*.hdr) brainfile : String brain file name (*.brain.mat) actfile : String act file file name (*.act.mat) act_number : N act number (Act{N}) --- Output figure : plot act infomation point on the analyze image written by M Osako 2006-06-14 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function vb_plot_act_to_analyze(analyzefile,brainfile,actfile,act_key) 0002 % plot act data( Act in *.act.mat ) to analyze file 0003 % 0004 % vb_plot_act_to_analyze(analyzefile,brainfile,actfile,act_number) 0005 % 0006 % --- Input 0007 % analyzefile : String analyze image (T1) file name (*.hdr) 0008 % brainfile : String brain file name (*.brain.mat) 0009 % actfile : String act file file name (*.act.mat) 0010 % act_number : N act number (Act{N}) 0011 % --- Output 0012 % figure : plot act infomation point on the analyze image 0013 % 0014 % written by M Osako 2006-06-14 0015 % 0016 % Copyright (C) 2011, ATR All Rights Reserved. 0017 % License : New BSD License(see VBMEG_LICENSE.txt) 0018 0019 %% transform analyze coord (left-handed) to right-handed coord 0020 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile); 0021 0022 [V,F] = vb_load_cortex(brainfile); 0023 Act = vb_get_act(actfile,act_key); 0024 0025 %% transform spm right-handed coord to analyze coord 0026 Vana = vb_spm_right_to_analyze_right(V,Vdim,Vsize); 0027 0028 %% search act point 0029 V_act=Vana(find(Act.xxP > 0.2*10^(-10)),:); 0030 0031 %% set Z coord scale 0032 V_act_min=fix(min(V_act(:,3))); 0033 V_act_max=ceil(max(V_act(:,3))); 0034 Vact_scale=V_act_min:V_act_max; 0035 0036 ZScale_Vact = sort(fix(V_act(:,3))); 0037 Vz=[]; 0038 for n=1:length(Vact_scale), 0039 if sum(find(Vact_scale(n) == ZScale_Vact)) > 0, 0040 Vz=[Vz ; Vact_scale(n)]; 0041 end 0042 end 0043 0044 %%plot act point on the analyze image 0045 vb_plot_slice( B,V_act,Vz );