[FieldTrip] Fwd: How to adapt a layout file

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed Jul 5 08:51:13 CEST 2017


Hi Simone,

What is the question behind the question?

The reason I ask this is because overcomplete layout files (i.e. files containing more channels than you need) don’t prevent you from visualizing your own data.

If you anyhow want to manually remove channels (and the corresponding information in pos/height etc) your code is not foolproof, most likely because setdiff may inadvertently alphabetize the labels, causing the mismatch you report.

you could do:

remove = {…};
sel = ismember(lay.label, remove);

lay.pos = lay.pos(~sel,:);
lay.height = lay.height(~sel);

etc.

Best,
Jan-Mathijs



On 04 Jul 2017, at 16:56, Sprenger, S.A. <s.a.sprenger at rug.nl<mailto:s.a.sprenger at rug.nl>> wrote:

Dear colleagues,

I was wondering whether someone could give us some advice on how to adapt an existing layout file.

We would like to adapt easycapM1.mat, as our own layout is highly similar. Specifically, we would like to remove F1, F2, FT7, FT8, TP7, TP8, CP1 and CP2. In addition, we would like to add the mastoids (for ICA plotting purposes).

We tried the following:

% removing F1, F2, FT7, FT8, TP7, TP8, CP1, CP2:
load('/Volumes/DATA/Applications/fieldtrip-20170425/template/layout/easycapM1.mat');

% this plots the layout with electrodes on the correct positions:
cfg = [];
cfg.layout = lay;
ft_layoutplot(cfg);

for i = {'F1', 'F2', 'FT7', 'FT8', 'TP7', 'TP8', 'CP1', 'CP2'}
    [truefalse, index] = ismember(i, lay.label);
    if truefalse == 1
        lay.label = setdiff(lay.label, lay.label{index});
        lay.width = lay.width([1:(index-1), (index+1):end]);
        lay.height = lay.height([1:(index-1), (index+1):end]);
        lay.pos = lay.pos([1:(index-1), (index+1):end],:);
    end
end

% now suddenly many electrodes are plotted on wrong locations,
% but we just wanted to remove some electrodes:
cfg = [];
cfg.layout = lay;
ft_layoutplot(cfg);

Comments and suggestions will be much appreciated.

Kind regards,
  Simone

_____________________________________________
Dr. S.A. Sprenger
University of Groningen
Faculty of Arts
Center for Language and Cognition

Visiting address:
Oude Kijk in 't Jatstraat 26
Room 1315.420
9712 EK Groningen

Working hours: mo-thur
 050 363 9619
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170705/036dc460/attachment-0001.html>


More information about the fieldtrip mailing list