0001 function job_plot_cmap_update_spatialpattern(inst_id)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 global vbmeg_inst;
0036 if isempty(vbmeg_inst.plotcmap{inst_id}.V), return; end
0037
0038
0039
0040
0041
0042 h_fig = vbmeg_inst.plotcmap{inst_id}.h_fig;
0043 h_space = vbmeg_inst.plotcmap{inst_id}.h_space;
0044 F = vbmeg_inst.plotcmap{inst_id}.F;
0045 plot_parm = vbmeg_inst.plotcmap{inst_id}.plot_parm;
0046 Jinfo = vbmeg_inst.plotcmap{inst_id}.Jinfo;
0047 Jmin = vbmeg_inst.plotcmap{inst_id}.Jmin;
0048 Jmax_plot = vbmeg_inst.plotcmap{inst_id}.Jmax_plot;
0049 Jmin_plot = vbmeg_inst.plotcmap{inst_id}.Jmin_plot;
0050 TFinfo = vbmeg_inst.plotcmap{inst_id}.TFinfo;
0051 TFmin = vbmeg_inst.plotcmap{inst_id}.TFmin;
0052 TFmax_plot = vbmeg_inst.plotcmap{inst_id}.TFmax_plot;
0053 TFmin_plot = vbmeg_inst.plotcmap{inst_id}.TFmin_plot;
0054 ix_peak = vbmeg_inst.plotcmap{inst_id}.ix_peak;
0055 cb2 = vbmeg_inst.plotcmap{inst_id}.cb2;
0056 cb3 = vbmeg_inst.plotcmap{inst_id}.cb3;
0057 cb7 = vbmeg_inst.plotcmap{inst_id}.cb7;
0058 cb8 = vbmeg_inst.plotcmap{inst_id}.cb8;
0059 cb5 = vbmeg_inst.plotcmap{inst_id}.cb5;
0060 ed5 = vbmeg_inst.plotcmap{inst_id}.ed5;
0061 lb1 = vbmeg_inst.plotcmap{inst_id}.lb1;
0062 act_file = vbmeg_inst.plotcmap{inst_id}.act_file;
0063 model_type_original_rb = ...
0064 vbmeg_inst.plotcmap{inst_id}.model_type_original_rb;
0065 Vtal = vbmeg_inst.plotcmap{inst_id}.Vtal;
0066 nextDD = vbmeg_inst.plotcmap{inst_id}.nextDD;
0067 nextIX = vbmeg_inst.plotcmap{inst_id}.nextIX;
0068 Jmax_plot_edit = vbmeg_inst.plotcmap{inst_id}.Jmax_plot_edit;
0069 Jmin_plot_edit = vbmeg_inst.plotcmap{inst_id}.Jmin_plot_edit;
0070 area_file = vbmeg_inst.plotcmap{inst_id}.area_file;
0071 area_key = vbmeg_inst.plotcmap{inst_id}.area_key;
0072
0073
0074
0075
0076
0077 set(h_fig,'Pointer','arrow');
0078 drawnow;
0079
0080
0081 if get(model_type_original_rb,'Value')==1,
0082 V = vbmeg_inst.plotcmap{inst_id}.V;
0083 inf_C = [];
0084 else
0085 V = vbmeg_inst.plotcmap{inst_id}.Vinf;
0086 inf_C = vbmeg_inst.plotcmap{inst_id}.inf_C;
0087 end
0088
0089
0090 LRflag = [];
0091 if get(cb2,'Value')==get(cb2,'Max'), LRflag = 'L'; end
0092 if get(cb3,'Value')==get(cb3,'Max'), LRflag = [LRflag 'R']; end;
0093 if isempty(LRflag),
0094 set(cb2,'Value',get(cb2,'Max'));
0095 LRflag = 'L';
0096 end
0097 plot_parm.LRflag = LRflag;
0098
0099
0100 if get(cb5,'Value')==get(cb5,'Max'),
0101 R = str2num(get(ed5,'String'))*1e-3;
0102 ix_area = find(nextDD{ix_peak}<=R);
0103 ix_area = nextIX{ix_peak}(ix_area);
0104 else
0105 ix_area = [];
0106 end
0107
0108
0109
0110
0111
0112 J0 = job_plot_cmap_get_spatialpattern(inst_id);
0113
0114 if isempty(J0),
0115 isact = 0;
0116 else
0117 isact=1;
0118 end
0119 plot_parm.isact = isact;
0120
0121
0122 Jmax_plot = str2num(get(Jmax_plot_edit,'String'));
0123 Jmin_plot = str2num(get(Jmin_plot_edit,'String'));
0124
0125 if isempty(Jmax_plot),
0126 Jmax_plot = max(J0(:));
0127 set(Jmax_plot_edit,'String',num2str(Jmax_plot));
0128 end
0129
0130 if isempty(Jmin_plot),
0131 Jmin_plot = Jmax_plot*0.1;
0132 set(Jmin_plot_edit,'String',num2str(Jmin_plot));
0133 end
0134
0135
0136
0137
0138
0139 if ~isempty(Jinfo),
0140 if Jmin<0,
0141 plot_parm.wmode = 0;
0142 else
0143 plot_parm.wmode = 1;
0144 end
0145 elseif ~isempty(TFinfo),
0146 if TFmin<0,
0147 plot_parm.wmode = 0;
0148 else
0149 plot_parm.wmode = 1;
0150 end
0151 end
0152
0153
0154 if ~isempty(area_key) && get(cb8,'Value'),
0155 area_colors = [ 1 0 0; 0 1 0; 0 0 1; 1 1 0; 1 0 1; 0 1 1;
0156 1 1 0.5; 0.5 0 0; 0 0.5 1; 0.5 1 0; 1 0.5 1; 0 0 0.5;
0157 1 0.5 0; 0 1 0.5; 0.5 0 1; 0 0.5 0; 0.5 1 1; 1 0 0.5;
0158 1 0.5 0.5; 0 0.5 0.5; 0.5 1 0.5;
0159 0.5 0 0.5; 0.5 0.5 1; 0.5 0.5 0 ];
0160
0161 if ~iscell(area_key), area_key = {area_key}; end
0162 plot_parm.area.area_file = area_file;
0163 plot_parm.area.key = area_key;
0164 plot_parm.area.transparent = true;
0165
0166 for i=1:length(area_key)
0167 plot_parm.area.clr{i} ...
0168 = area_colors(1+mod(i-1,length(area_colors)),:);
0169 end
0170 end
0171
0172 set(h_fig,'CurrentAxes',h_space);
0173 cla;
0174 vb_plot_cortex(plot_parm,V,F,inf_C,J0,Jmin_plot,Jmax_plot,ix_area);
0175 axis off;
0176 axis tight;
0177 axis equal;
0178 colormap(jet);
0179
0180 if datenum(version('-date'))<=733071,
0181 reset(vbmeg_inst.plotcmap{inst_id}.h_cbar);
0182 colorbar(vbmeg_inst.plotcmap{inst_id}.h_cbar);
0183 else
0184 pos = get(vbmeg_inst.plotcmap{inst_id}.h_cbar,'Position');
0185 delete(vbmeg_inst.plotcmap{inst_id}.h_cbar);
0186 vbmeg_inst.plotcmap{inst_id}.h_cbar = colorbar('Position',pos);
0187 end
0188
0189
0190
0191
0192
0193 plot3(V(ix_peak,1),V(ix_peak,2),V(ix_peak,3),'gx',...
0194 'MarkerSize',15,'LineWidth',3);
0195
0196
0197
0198
0199
0200 job_plot_cmap_update_talcoord(inst_id);
0201
0202 set(h_fig,'Pointer','arrow');
0203
0204 job_plot_cmap_push_rotate_button(inst_id);
0205
0206 return;