0001 function gui_eim_corr(cmnd_str,fig_id,r,rho,n,chanlocs,ep_times,plt_times,sort_var,fig_title)
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
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 if nargin==1,
0086 fig_id=[];
0087 elseif (nargin~=10) && (nargin~=2),
0088 error('plot_eimcorr.m requires 1,2, or 10 arguments.');
0089 end
0090
0091 if ~strcmp(cmnd_str,'initialize')
0092 if isempty(fig_id),
0093 fig_id=gcf;
0094 end
0095 if ~strcmp(get(fig_id,'tag'),'gui_corr')
0096
0097
0098 h_figs = get(0,'children');
0099 fig_id = findobj(h_figs,'flat',...
0100 'tag','gui_corr');
0101 if isempty(fig_id),
0102
0103
0104
0105 gui_corr('initialize');
0106 gui_corr(cmnd_str);
0107 return;
0108 end
0109 end
0110
0111
0112
0113
0114
0115
0116
0117 dat=get(gcf,'userdata');
0118 end
0119
0120
0121 if strcmp(cmnd_str,'initialize')
0122
0123 if isempty(fig_id),
0124 dat.fig_id=figure;
0125 else
0126 dat.fig_id=fig_id;
0127 figure(dat.fig_id);
0128 clf
0129 end
0130 set(dat.fig_id,'name','Correlation GUI','tag','gui_corr', ...
0131 'MenuBar','none','position',[139 282 690 420]);
0132
0133
0134 dat.r=r;
0135 dat.rho=rho;
0136 dat.t_r=r./sqrt( (1-(r.*r))/(n-2));
0137 dat.t_rho=rho./sqrt( (1-(rho.*rho))/(n-2));
0138 dat.n=n;
0139 dat.showing=r;
0140 dat.chanlocs=chanlocs;
0141 dat.times=ep_times;
0142 dat.sort_var=sort_var;
0143
0144
0145
0146
0147
0148
0149 frm_col=[1 1 1]*.702;
0150 uipanel(dat.fig_id,...
0151 'Units','normalized', ...
0152 'Position',[ 0 0.13 .72 0.87 ],...
0153 'shadowcolor','k', ...
0154 'highlightcolor',frm_col, ...
0155 'foregroundcolor',frm_col, ...
0156 'backgroundcolor',frm_col);
0157
0158 dat.h_time=axes('position',[0.1 .24 .6 .67]);
0159 dat.start_pt=find_tpt(plt_times(1),ep_times);
0160 dat.end_pt=find_tpt(plt_times(2),ep_times);
0161 plotted_pts=dat.start_pt:dat.end_pt;
0162 plotted_times=ep_times(dat.start_pt:dat.end_pt);
0163 [absmx mx_tpt]=max(max(abs(r(:,dat.start_pt:dat.end_pt))));
0164 plot([plotted_times(1) plotted_times(end)],[0 0],'k');
0165 hold on;
0166 dat.h_t0line=plot([0 0],[-1 1]*absmx,'k');
0167 set(dat.h_time,'ygrid','on');
0168 dat.h_showing=plot(dat.times,r');
0169 dat.h_showing=dat.h_showing;
0170 axis tight;
0171 v=axis;
0172 axis([plotted_times(1) plotted_times(end) v(3:4)]);
0173 dat.h_line=plot([1 1]*plotted_times(mx_tpt),v(3:4),'k');
0174 set(dat.h_line,'linewidth',2);
0175 h=xlabel('Time (msec)');
0176 set(h,'fontsize',14,'fontunits','normalized');
0177 h=ylabel(['r (EEG vs. ' sort_var ')']);
0178 dat.h_time_ylab=h;
0179 set(h,'fontsize',14,'fontunits','normalized');
0180 h=title(fig_title);
0181 set(h,'fontsize',18,'fontunits','normalized');
0182 bdf_code = [ 'tmppos = get(gca, ''currentpoint'');' ...
0183 'dat=get(gcf, ''userdata'');' ...
0184 'new_tpt=find_tpt(tmppos(1,1),dat.times);' ...
0185 'set(dat.h_line,''XData'',[1 1]*dat.times(new_tpt));' ...
0186 'set(dat.h_topo_time,''string'',num2str(dat.times(new_tpt)));' ...
0187 'axes(dat.h_topo);' ...
0188 'topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,''maplimits'',[-1 1]*dat.absmx);' ...
0189 'drawnow;' ...
0190 'set(dat.fig_id,''userdata'',dat);' ...
0191 'clear latpoint dattmp tmppos;' ...
0192 ];
0193 set(dat.h_time,'ButtonDownFcn',bdf_code);
0194 set(dat.h_showing,'ButtonDownFcn',bdf_code);
0195
0196
0197
0198
0199
0200
0201
0202 uipanel(dat.fig_id,...
0203 'Units','normalized', ...
0204 'Position',[ 0.719 0.13 0.281 0.87 ],...
0205 'shadowcolor','k', ...
0206 'highlightcolor',frm_col, ...
0207 'foregroundcolor',frm_col, ...
0208 'backgroundcolor',frm_col);
0209
0210
0211 dat.h_topo=axes('position',[0.66 .39 .42 .42],'box','off');
0212 dat.absmx=absmx;
0213
0214 topoplotMK(r(:,plotted_pts(mx_tpt)),chanlocs,'maplimits',[-1 1]*absmx);
0215
0216
0217
0218
0219 dat.h_cbar=axes('position',[0.77 .86 .2 .06]);
0220 cbar(dat.h_cbar);
0221 absmx=round(absmx*100)/100;
0222 set(gca,'xticklabel',[-absmx 0 absmx]);
0223 h_cbar_title=title('Pearson''s r');
0224 set(h_cbar_title,'fontsize',14);
0225
0226
0227
0228 uicontrol(dat.fig_id,...
0229 'Units','normalized', ...
0230 'Position',[ 0.905 0.315 0.07 0.06 ],...
0231 'String','msec',...
0232 'fontsize',14, ...
0233 'fontunits','normalized', ...
0234 'Style','text');
0235 dat.h_topo_time=uicontrol(dat.fig_id,...
0236 'CallBack','gui_eim_corr(''time jump'');',...
0237 'Units','normalized', ...
0238 'Position',[ 0.80 0.31 0.1 0.08 ], ...
0239 'String',num2str(plotted_times(mx_tpt)), ...
0240 'Style','edit', ...
0241 'Enable','on', ...
0242 'ToolTipString','Time point to visualize topographicaly.', ...
0243 'fontsize',14, ...
0244 'fontunits','normalized', ...
0245 'horizontalalignment','center', ...
0246 'BackGroundColor','w', ...
0247 'Tag','topo_time');
0248
0249
0250 dat.h_back1=uicontrol(dat.fig_id,...
0251 'CallBack','gui_eim_corr(''back one'');',...
0252 'Units','normalized', ...
0253 'Position',[ 0.81 0.23 0.055 0.07 ],...
0254 'String','<',...
0255 'fontsize',14, ...
0256 'fontunits','normalized', ...
0257 'Tag','back1', ...
0258 'ToolTipString','Show topography at preceding time point.', ...
0259 'Style','pushbutton');
0260
0261
0262 dat.h_forward1=uicontrol(dat.fig_id,...
0263 'CallBack','gui_eim_corr(''forward one'');',...
0264 'Units','normalized', ...
0265 'Position',[ 0.875 0.23 0.055 0.07 ],...
0266 'String','>', ...
0267 'fontsize',14, ...
0268 'fontunits','normalized', ...
0269 'Tag','forward1', ...
0270 'ToolTipString','Show topography at subsequent time point.', ...
0271 'Style','pushbutton');
0272
0273
0274 dat.h_back=uicontrol(dat.fig_id,...
0275 'CallBack','gui_eim_corr(''back'');',...
0276 'Units','normalized', ...
0277 'Position',[ 0.745 0.23 0.055 0.07 ],...
0278 'String','<<',...
0279 'fontsize',14, ...
0280 'fontunits','normalized', ...
0281 'Tag','back', ...
0282 'interruptible','on', ...
0283 'ToolTipString','Animate topography going backwards in time.', ...
0284 'Style','pushbutton');
0285
0286
0287 dat.h_forward=uicontrol(dat.fig_id,...
0288 'CallBack','gui_eim_corr(''forward'');',...
0289 'Units','normalized', ...
0290 'Position',[ 0.94 0.23 0.055 0.07 ],...
0291 'String','>>',...
0292 'fontsize',14, ...
0293 'fontunits','normalized', ...
0294 'Tag','back', ...
0295 'interruptible','on', ...
0296 'ToolTipString','Animate topography going forwards in time.', ...
0297 'Style','pushbutton');
0298
0299
0300 dat.h_stop=uicontrol(dat.fig_id,...
0301 'CallBack','dat=get(gcf,''userdata''); dat.interrupt=1; set(dat.fig_id,''userdata'',dat);',...
0302 'Units','normalized', ...
0303 'Position',[ 0.76 0.15 0.23 0.07 ],...
0304 'String','Stop Animation',...
0305 'fontsize',14, ...
0306 'fontunits','normalized', ...
0307 'Tag','stop', ...
0308 'enable','off', ...
0309 'ToolTipString','Stop topography animation.', ...
0310 'Style','pushbutton');
0311
0312
0313
0314
0315
0316
0317
0318 uipanel(dat.fig_id,...
0319 'Units','normalized', ...
0320 'Position',[ 0 0 1 0.133 ],...
0321 'shadowcolor','k', ...
0322 'highlightcolor',frm_col, ...
0323 'foregroundcolor',frm_col, ...
0324 'backgroundcolor',frm_col);
0325
0326
0327 stats={'Pearson''s r','t-score of r','Spearman''s rho','t-score of rho'};
0328
0329 uicontrol(dat.fig_id,...
0330 'Units','normalized', ...
0331 'Position',[ 0.01 0.06 0.2 0.06 ],...
0332 'String','Correlation Statistic',...
0333 'fontsize',12, ...
0334 'ToolTipString','Correlation statistic to plot against time.', ...
0335 'Style','text');
0336
0337 dat.h_stat=uicontrol(dat.fig_id,...
0338 'CallBack','gui_eim_corr(''change stat'');',...
0339 'Units','normalized', ...
0340 'Position',[ 0.02 0 0.18 0.07 ],...
0341 'fontsize',12, ...
0342 'String',stats, ...
0343 'Style','popup', ...
0344 'ToolTipString','Correlation statistic to plot across time.', ...
0345 'tag','stat');
0346
0347
0348
0349 uicontrol(dat.fig_id,...
0350 'Units','normalized', ...
0351 'Position',[ 0.22 0.06 0.24 0.06 ],...
0352 'String','Time Range (Min Max):',...
0353 'fontsize',12, ...
0354 'Style','text');
0355
0356 dat.h_timerange=uicontrol(dat.fig_id,...
0357 'CallBack','gui_eim_corr(''new time limits'');',...
0358 'Units','normalized', ...
0359 'fontsize',12, ...
0360 'BackGroundColor','w', ...
0361 'Position',[ 0.25 0.017 0.16 0.06 ],...
0362 'String',num2str(plt_times), ...
0363 'Style','edit', ...
0364 'ToolTipString','Miniumum and maximum time on Time x Correlation axis.', ...
0365 'tag','timerange');
0366
0367
0368
0369 uicontrol(dat.fig_id,...
0370 'Units','normalized', ...
0371 'Position',[ 0.48 0.06 0.26 0.06 ],...
0372 'String','Statistic Range (Min Max):',...
0373 'HorizontalAlignment','left', ...
0374 'fontsize',12, ...
0375 'Style','text');
0376
0377 dat.h_statrange=uicontrol(dat.fig_id,...
0378 'CallBack','gui_eim_corr(''new statistic limits'');',...
0379 'Units','normalized', ...
0380 'fontsize',12, ...
0381 'BackGroundColor','w', ...
0382 'Position',[ 0.52 0.017 0.16 0.06 ],...
0383 'String',num2str(round(v(3:4)*100)/100), ...
0384 'ToolTipString','Miniumum and maximum correlation statistic on Time x Correlation axis.', ...
0385 'Style','edit', ...
0386 'tag','statrange');
0387
0388
0389 uicontrol(dat.fig_id,...
0390 'CallBack','close(gcf);',...
0391 'Units','normalized', ...
0392 'Position',[ 0.75 0.025 0.11 0.1 ],...
0393 'String','Cancel',...
0394 'fontsize',12, ...
0395 'Tag','cancel', ...
0396 'ToolTipString','Close GUI', ...
0397 'Style','pushbutton');
0398
0399 dat.help_msg=sprintf(['Hold mouse cursor over a GUI control for an explanation of what it does.\n\n', ...
0400 'Time x Correlation axis visualizes the correlation between EEG and %s simultaneously at all loaded electrodes. ' ...
0401 'Each colored line corresponds to a different electrode.\n\nClick on Time x Correlation axis to visualize the scalp topography\n', ...
0402 'of the correlations at that point in time.\n\nClick on electrodes in scalp topography to see electrode name.\n\n', ...
0403 'This GUI was produced by gui_eim_corr.m'],sort_var);
0404
0405
0406 uicontrol(dat.fig_id,...
0407 'CallBack','dat=get(gcf,''userdata''); helpdlg(dat.help_msg,''ERPimage Correlation GUI Help'');', ...
0408 'Units','normalized', ...
0409 'Position',[ 0.87 0.025 0.11 0.1 ],...
0410 'String','Help',...
0411 'fontsize',12, ...
0412 'Tag','help', ...
0413 'ToolTipString','Click for help', ...
0414 'Style','pushbutton');
0415 dat.interrupt=1;
0416 set(dat.fig_id,'userdata',dat);
0417 elseif strcmpi(cmnd_str,'time jump'),
0418 axes(dat.h_topo);
0419 new_tpt=find_tpt(str2num(get(dat.h_topo_time,'string')), ...
0420 dat.times);
0421 if new_tpt<dat.start_pt,
0422 errordlg('That time is too early.');
0423 elseif new_tpt>dat.end_pt,
0424 errordlg('That time is too late.');
0425 else
0426 topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0427 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0428 set(dat.h_line,'XData',[1 1]*dat.times(new_tpt));
0429 drawnow;
0430 set(dat.fig_id,'userdata',dat);
0431 end
0432 elseif strcmpi(cmnd_str,'back one'),
0433 axes(dat.h_topo);
0434 current_tpt=find_tpt(str2double(get(dat.h_topo_time,'string')), ...
0435 dat.times);
0436 new_tpt=current_tpt-1;
0437 if new_tpt<dat.start_pt,
0438 errordlg('Can''t go back any further.');
0439 else
0440 topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0441 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0442 set(dat.h_line,'XData',[1 1]*dat.times(new_tpt));
0443 drawnow;
0444 set(dat.fig_id,'userdata',dat);
0445 end
0446 elseif strcmpi(cmnd_str,'forward one'),
0447 axes(dat.h_topo);
0448 current_tpt=find_tpt(str2double(get(dat.h_topo_time,'string')), ...
0449 dat.times);
0450 new_tpt=current_tpt+1;
0451 if new_tpt>dat.end_pt,
0452 errordlg('Can''t go forward any further.');
0453 else
0454 topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0455 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0456 set(dat.h_line,'XData',[1 1]*dat.times(new_tpt));
0457 drawnow;
0458 set(dat.fig_id,'userdata',dat);
0459 end
0460 elseif strcmpi(cmnd_str,'back'),
0461 axes(dat.h_topo);
0462 interrupt=0;
0463 dat.interrupt=0;
0464 set(dat.h_stop,'enable','on');
0465 set(dat.h_forward,'enable','off');
0466 set(dat.h_back,'enable','off');
0467 set(dat.fig_id,'userdata',dat);
0468 drawnow;
0469 current_tpt=find_tpt(str2double(get(dat.h_topo_time,'string')), ...
0470 dat.times);
0471 new_tpt=current_tpt-1;
0472 loop_ct=0;
0473 while (new_tpt>=dat.start_pt) && (interrupt~=1),
0474 axes(dat.h_topo);
0475 topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0476 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0477 set(dat.h_line,'XData',[1 1]*dat.times(new_tpt));
0478 drawnow;
0479 new_tpt=new_tpt-1;
0480 loop_ct=loop_ct+1;
0481 if loop_ct==5,
0482 loop_ct=0;
0483 new_tmp=get(dat.fig_id,'userdata');
0484 interrupt=new_tmp.interrupt;
0485 end
0486 end
0487 drawnow;
0488 dat.interrupt=0;
0489 new_tpt=new_tpt+1;
0490 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0491 set(dat.h_stop,'enable','off');
0492 set(dat.h_forward,'enable','on');
0493 set(dat.h_back,'enable','on');
0494 set(dat.fig_id,'userdata',dat);
0495 elseif strcmpi(cmnd_str,'forward'),
0496 axes(dat.h_topo);
0497 interrupt=0;
0498 dat.interrupt=0;
0499 set(dat.h_stop,'enable','on');
0500 set(dat.h_forward,'enable','off');
0501 set(dat.h_back,'enable','off');
0502 set(dat.fig_id,'userdata',dat);
0503 drawnow;
0504 current_tpt=find_tpt(str2double(get(dat.h_topo_time,'string')), ...
0505 dat.times);
0506 new_tpt=current_tpt+1;
0507 loop_ct=0;
0508 while (new_tpt<=dat.end_pt) && (interrupt~=1),
0509 axes(dat.h_topo);
0510 topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0511 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0512 set(dat.h_line,'XData',[1 1]*dat.times(new_tpt));
0513 drawnow;
0514 new_tpt=new_tpt+1;
0515 loop_ct=loop_ct+1;
0516 if loop_ct==5,
0517 loop_ct=0;
0518 new_tmp=get(dat.fig_id,'userdata');
0519 interrupt=new_tmp.interrupt;
0520 end
0521 end
0522 drawnow;
0523 dat.interrupt=0;
0524 new_tpt=new_tpt-1;
0525 set(dat.h_topo_time,'string',num2str(dat.times(new_tpt)));
0526 set(dat.h_stop,'enable','off');
0527 set(dat.h_forward,'enable','on');
0528 set(dat.h_back,'enable','on');
0529 set(dat.fig_id,'userdata',dat);
0530 elseif strcmpi(cmnd_str,'change stat'),
0531 stat=get(dat.h_stat,'value');
0532 switch stat
0533 case 1,
0534 dat.showing=dat.r;
0535 cbar_title='Pearson''s r';
0536 ylab=['r (EEG vs. ' dat.sort_var ')'];
0537 case 2,
0538 dat.showing=dat.t_r;
0539 cbar_title='t-score of r';
0540 ylab=['t of r (EEG vs. ' dat.sort_var ')'];
0541 case 3,
0542 dat.showing=dat.rho;
0543 cbar_title='Spearman''s rho';
0544 ylab=['rho (EEG vs. ' dat.sort_var ')'];
0545 case 4,
0546 dat.showing=dat.t_rho;
0547 cbar_title='t-score of rho';
0548 ylab=['t of rho (EEG vs. ' dat.sort_var ')'];
0549 end
0550
0551
0552 axes(dat.h_time);
0553 delete(dat.h_showing);
0554 delete(dat.h_line);
0555 plotted_times=dat.times(dat.start_pt:dat.end_pt);
0556 dat.h_showing=plot(dat.times,dat.showing');
0557 r_mx=max(max(dat.showing));
0558 r_mn=min(min(dat.showing));
0559 r_rng=r_mx-r_mn;
0560 r_plt_rng=[r_mn-r_rng*.02 r_mx+r_rng*.02];
0561 r_plt_rng=round(r_plt_rng*100)/100;
0562 axis([plotted_times(1) plotted_times(end) r_plt_rng]);
0563 set(dat.h_statrange,'string',num2str(r_plt_rng));
0564 set(dat.h_t0line,'YData',r_plt_rng);
0565 current_tpt=find_tpt(str2double(get(dat.h_topo_time,'string')), ...
0566 dat.times);
0567 h_line=plot([1 1]*dat.times(current_tpt),r_plt_rng,'k');
0568 set(h_line,'linewidth',2);
0569 dat.h_line=h_line;
0570 set(dat.h_time_ylab,'string',ylab);
0571
0572 bdf_code = [ 'tmppos = get(gca, ''currentpoint'');' ...
0573 'dat=get(gcf, ''userdata'');' ...
0574 'new_tpt=find_tpt(tmppos(1,1),dat.times);' ...
0575 'set(dat.h_line,''XData'',[1 1]*dat.times(new_tpt));' ...
0576 'set(dat.h_topo_time,''string'',num2str(dat.times(new_tpt)));' ...
0577 'axes(dat.h_topo);' ...
0578 'topoplotMK(dat.showing(:,new_tpt),dat.chanlocs,''maplimits'',[-1 1]*dat.absmx);' ...
0579 'drawnow;' ...
0580 'set(dat.fig_id,''userdata'',dat);' ...
0581 'clear latpoint dattmp tmppos;' ...
0582 ];
0583 set(dat.h_showing,'ButtonDownFcn',bdf_code);
0584
0585
0586
0587 axes(dat.h_topo);
0588 dat.absmx=max(max(abs(dat.showing(:,dat.start_pt:dat.end_pt))));
0589 topoplotMK(dat.showing(:,current_tpt),dat.chanlocs,'maplimits',[-1 1]*dat.absmx);
0590
0591
0592 axes(dat.h_cbar);
0593 cla;
0594 cbar(dat.h_cbar);
0595 absmx=round(dat.absmx*100)/100;
0596 set(gca,'xticklabel',[-absmx 0 absmx]);
0597 h_cbar_title=title(cbar_title);
0598 set(h_cbar_title,'fontsize',14);
0599
0600 set(dat.fig_id,'userdata',dat);
0601 elseif strcmpi(cmnd_str,'new time limits'),
0602
0603 plotted_times=dat.times(dat.start_pt:dat.end_pt);
0604 tme_lim=str2num(get(dat.h_timerange,'string'));
0605 if length(tme_lim)~=2,
0606 errordlg('Enter exactly two values for time range (desired Min and Max values).','ERPimage Correlation GUI Error');
0607 set(dat.h_timerange,'string',num2str([plotted_times(1) plotted_times(end)]));
0608 elseif tme_lim(2)<tme_lim(1),
0609 errordlg('The second time range value must be greater than the first (enter desired Min then Max).','ERPimage Correlation GUI Error');
0610 set(dat.h_timerange,'string',num2str([plotted_times(1) plotted_times(end)]));
0611 elseif (tme_lim(1)<dat.times(1)) || (tme_lim(2)>dat.times(end))
0612 errordlg(sprintf('Time range values must be between %d and %d msec.',dat.times(1),dat.times(end)),'ERPimage Correlation GUI Error');
0613 set(dat.h_timerange,'string',num2str([plotted_times(1) plotted_times(end)]));
0614 else
0615
0616 set(dat.h_time,'xlim',tme_lim);
0617 dat.start_pt=find_tpt(tme_lim(1),dat.times);
0618 dat.end_pt=find_tpt(tme_lim(2),dat.times);
0619 set(dat.fig_id,'userdata',dat);
0620 end
0621 elseif strcmpi(cmnd_str,'new statistic limits'),
0622
0623 plotted_limits=get(dat.h_time,'ylim');
0624 new_lim=str2num(get(dat.h_statrange,'string'));
0625 if length(new_lim)~=2,
0626 errordlg('Enter exactly two values for statistic range (desired Min and Max values).','ERPimage Correlation GUI Error');
0627 set(dat.h_statrange,'string',num2str([plotted_limits(1) plotted_limits(end)]));
0628 elseif new_lim(2)<new_lim(1),
0629 errordlg('The second statistic range value must be greater than the first (enter desired Min then Max).','ERPimage Correlation GUI Error');
0630 set(dat.h_statrange,'string',num2str([plotted_limits(1) plotted_limits(end)]));
0631 else
0632
0633 set(dat.h_time,'ylim',new_lim);
0634 set(dat.h_t0line,'YData',new_lim);
0635 set(dat.h_line,'YData',new_lim);
0636 end
0637 end