[FieldTrip] Question about MVPA topographic map

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue Sep 19 07:47:49 CEST 2017

Hi Diane,

First of all, I would recommend to share figures not as a matlab-figure, but as a screenshot bitmap or so. This saves people who are reading your mail a lot of overhead if they want to look at it, because they don’t need to start a matlab session etc.

Your topographical image looks ‘different’ from the one on the wiki because the distribution of your electrodes is more around the whole ‘rim’ of the head. The colored plane that shows up within the circle is the consequence of a spatial interpolation (in 2D) of the data points represented at the locations of the electrodes. For this reason also, there’s no need to be very explicit about the meaning of the x and y axes: they represent space.

Best wishes and good luck,


On 19 Sep 2017, at 06:25, D.Abdallah <da401 at kent.ac.uk<mailto:da401 at kent.ac.uk>> wrote:

Dear all,

I've had a bit of trouble understanding the results that I get when using the ft_topoplotER.
I have run on matlab R2014a the MVPA tutorial on fieldtrip: http://www.fieldtriptoolbox.org/tutorial/multivariateanalysis and tried to understand the resulting topographic map but wasn't able to because there is no proper legend that explains where the x and y axes are and they represent.

The experiment that my supervisor and I conducted is meant to look at the pattern of activity in the brain (using EEG) in a switch vs. non-switch task of Rubin's Face-Vase ambiguous stimulus. In order to study that we are using MVPA.

This is the code we are running on one of the subjects that we collected:
%Reading the data
cfg = [];
cfg.dataset = filename1;
cfg.reref ='yes';
cfg.channel = {'Cz','PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};
cfg.refchannel ='Cz';
cfg.demean ='yes';
data_eeg1 = ft_preprocessing(cfg);

%Segmenting data
cfg.trialdef.eventtype ='?';
Dummy = ft_definetrial(cfg);

cfg.trialdef.prestim = 0.1;
cfg.trialdef.poststim = 0.6;
cfg.baselinewindow = [-0.1 0];

cfg.trialdef.eventtype ='STATUS';
cfg.trialdef.eventvalue = [100];
stimulusTrigger = ft_definetrial(cfg);

cfg.trialdef.eventvalue = [1];
FaceTrials = ft_definetrial(cfg);

cfg.trialdef.eventvalue = [2];
VaseTrials = ft_definetrial(cfg);

%Definitions of Triggers
stimulusTrigger = 100;
faceResponseTrigger = 1;
vaseResponseTrigger = 2;

%Define Face Trials and Conduct Preprocessing
[trlFaces, eventFaces] = ft_trialfun_BasedOnResp(FaceTrials,stimulusTrigger,faceResponseTrigger);
hdr = ft_read_header(cfg.dataset);
event = ft_read_event(cfg.dataset);
FaceData = ft_preprocessing(FaceTrials);

FaceTrigger = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).value]';
FaceSample = [eventFaces(strcmp(cfg.trialdef.eventtype, {eventFaces.type})).sample]';

Facepretrig = -round(cfg.trialdef.prestim * hdr.Fs);
Faceposttrig = round(cfg.trialdef.poststim * hdr.Fs);

%Define Vase Trials and Conduct Preprocessing
[trlVase, eventVase] = ft_trialfun_BasedOnResp(VaseTrials,stimulusTrigger,vaseResponseTrigger);
hdr = ft_read_header(cfg.dataset);
event = ft_read_event(cfg.dataset);
VaseData = ft_preprocessing(VaseTrials);

VaseTrigger = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).value]';
Vasesample = [eventVase(strcmp(cfg.trialdef.eventtype, {eventVase.type})).sample]';

Vasepretrig = -round(cfg.trialdef.prestim * hdr.Fs);
Vaseposttrig = round(cfg.trialdef.poststim * hdr.Fs);

%Calculate Face ERP
FaceTrials.reref ='no';
FaceTrials.keeptrials ='yes';% classifiers operate on individual trials
FaceTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only
FaceERP = ft_timelockanalysis(FaceTrials,FaceData);

%Calculate Vase ERP
VaseTrials.reref ='no';
VaseTrials.keeptrials ='yes';% classifiers operate on individual trials
VaseTrials.channel = {'PO9','PO7','PO3','PO','PO4','PO8''PO10','O1','Oz','O2','O9','O10'};% occipital channels only
VaseERP = ft_timelockanalysis(VaseTrials,VaseData);

cfg.layout ='biosemi64.lay';
cfg.method ='crossvalidate';
cfg.design = [ones(size(FaceERP.trial,1),1); 2*ones(size(VaseERP.trial,1),1)];
cfg.nfolds = 4;
cfg.latency = [-0.1 0.6];

cfg.statistic = {'accuracy''binomial''contingency'};
stat = ft_timelockstatistics (cfg, FaceERP,VaseERP);

%Plot MVPA Results
stat.mymodel = stat.model{2}.primal;
cfg.parameter ='mymodel';
cfg.xlim = [-0.1 0.6];
cfg.comments ='';
cfg.colorbar ='yes';

Attached is the resulting topographic map. We found a very weird pattern that doesn't seem to show what we are expecting. It seems as though there might be a glitch or a step we missed.
We came to the conclusion after running figure(imagesc(stat.mymodel)) in order to understand the topographical map and found a completely different pattern (see second attached Imagesc subject 8 file).
Why are the patterns very different?

Moreover, when we ran the MVPA fieldtrip tutorial, the topographical map showed a proper pattern of activity (see tutorial topographic map).

All the best,
Diane Abdallah

<Imagesc Subject 8.fig><Subject 8 Topographical map.fig><tutorial topographic map.png>_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170919/336f9778/attachment-0002.html>

More information about the fieldtrip mailing list