How can I consistently represent artifacts in my data?

FieldTrip includes functions for automatic artifact detection. These detect time segments in the data in which an artifact is present by the begin and end sample of that artifact. If there are N artifacts, that results in a Nx2 matrix.

If you manually identify time segments with an artifact, you can represent them like

eog.artifact    = N x 2
muscle.artifact = M x 2
jump.artifact   = K x 2

and pass them onto the ft_rejectartifact function in the cfg.artfctdef field like

cfg.artfctdef.eog.artifact    = N x 2
cfg.artfctdef.muscle.artifact = M x 2
cfg.artfctdef.jump.artifact   = K x 2

followed by

cfg = ft_rejectartifact(cfg);

Bad channels

To specify lists of bad channels, you can use a consistent representation, e.g.

linenoise.badchannel = {'C3', 'Fp1'};
emg.badchannel       = {'T3', 'T4'};

and use the following code to merge the bad channels into a single list

hdr = ft_read_header(filename);
sel = false(size(hdr.label));

for i=1:length(linenoise.badchannel)
  sel(strmatch(hdr.label, linenoise.badchannel{i}) = true;

for i=1:length(emg.badchannel)
  sel(strmatch(hdr.label, emg.badchannel{i}) = true;

% combine them into one list
badchannel  = hdr.label(sel);
goodchannel = setdiff(hdr.label, badchannel);

This list with good channels can be passed to ft_preprocessing in the option.

faq/how_can_i_consistently_represent_artifacts_in_my_data.txt · Last modified: 2011/04/19 10:15 by

You are here: startfaqhow_can_i_consistently_represent_artifacts_in_my_data
CC Attribution-Share Alike 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
Mobile Analytics Website Security Test