forked from sccn/EEG-BIDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpop_checkdatasetinfo.m
30 lines (28 loc) · 1.75 KB
/
pop_checkdatasetinfo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [STUDY, ALLEEG] = pop_checkdatasetinfo(STUDY, ALLEEG)
datasetinfo = STUDY.datasetinfo;
different = 0;
for k = 1:length(ALLEEG)
if ~strcmpi(datasetinfo(k).filename, ALLEEG(k).filename), different = 1; break; end
if ~strcmpi(datasetinfo(k).subject, ALLEEG(k).subject), different = 1; break; end
if ~strcmpi(datasetinfo(k).condition, ALLEEG(k).condition), different = 1; break; end
if ~strcmpi(char(datasetinfo(k).group), char(ALLEEG(k).group)), different = 1; break; end
if ~isequal(datasetinfo(k).session, ALLEEG(k).session), different = 1; break; end
if ~isequal(datasetinfo(k).run, ALLEEG(k).run), different = 1; break; end
end
if different
supergui( 'geomhoriz', { 1 1 1 [1 1] }, 'uilist', { ...
{ 'style', 'text', 'string', 'Information between STUDY and single datasets is inconsistent.', 'HorizontalAlignment','center'},...
{ 'style', 'text', 'string', 'Would you like to overwrite dataset information with STUDY information and use that for BIDS?','HorizontalAlignment', 'center'}, { }, ...
{ 'style', 'pushbutton' , 'string', 'Yes', 'callback', @yesCB}, { 'style', 'pushbutton' , 'string', 'No', 'callback', @noCB } } );
end
function yesCB(src, event)
[STUDY, ALLEEG] = std_editset(STUDY, ALLEEG, 'updatedat', 'on');
supergui( 'geomhoriz', { 1 1 1 }, 'uilist', { ...
{ 'style', 'text', 'string', 'Information updated. Resave dataset(s) if you want to save the information on disk', 'HorizontalAlignment', 'center'}, { }, ...
{ 'style', 'pushbutton', 'string', 'Ok', 'callback', 'close(gcf);'}});
close(gcf);
end
function noCB(src,event)
close(gcf);
end
end