Back to the main page.

Bug 3219 - ft_rejectartifact with reject='nan' ignores trials that are entirely marked as artifact

Reported 2016-12-14 12:26:00 +0100
Modified 2017-01-17 11:30:37 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 major
Assigned to: Jan-Mathijs Schoffelen
Depends on: 3218
Blocks: 3220
See also:

Pim Mostert - 2016-12-14 12:26:56 +0100

I marked artifacts in my data set using cfgart = ft_databrowser( ... ). When I subsequently want to fill these artifacts with NaNs using ft_rejectartifact and cfg.artfctdef.reject = 'nan', then trials that are completely marked as artifact are ignored; they are neither removed, nor filled with NaNs. I uploaded a small data set and example script to the FTP dropbox: - tmp_data_small.mat (1.8 MB) - tmp_script_3.m The example script illustrates the problem, comments are added for each specific step. In fact, the function actually reports that the trial is rejected completely, but this is not actually the case. Please let me know if anything is unclear. Thanks.

Jan-Mathijs Schoffelen - 2016-12-14 13:29:08 +0100

OK, I have linked the bugs 3218 and 3219, because they seem to be somewhat related, and use the same testdata to demonstrate it. I created a branch in my fieldtrip fork which I will use to look into it. If you have suggestions for fixes, feel free to do so.

Jan-Mathijs Schoffelen - 2016-12-16 12:52:39 +0100

the nans were only added when any(rejecttrial), nothing was done if all(rejecttrial), which is the case if all samples are marked as 'bad'. Fixed with PR 278

Jan-Mathijs Schoffelen - 2017-01-17 11:30:37 +0100

closed multiple bugs at once