0001 function job_view_lf_update_sensorpattern(inst_id)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 global vbmeg_inst;
0014 if isempty(vbmeg_inst.viewlf{inst_id}.basisfile), return; end
0015
0016
0017
0018
0019
0020 h_fig = vbmeg_inst.viewlf{inst_id}.h_fig;
0021 h_sensor = vbmeg_inst.viewlf{inst_id}.h_sensor;
0022
0023 ix_selected_vertex = vbmeg_inst.viewlf{inst_id}.ix_selected_vertex;
0024 cb4 = vbmeg_inst.viewlf{inst_id}.cb4;
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
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
0047
0048
0049
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
0060 set(h_fig,'CurrentAxes',h_sensor);
0061 vb_plot_sensor_2d(pick(:,1:3),basis',clim);
0062 axis off;
0063 axis equal;
0064
0065 colormap(jet);
0066
0067
0068 colorbar;