Skip to content

Commit

Permalink
Accept trial: Remove all bad events
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed Mar 30, 2021
1 parent cc3aed3 commit 4756493
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -5,7 +5,7 @@
<body alink="#fff000" link="#fff000" vlink="#fff000">
<h4><span style="font-family: Arial Black; color: #ffffff;"><strong>THERE IS NO UNDO BUTTON - SET UP A BACKUP OF YOUR DATABASE</strong></span></h4>
<HR>
<!-- LICENCE_START -->Version: 3.210329 (29-Mar-2021)<br>
<!-- LICENCE_START -->Version: 3.210330 (30-Mar-2021)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2020
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.210329 (29-Mar-2021)
% v. 3.210330 (30-Mar-2021)
19 changes: 17 additions & 2 deletions toolbox/process/functions/process_detectbad.m
Expand Up @@ -19,7 +19,7 @@
% For more information type "brainstorm license" at command prompt.
% =============================================================================@
%
% Authors: Francois Tadel, 2010-2019
% Authors: Francois Tadel, 2010-2021

eval(macro_method);
end
Expand Down Expand Up @@ -303,8 +303,23 @@ function SetTrialStatus(FileNames, isBad)
ProtocolInfo = bst_get('ProtocolInfo');
% Get unique list of studies
uniqueStudies = unique(iStudies);
% Remove path from all files
% Remove path from all files + Remove all BAD events
for i = 1:length(FileNames)
% Remove bad events
if ~isBad
DataMat = in_bst_data(FileNames{i}, 'Events');
iDel = [];
for iEvt = 1:length(DataMat.Events)
if panel_record('IsEventBad', DataMat.Events(iEvt).label)
iDel(end+1) = iEvt;
end
end
if ~isempty(iDel)
DataMat.Events(iDel) = [];
bst_save(file_fullpath(FileNames{i}), DataMat, 'v6', 1);
end
end
% Remove path
[fPath, fBase, fExt] = bst_fileparts(FileNames{i});
FileNames{i} = [fBase, fExt];
end
Expand Down

0 comments on commit 4756493

Please sign in to comment.