Back to the main page.

Bug 1304 - revamp the handling of artifacts

Status ASSIGNED
Reported 2012-02-01 13:57:00 +0100
Modified 2016-03-03 14:44:08 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Eelke Spaak
URL:
Tags:
Depends on:
Blocks: 21
See also:

Eelke Spaak - 2012-02-01 13:57:49 +0100

First, some statements. Functions that take a cfg structure as an argument, modify it, and return the cfg again, are evil, since they obfuscate the structure of the analysis pipeline. A cfg should only be the input to a function, specifying what the function should do. The output of the function in a syntax-sense should reflect the output of the function in a semantic sense. Taking this into account, I propose the following. (1) Create a new data type for handling artifacts. This would be a structure like this: art = type: 'visual' badsamples: [20x2 double] badtrials: [4 8 24 6] badchannels: {'CH01' 'CH45'} with 'type' a required indicator for the type of artifacts contained (e.g. visual/eog/blink/whatever). Any combination of the other three fields would be possible, with badsamples corresponding to how artifacts are now maintained (beginsample and endsample of artifacts). (2) Make a clear conceptual split between artifact detection functions and functions that modify data. All detection functions should return an artifact structure like the one defined above. Functions that modify the data should handle those structures: (3) E.g.: cfg = []; cfg.artifacts = {artVisual, artEog}; % each one of those is an art structure data = ft_rejectartifact(cfg, data); % modify the data (4) Databrowser should also understand and return an artifact structure.


Roemer van der Meij - 2012-02-01 14:03:16 +0100

Love it. Also, I agree we should remove output that is a cfg, evil indeed! Are there other functions that use the cfg to give 'data-type-structures'? I know of the layouts, but not of others. Should this thus be multiple data inputs instead of cfgs? Like: data = ft_rejectartifact(cfg, data, artVisual, artEog);


Eelke Spaak - 2012-02-01 14:42:56 +0100

art.badtrials is ill-specified and possibly redundant, so just stick to badsamples/badchannels. Other than that, Robert issued executive 'GO' command :)


Roemer van der Meij - 2016-03-03 14:44:08 +0100

I just came across on a climbing wander through the bug tree. Still love this idea. Was any progress made?