Commit 55d06e95 authored by Mike Cichonski's avatar Mike Cichonski
Browse files

Merge branch 'dev-vised' into 'master'

Dev vised



See merge request !7
parents b5d89dab 1d07a063
......@@ -1178,7 +1178,8 @@ else
end;
if strcmpi(g.plotdata2, 'off')
axes(ax1)
cla
obj_2_clear = findobj(ax1,'tag','text');
cla(obj_2_clear); % clear all except text
end;
oldspacing = g.spacing;
......@@ -1218,13 +1219,13 @@ else
plot(plot_p1, plot_p2(ci),'<', ...
'MarkerEdgeColor', plot_colour, ...
'MarkerFaceColor', plot_colour, ...
'MarkerSize', 8);
'MarkerSize', 8,'tag',['marker_' num2str(chan_inds(ci))]);
%plot data
if fi==manual_mark_ind || ~g.chan_marks_struct(manual_mark_ind).flags(chan_inds(ci));
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(low_high_range), ...
data(chan_inds(ci),low_high_range) + tmp_offset, zlowhigh, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
end
end
......@@ -1262,8 +1263,10 @@ else
'CData',cdat, ...
'LineStyle','none');
alpha(sh,g.marks_col_alpha);
text(figdim(2),ylims(1)+inter_time_mark_offset*tmi+(time_marks_offset(i))-(inter_time_mark_offset*length(g.time_marks_struct)), ...
g.time_marks_struct(tmi).label,'color',g.time_marks_struct(tmi).color,'interpreter','none');
if p1==0;
text(figdim(2),ylims(1)+inter_time_mark_offset*tmi+(time_marks_offset(i))-(inter_time_mark_offset*length(g.time_marks_struct)), ...
g.time_marks_struct(tmi).label,'color',g.time_marks_struct(tmi).color,'interpreter','none','tag','text');
end
end
end
colormap(cmap);
......@@ -1279,7 +1282,7 @@ else
for ci=1:length(chan_inds);
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(lowlim:highlim),data(chan_inds(ci),lowlim:highlim) + tmp_offset, ones(1,length(lowlim:highlim))*100, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
% plot channels whose order is > 0.
......@@ -1301,12 +1304,12 @@ else
plot(1+tag_x_int*mark_inds(fi),(g.chans-(chan_inds(ci)-1))*g.spacing,'<', ...
'MarkerEdgeColor', g.chan_marks_struct(mark_inds(fi)).tag_color, ...
'MarkerFaceColor', g.chan_marks_struct(mark_inds(fi)).tag_color, ...
'MarkerSize',8);
'MarkerSize',8,'tag',['marker_' num2str(chan_inds(ci))]);
%plot data
if ~g.chan_marks_struct(manual_mark_ind).flags(chan_inds(ci))
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(lowlim:highlim),data(chan_inds(ci),lowlim:highlim) + tmp_offset, ones(1,length(lowlim:highlim))*1000, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
end
end
......@@ -1361,7 +1364,7 @@ else
else
ve_eegplot('drawb');
end;
case 'drawb' % Draw background ******************************************************
% Redraw EEG and change position
......
......@@ -42,57 +42,59 @@
%Suite 330, Boston, MA 02111-1307 USA
function vised_config=text2struct_ve(fname)
%
% vised_config.pop_gui='';
% vised_config.data_type='';
% vised_config.chans='';
% vised_config.event_type={''};
% vised_config.winrej_marks_labels={''};
% vised_config.quick_evtmk='';
% vised_config.quick_evtrm='';
% vised_config.quick_chanflag='';
% vised_config.chan_marks_struct='';
% vised_config.time_marks_struct='';
% vised_config.marks_y_loc=[];
% vised_config.inter_mark_int=[];
% vised_config.inter_tag_int=[];
% vised_config.marks_col_int=[];
% vised_config.marks_col_alpha=[];
% vised_config.srate=[];
% vised_config.spacing=[];
% vised_config.eloc_file='';
% vised_config.limits=[];
% vised_config.freqlimits=[];
% vised_config.winlength=[];
% vised_config.dispchans=[];
% vised_config.title='';
% vised_config.xgrid='';
% vised_config.ygrid='';
% vised_config.ploteventdur='';
% vised_config.data2='';
% vised_config.command='';
% vised_config.butlabel='';
% %vised_config.winrej='';
% vised_config.color='';
% vised_config.wincolor=[];
% %vised_config.colmodif={};
% %vised_config.tmp_events=[];
% vised_config.submean='';
% vised_config.position=[];
% vised_config.tag='';
% vised_config.children=[];
% vised_config.scale='';
% vised_config.mocap='';
% vised_config.selectcommand={''};
% vised_config.altselectcommand={''};
% vised_config.extselectcommand={''};
% vised_config.keyselectcommand={''};
% vised_config.mouse_data_front='';
% vised_config.trialstag=[];
% vised_config.datastd=[];
% vised_config.normed=[];
% vised_config.envelope=[];
% vised_config.chaninfo=[];
vised_config = init_vised_config;
vised_config.pop_gui='';
vised_config.data_type='';
vised_config.chan_index=[];
vised_config.event_type={''};
vised_config.winrej_marks_labels={''};
vised_config.quick_evtmk='';
vised_config.quick_evtrm='';
vised_config.quick_chanflag='';
vised_config.chan_marks_struct='';
vised_config.time_marks_struct='';
vised_config.marks_y_loc=[];
vised_config.inter_mark_int=[];
vised_config.inter_tag_int=[];
vised_config.marks_col_int=[];
vised_config.marks_col_alpha=[];
vised_config.srate=[];
vised_config.spacing=[];
vised_config.eloc_file='';
vised_config.limits=[];
vised_config.freqlimits=[];
vised_config.winlength=[];
vised_config.dispchans=[];
vised_config.title='';
vised_config.xgrid='';
vised_config.ygrid='';
vised_config.ploteventdur='';
vised_config.data2='';
vised_config.command='';
vised_config.butlabel='';
%vised_config.winrej='';
vised_config.color='';
vised_config.wincolor=[];
%vised_config.colmodif={};
%vised_config.tmp_events=[];
vised_config.submean='';
vised_config.position=[];
vised_config.tag='';
vised_config.children=[];
vised_config.scale='';
vised_config.mocap='';
vised_config.selectcommand={''};
vised_config.altselectcommand={''};
vised_config.extselectcommand={''};
vised_config.keyselectcommand={''};
vised_config.mouse_data_front='';
vised_config.trialstag=[];
vised_config.datastd=[];
vised_config.normed=[];
vised_config.envelope=[];
vised_config.chaninfo=[];
keywords=fieldnames(vised_config);
......
......@@ -184,16 +184,57 @@ if nargin < 5
% g.eloc_file(g.eventedit.ChanIndex).badchan=0;
%end
mark_ind=find(strcmp(g.quick_chanflag,{udf.chan_marks_struct.label}));
%calculate x ifinterval for channel tags...
figdim=axis;
tag_x_int=(figdim(2)-1)*udf.inter_tag_int;
chan_inds = linspace(udf.chans,1,udf.chans);
plot_p1 = 1+tag_x_int*mark_ind;
plot_p2 = (udf.chans-(chan_inds-1))*udf.spacing;
if udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)==0;
udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)=1;
%replot tick...
delete(findobj(gcf,'tag',['marker_' num2str(g.eventedit.ChanIndex)]));
plot(plot_p1, plot_p2(chan_inds(g.eventedit.ChanIndex)),'<', ...
'MarkerEdgeColor', udf.chan_marks_struct(mark_ind).tag_color, ...
'MarkerFaceColor', udf.chan_marks_struct(mark_ind).tag_color, ...
'MarkerSize', 8,'tag',['marker_' num2str(g.eventedit.ChanIndex)]);
%change line color
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',udf.chan_marks_struct(mark_ind).line_color);
else
udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)=0;
non_manual_ind = find(~strcmp(g.quick_chanflag,{udf.chan_marks_struct.label}));
for mi=non_manual_ind(1):non_manual_ind(end);
if ismember(g.eventedit.ChanIndex,find(sum([udf.chan_marks_struct.flags],2)==0));
tmp_color=udf.color{:};
if strcmp(udf.plotdata2, 'on')
if length(udf.color)==2
tmp_color=udf.color{2};
else
tmp_color=[.7 .7 .7];
end
end
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',tmp_color);
continue;
end
if udf.chan_marks_struct(mi).flags(g.eventedit.ChanIndex)==1;
%replot tick...
delete(findobj(gcf,'tag',['marker_' num2str(g.eventedit.ChanIndex)]));
plot(1+tag_x_int*mi,(udf.chans-(g.eventedit.ChanIndex-1))*udf.spacing,'<', ...
'MarkerEdgeColor', udf.chan_marks_struct(mi).tag_color, ...
'MarkerFaceColor', udf.chan_marks_struct(mi).tag_color, ...
'MarkerSize', 8,'tag',['marker_' num2str(g.eventedit.ChanIndex)]);
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',udf.chan_marks_struct(mi).line_color);
end
end
end
end
g = rmfield(g, 'eventedit');
%set(gcbf, 'UserData', g);
set(findobj('tag', udf.tag), 'UserData',udf);
ve_eegplot('drawp',0);
%ve_eegplot('drawp',0);
return
end
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment