Home > vbmeg > 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 
0066 % Plot sensor
0067 vb_plot_sensor_2d(pick(:,1:3),bexp0,clim);
0068 vb_plot_sensor_2d_head_plot_add(gca);
0069 
0070 % Plot selected sensor
0071 job_plot_meg_choose_plot_sensor(inst_id, 'plot'); 
0072 
0073 set(h_space, 'XtickLabel', []);
0074 set(h_space, 'YtickLabel', []);
0075 set(h_space, 'TickLength', [0 0]);
0076 set(h_space, 'Color', 'none');
0077 set(h_space, 'XColor', get(h_fig, 'Color'));
0078 set(h_space, 'YColor', get(h_fig, 'Color'));
0079 
0080 axis equal;
0081 axis tight;
0082 colormap(jet);
0083 
0084 colorbar;
0085 cb_str = ['job_plot_meg_choose_plot_sensor(', num2str(inst_id), ',1)'];
0086 
0087 set(get(h_space, 'children'), 'HitTest', 'off');
0088 set(h_space, 'HitTest', 'on');
0089 set(h_space, 'ButtonDownFcn', cb_str);
0090

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