[FieldTrip] ft_selectdata - automatic channels sorting

Martina Postorino martina.postorino at gmail.com
Mon Jun 23 16:14:41 CEST 2014


Dear all,

I recently encountered a problem using the function ft_selectdata to select
a subset of channels from my EEG dataset.

I found out that in the output of the function ft_selectdata, channels are
sorted alphabetically. For me, that represents a problem since I would like
to plot the results from a cluster based permutation test using the
information stored in stat.mask (in which the order of channels is in line
with the original order of channels, i.e. not alphabetically) on the ERP
grandaverage of specific electrodes selected with ft_selectdata, to see
which time points are significantly different between my experimental
conditions. Due to the different orders of the channels, the mask is
plotted over the wrong channels.

Is there a way to avoid that the function automatically sorts the labels of
the channels alphabetically?

I have already tried the different versions of ft_selectdata
(ft_selectdata, ft_selectdata_old, ft_selectdata_new) and updated my
Fieldtrip version to the last one available. Nothing changed.

This is the code I use:

[stat] = ft_timelockstatistics(cfg, ERP_pain_bp_GA, ERP_buttonpress_GA);

 %plotting

cfgp = [];
cfgp.channel = {'Cz'; 'CPz', 'Pz', 'CP1'. 'CP3', 'CP2', 'CP4'};
cfgp.avgoverchan = 'no';
cfgp.latency = [-1 1];
ERP_pain_bp_GA_red = ft_selectdata_new(cfgp, ERP_pain_bp_GA);
ERP_buttonpress_GA_red = ft_selectdata_new(cfgp, ERP_buttonpress_GA);

% average data across subjects

cfgp = [];
cfgp.keepindividual = 'no';
ERP_pain_bp_GA_avg = ft_timelockanalysis (cfgp, ERP_pain_bp_GA_red);
ERP_buttonpress_GA_avg = ft_timelockanalysis (cfgp, ERP_buttonpress_GA_red);
% ERP_pain_GA_avg = ft_timelockanalysis (cfg, ERP_pain_GA_red);

ERP_pain_bp_GA_avg.mask = stat.mask;
ERP_buttonpress_GA_avg.mask = stat.mask;
% ERP_pain_GA_avg.mask = stat.mask;

% do the plotting

cfgp = [];
cfgp.maskparameter = 'mask';
cfgp.maskstyle = 'box';
cfgp.layout = layout_easycap_painlabmunich;

ft_multiplotER(cfgp,ERP_pain_bp_GA_avg, ERP_buttonpress_GA_avg);

Thanks in advance!

___________________________________________

Martina Postorino, M.Sc
Phd program in Medical Life Science and Technology

Neuroimaging Center (TUM-NIC)
Technische Universit√§t M√ľnchen, Klinikum Rechts der Isar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140623/d571cc27/attachment-0001.html>


More information about the fieldtrip mailing list