Skip to content

Commit

Permalink
allowing to detect new datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodelorme committed Mar 24, 2023
1 parent 4aa69eb commit f56a09c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions eeglab.m
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
else
eegh('eeglab(''redraw'');');
end
elseif strcmp(onearg, 'continuous')
elseif strcmpi(onearg, 'continuous') || strcmpi(onearg, 'cont')
ALLEEG = []; CURRENTSET = 0; CURRENTSTUDY = 0; STUDY = [];
disp('Clearing all data and loading tutorial continuous data')
EEG = pop_loadset(fullfile(eeglabpath, 'sample_data', 'eeglab_data.set'));
Expand Down Expand Up @@ -1174,7 +1174,7 @@
end
if ~exist('pop_dipfit_settings', 'file')
neuro_m = findobj(W_MAIN, 'tag', 'tools');
cb_dipfit = [ 'if ~plugin_askinstall(''dipfit'', ''pop_dipfit_settings''), return; end;' ];
cb_dipfit = 'if ~plugin_askinstall(''dipfit'', ''pop_dipfit_settings''), return; end;' ;
eegmenu( false, neuro_m, 'Label', 'Locate dipoles using DIPFIT 2.x', 'CallBack', cb_dipfit, 'separator', 'on');
end
if ~exist('pop_loadbva', 'file')
Expand Down Expand Up @@ -1438,8 +1438,20 @@ function updatemenu()
else
% check dataset
if ~isempty(EEG) && ~isempty(ALLEEG) && ~isequaln(EEG, ALLEEG(CURRENTSET))
EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, CURRENTSET, 'study', ~isempty(STUDY)+0, 'guistring', 'The EEG structure has changed, what do you want to do?');
if length(EEG) > 1
options = { 'EEG overwrites ALLEEG', 'ALLEEG overwrites EEG', 'Do nothing' };
res = questdlg2('In a STUDY, ALLEEG and EEG should be equal and they are not. How do you want EEGLAB to resolve this?', 'ALLEEG and EEG structure do not match', options{:}, options{1});
if isequal(res, options{1})
disp('Overwriting ALLEEG with EEG')
ALLEEG = EEG;
elseif isequal(res, options{2})
disp('Overwriting EEG with ALLEEG')
EEG = ALLEEG;
end
else
EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, CURRENTSET, 'study', ~isempty(STUDY)+0, 'guistring', 'The EEG structure has changed, what do you want to do?');
end
end
end

Expand Down

0 comments on commit f56a09c

Please sign in to comment.