Home > functions > job > job_view_leadfield_dir > job_view_lf_update_sensorpattern.m

job_view_lf_update_sensorpattern

PURPOSE ^

Update contour map of lead field

SYNOPSIS ^

function job_view_lf_update_sensorpattern(inst_id)

DESCRIPTION ^

 Update contour map of lead field

 --- Syntax
 function job_view_lf_update_sensorpattern(inst_id)

 --- History
 2009-01-26 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_view_lf_update_sensorpattern(inst_id)
0002 % Update contour map of lead field
0003 %
0004 % --- Syntax
0005 % function job_view_lf_update_sensorpattern(inst_id)
0006 %
0007 % --- History
0008 % 2009-01-26 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.viewlf{inst_id}.basisfile), return; end
0015 
0016 %
0017 % Global variables
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 h_fig = vbmeg_inst.viewlf{inst_id}.h_fig; 
0021 h_sensor = vbmeg_inst.viewlf{inst_id}.h_sensor;
0022 %h_cbar_sensor = vbmeg_inst.viewlf{inst_id}.h_cbar_sensor;
0023 ix_selected_vertex = vbmeg_inst.viewlf{inst_id}.ix_selected_vertex;
0024 cb4 = vbmeg_inst.viewlf{inst_id}.cb4; % 'fix_sensor_colorbar'
0025 Bmin_plot = vbmeg_inst.viewlf{inst_id}.Bmin_plot;
0026 Bmax_plot = vbmeg_inst.viewlf{inst_id}.Bmax_plot;
0027 MEGinfo = vbmeg_inst.viewlf{inst_id}.MEGinfo;
0028 pick = vbmeg_inst.viewlf{inst_id}.pick;
0029 sensor_type = vbmeg_inst.viewlf{inst_id}.sensor_type;
0030 
0031 %
0032 % Select sensor
0033 %
0034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0035 basis = vbmeg_inst.viewlf{inst_id}.basis_org_smoothed(:, ...
0036                                                   ix_selected_vertex);
0037 if sensor_type~=-1, 
0038   ix1 = find(MEGinfo.ChannelInfo.Type==sensor_type);
0039   ix2 = find(vb_info_get_active_channel(MEGinfo,1)==true);
0040   ix = intersect(ix1,ix2);
0041   basis = basis(ix);
0042   pick = vbmeg_inst.viewlf{inst_id}.pick(ix,:);
0043 end
0044 
0045 %
0046 % Draw contour map
0047 %
0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0049 % Scaling
0050 if get(cb4,'Value')~=get(cb4,'Max'), 
0051   basis_max = max(abs(basis));
0052   Bmin_plot = -1*basis_max;
0053   Bmax_plot = 1*basis_max;
0054   vbmeg_inst.viewlf{inst_id}.Bmin_plot = Bmin_plot;
0055   vbmeg_inst.viewlf{inst_id}.Bmax_plot = Bmax_plot;
0056 end
0057 clim = [Bmin_plot Bmax_plot];
0058 
0059 % Plot
0060 set(h_fig,'CurrentAxes',h_sensor);
0061 vb_plot_sensor_2d(pick(:,1:3),basis',clim);
0062 axis off;
0063 axis equal;
0064 %axis tight;
0065 colormap(jet);
0066 %reset(h_cbar_sensor);
0067 %colorbar(h_cbar_sensor);
0068 colorbar;

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