data.label wrong after componentanalysis?

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Oct 28 14:11:35 CET 2009


Dear Nathan,

thanks for the notification. It sounds like a potentially nasty bug,
so we'll look into it.

best,
Robert


On 26 Oct 2009, at 21:17, Nathan Weisz wrote:

> hi everyone,
>
> for an analysis of EEG data i'm doing some ICA cleaning. since there
> are many conditions / epochs, i do the ICA on a subset of trials and
> then apply the calculated mixing matrix to the individual conditions.
>
> i noticed (and i'm quite sure it's no user related error) that after
> rejecting components and reconstructing the preprocessing data
> structure, that the sequence in data.label has changed (apparently
> into alphabetical order). however that rows in the 2-D matrices
> making up data.trial(xy) have not changed, accordingly. i noticed
> because the topography of the auditory N1 was a huge mess.
>
> changing the labels solved the problem, i.e.:
> ica_cleaned_data.label = data_before_ica_cleaning.label;
>
> for those interested here the original code:
>
> load([outdir '/dataB1F1.mat'], 'dataB1F1') %load data for one
> condition
>
> cfg=[];
> cfg.topo=comp.topo;
> cfg.topolabel=comp.topolabel;
>
> tmpcomp=componentanalysis(cfg,dataB1F1); %apply precomputed ICA to
> condition
>
> cfg=[];
> cfg.component=ncmp;
>
> dataB1F1=rejectcomponent(cfg, tmpcomp); %reject components obviously
> representing artefacts
>
> >> [comp.cfg.channel(1:5) tmpcomp.cfg.channel(1:5)] %demonstrate
> channel label mismatch
>
> ans =
>
>    'Lm'     'L1'
>    'LE1'    'L10'
>    'LE2'    'L11'
>    'LE3'    'L12'
>    'LD2'    'L13'
>
> the crucial line appears to be in componentanalysis line 220:
> cfg.channel = intersect(cfg.channel, cfg.topolabel);
>
> intersect sorts the outcome:
> >> a=randperm(10)
>
> a =
>
>     7     1     9     3     6     2     5     4    10     8
>
> >> b=randperm(10)
>
> b =
>
>     6     3     5     1     8     2    10     4     9     7
>
> >> intersect(a,b)
>
> ans =
>
>     1     2     3     4     5     6     7     8     9    10
>
> since i use all channels, simply replacing the label-field with the
> original label-field works for me.
>
> best,
> nathan
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip  toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html
>  and http://www.ru.nl/neuroimaging/fieldtrip.
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.



More information about the fieldtrip mailing list