Home > functions > job > job_plot_meg_dir > job_plot_meg_update_spatialpattern.m

job_plot_meg_update_spatialpattern

PURPOSE ^

Update contour map of MEG signal

SYNOPSIS ^

function job_plot_meg_update_spatialpattern(inst_id)

DESCRIPTION ^

 Update contour map of MEG signal

 --- Syntax
 function job_plot_meg_update_spatialpattern(inst_id)

 --- History
 2008-09-02 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 job_plot_meg_update_spatialpattern(inst_id)
0002 % Update contour map of MEG signal
0003 %
0004 % --- Syntax
0005 % function job_plot_meg_update_spatialpattern(inst_id)
0006 %
0007 % --- History
0008 % 2008-09-02 Taku Yoshioka
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 global vbmeg_inst; 
0014 if isempty(vbmeg_inst.plotmeg{inst_id}.bexp), return; end
0015 
0016 %
0017 % Global variables
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 h_fig = vbmeg_inst.plotmeg{inst_id}.h_fig; 
0021 h_space = vbmeg_inst.plotmeg{inst_id}.h_space;
0022 n_trial = vbmeg_inst.plotmeg{inst_id}.n_trial;
0023 t = vbmeg_inst.plotmeg{inst_id}.t;
0024 pick = vbmeg_inst.plotmeg{inst_id}.pick;
0025 MEGinfo = vbmeg_inst.plotmeg{inst_id}.MEGinfo;
0026 cb1 = vbmeg_inst.plotmeg{inst_id}.cb1;
0027 cc_max = max(max(abs(vbmeg_inst.plotmeg{inst_id}.bexp(:,:,n_trial))));
0028 pretrigger = vb_meginfo_get_pre_trigger(MEGinfo);
0029 if isempty(pretrigger), pretrigger = 0; end
0030 tt = round((t(1):t(2))*MEGinfo.SampleFreq/1000+pretrigger+1);
0031 bexp0 = mean(vbmeg_inst.plotmeg{inst_id}.bexp(:,tt,n_trial),2)';
0032 ed5 = vbmeg_inst.plotmeg{inst_id}.ed5;
0033 
0034 %
0035 % Select sensor
0036 %
0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0038 sensor_type = vbmeg_inst.plotmeg{inst_id}.sensor_type;
0039 
0040 if sensor_type~=-1, 
0041   ix = find(MEGinfo.ChannelInfo.Type==sensor_type);
0042   bexp0 = bexp0(ix);
0043   pick = pick(ix,:);
0044 end
0045 
0046 %
0047 % Draw contour map
0048 %
0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0050 
0051 % Colormap
0052 if get(cb1,'Value')==get(cb1,'Max')
0053   c = str2num(get(ed5,'String'));
0054   if c<0, c = abs(c); end
0055   clim = [-c c];
0056   %clim = 0.7*[-cc_max cc_max];
0057 else
0058   c = max(abs(bexp0));
0059   set(ed5,'String',num2str(ceil(c)));
0060   clim = [-c c];
0061   %clim = [-1*max(abs(bexp0)) max(abs(bexp0))];
0062 end
0063 
0064 set(h_fig,'CurrentAxes',h_space);
0065 %job_plot_meg_plot2D(pick(:,1:3),bexp0,clim);
0066 vb_plot_sensor_2d(pick(:,1:3),bexp0,clim);
0067 axis off;
0068 axis equal;
0069 axis tight;
0070 colormap(jet);
0071 
0072 colorbar;

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005