Commit 84448016 authored by Mike Cichonski's avatar Mike Cichonski
Browse files

* VERSION: 1.0.4

* vised/pop_func/pop_vised.m: Removed event_type and chans from
  vised_config file and fixed changing of chans between data files

* vised/config_func/init_vised_config.m: more robust initialization
parent b8181c6f
......@@ -3,8 +3,8 @@ function vised_config=init_vised_config
%vised options
vised_config.pop_gui='on';
vised_config.data_type='';%currently EEG or ICA
vised_config.chans='';%this should allow chan/component labels or marks labels.. now accespts stings at least...
vised_config.event_type={};%event types (labels)
%vised_config.chans='';%this should allow chan/component labels or marks labels.. now accespts stings at least...
%vised_config.event_type={};%event types (labels)
vised_config.winrej_marks_labels={};
vised_config.quick_evtmk='';
......
......@@ -39,7 +39,7 @@
function [EEG,com]=pop_vised(EEG, varargin)%data_type, chan_index, event_type, varargin)
%% INITIATE VISED_CONFIG OBJECT
dbstop in pop_vised.m at 482
try parameters = evalin('base', 'vised_config');
vised_config=parameters;
catch %if nonexistent in workspace
......@@ -80,14 +80,15 @@ try vised_config.data_type=g.data_type;
catch, if isempty(vised_config.data_type);vised_config.data_type='EEG';end
end
try vised_config.chans=g.chans;
chans = '';
try chans=g.chans;
catch,
if isempty(vised_config.chans);
if isempty(chans);
switch vised_config.data_type;
case 'EEG'
vised_config.chans=vararg2str(1:EEG.nbchan);
chans=vararg2str(1:EEG.nbchan);
case 'ICA'
vised_config.chans=vararg2str(1:min(size(EEG.icaweights)));
chans=vararg2str(1:min(size(EEG.icaweights)));
end
end
end
......@@ -100,12 +101,14 @@ for i=1:length(EEG.event)
EEG.event(i).type=num2str(EEG.event(i).type);
end
end
try vised_config.event_type=g.event_type;
catch, if isempty(vised_config.event_type);
event_type = {};
try event_type=g.event_type;
catch, if isempty(event_type);
if isempty(EEG.event);
vised_config.event_type={};
event_type={};
else
vised_config.event_type=unique({EEG.event.type});
event_type=unique({EEG.event.type});
end
end
end
......@@ -240,7 +243,7 @@ if ~isempty(g);
'srate' 'spacing' 'eloc_file' 'winlength' 'position' 'title' ...
'trialstag' 'winrej' 'command' 'tag' 'xgrid' 'ygrid' 'color' ...
'submean' 'children' 'limits' 'freqlimits' 'dispchans' 'wincolor' ...
'butlabel' 'colmodif' 'scale' 'events' 'ploteventdur' 'data2' 'plotdata2' 'mocap' ...
'butlabel' 'colmodif' 'scale' 'event_type' 'ploteventdur' 'data2' 'plotdata2' 'mocap' ...
'selectcommand' 'openselectcommand' 'altselectcommand' ...
'extselectcommand' 'keyselectcommand' 'datastd' 'normed' 'envelope' 'chaninfo' ...
'chan_marks_struct' 'time_marks_struct' ...
......@@ -352,7 +355,7 @@ if strcmp(vised_config.pop_gui,'on');
...
{'Style', 'text', 'string', 'Channels to display in eegplot figure window:'}, ...
... %5
{'Style', 'edit', 'string', vised_config.chans,'tag', 'ChanIndexEdit'}, ...
{'Style', 'edit', 'string', chans,'tag', 'ChanIndexEdit'}, ...
... %6
{'Style', 'pushbutton', 'string', '...', 'tag', 'ChanLabelButton',...
'callback', chanlabel_callback}, ...
......@@ -388,8 +391,8 @@ if strcmp(vised_config.pop_gui,'on');
if isempty(results);com='';return;end
vised_config.data_type=data_typeCell{results{1}};
vised_config.chans=results{2};
vised_config.event_type=results{3};
chans=results{2};
event_type=results{3};
vised_config.winrej_marks_labels=eval(['{',results{4},'}']);
update_global=results{5};
......@@ -404,10 +407,10 @@ end
%% ONCE ALL INPUTS ARE ESTABLISHED ...
% HANDLE chans
chans=[];
%chans=[];
if ~isempty(str2num(vised_config.chans));
chans=str2num(vised_config.chans);
if ~isempty(str2num(chans));
chans=str2num(chans);
end
%if ischar(vised_config.chans);
......@@ -458,16 +461,16 @@ end
% HANDLE event_type...
if ischar(vised_config.event_type);
vised_config.event_type=eval(['{',vised_config.event_type,'}']);
if ischar(event_type);
event_type=eval(['{',event_type,'}']);
end
j=0;
if isempty(vised_config.event_type);
if isempty(event_type);
VisEd.event = [];
else
for i=1:length(EEG.event);
if ~isempty(find(strcmp(EEG.event(i).type,vised_config.event_type)));
if ~isempty(find(strcmp(EEG.event(i).type,event_type)));
event=EEG.event(i);
event.index=i;
event.proc='none';
......@@ -581,4 +584,4 @@ end
ve_eegplot(data, vararg_cell{:});
%% RETURN COMMAND AND EVALUATE CALL TO VISED
com=sprintf('EEG = pop_vised( %s, {%s});', inputname(1), vararg2str(vised_config.event_type));
com=sprintf('EEG = pop_vised( %s, {%s});', inputname(1), vararg2str(event_type));
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