Home > vbmeg > demo > sample_scripts > plot_fmri_flat_sample.m

plot_fmri_flat_sample

PURPOSE ^

---

SYNOPSIS ^

function vb_job_plot_fmri_flat_sample

DESCRIPTION ^

 ---
 This is a sample script for plotting fMRI activity onto flatten
 map. 

 2006-03-24 Taku Yoshioka
 ---

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_job_plot_fmri_flat_sample
0002 % ---
0003 % This is a sample script for plotting fMRI activity onto flatten
0004 % map.
0005 %
0006 % 2006-03-24 Taku Yoshioka
0007 % ---
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 sbj_id = 'TY';
0013 cond = 'Neon-Fix';
0014 data_dir = [sbj_id '/data/'];
0015 brain_file = [data_dir sbj_id '.brain.mat'];
0016 flat_file = [data_dir sbj_id '_occip.flat.mat'];
0017 act_file = [data_dir sbj_id '.act.mat'];
0018 
0019 % Plot parameters
0020 plot_parm.LRflag = 'L';
0021 plot_parm.mtype = 'o'; 
0022 
0023 % Activity map
0024 act = vb_get_act(act_file,[sbj_id '_' cond]);
0025 plot_parm.J = act.xxP;
0026 
0027 % Load cortical model information for index transformation
0028 [Ndipole,NdipoleL,BV_index] = vb_load_cortex_info(brain_file);
0029 plot_parm.ix_J = [BV_index.Left; BV_index.Right];
0030 clear Ndipole NdipoleL BV_index
0031 
0032 % Load flat map data
0033 load(flat_file,'Vflat','Cflat','Fflat','BV_index','Vinfo');
0034 plot_parm.V = Vflat; 
0035 plot_parm.C = Cflat; 
0036 BV_index = [BV_index.Left; BV_index.Right];
0037 
0038 % Index transformation
0039 ix_trans = zeros(max([BV_index; plot_parm.ix_J]),1);
0040 ix_trans(BV_index) = 1:length(BV_index);
0041 ix_J = ix_trans(plot_parm.ix_J);
0042 
0043 % Check LR flag (this code should be moved into vb_plot_brain_flat.m)
0044 switch plot_parm.LRflag, 
0045  case 'L', 
0046   plot_parm.F = Fflat.F3L;
0047   ix = find(ix_J<=Vinfo.NdipoleL & ix_J~=0);
0048  case 'R', 
0049   plot_parm.F = Fflat.F3R; 
0050   ix = find(ix_J>Vinfo.NdipoleL & ix_J~=0);
0051  case 'LR',
0052   plot_parm.F = [Fflat.F3L; Fflat.F3R]; 
0053   ix = find(ix_J~=0);
0054   ix_L = 1:Vinfo.NdipoleL;
0055   ix_R = Vinfo.NdipoleL+1:size(Vflat,1);
0056   mapsize = max(Vflat(:,2))-min(Vflat(:,2));
0057   plot_parm.V(ix_L,2) = plot_parm.V(ix_L,2)-mapsize/2;
0058   plot_parm.V(ix_R,2) = plot_parm.V(ix_R,2)+mapsize/2;
0059 end
0060 clear Vflat Fflat Cflat; 
0061 
0062 % Set activity
0063 plot_parm.J = plot_parm.J(ix); 
0064 plot_parm.ix_J = ix_J(ix); 
0065 
0066 % Invoke plot function
0067 vb_plot_brain_flat(plot_parm);
0068 view([90 90]);
0069 axis equal; 
0070 axis off;

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005