<div dir="ltr">Dear <span style="font-size:12.8px">Jan-Mathijs,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thank you very much for your response with respect to the adaption of layout files. The solution that you suggested works fine and our issue has been solved. In case someone would like to review the question and response, please see below.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Kind regards,</span></div><div><span style="font-size:12.8px">  Simone</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">____________</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span><div><br></div><div><span style="font-size:12.8px">Message: 9</span><br style="font-size:12.8px"><span style="font-size:12.8px">Date: Wed, 5 Jul 2017 06:51:13 +0000</span><br style="font-size:12.8px"><span style="font-size:12.8px">From: "Schoffelen, J.M. (Jan Mathijs)" <</span><a href="mailto:jan.schoffelen@donders.ru.nl" style="font-size:12.8px">jan.schoffelen@donders.ru.nl</a><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">To: FieldTrip discussion list <</span><a href="mailto:fieldtrip@science.ru.nl" style="font-size:12.8px">fieldtrip@science.ru.nl</a><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">Subject: [FieldTrip] Fwd:  How to adapt a layout file</span><br style="font-size:12.8px"><span style="font-size:12.8px">Message-ID: <</span><a href="mailto:2D579D2D-F542-4FC2-A1A8-C0FCED73CC51@donders.ru.nl" style="font-size:12.8px">2D579D2D-F542-4FC2-A1A8-<wbr>C0FCED73CC51@donders.ru.nl</a><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">Content-Type: text/plain; charset="utf-8"</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Hi Simone,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">What is the question behind the question?</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">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.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">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.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">you could do:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">remove = {?};</span><br style="font-size:12.8px"><span style="font-size:12.8px">sel = ismember(lay.label, remove);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">lay.pos = lay.pos(~sel,:);</span><br style="font-size:12.8px"><span style="font-size:12.8px">lay.height = lay.height(~sel);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">etc.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Best,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Jan-Mathijs</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">On 04 Jul 2017, at 16:56, Sprenger, S.A. <</span><a href="mailto:s.a.sprenger@rug.nl" style="font-size:12.8px">s.a.sprenger@rug.nl</a><span style="font-size:12.8px"><mailto:</span><a href="mailto:s.a.sprenger@rug.nl" style="font-size:12.8px">s.<wbr>a.sprenger@rug.nl</a><span style="font-size:12.8px">>> wrote:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Dear colleagues,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">I was wondering whether someone could give us some advice on how to adapt an existing layout file.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">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).</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">We tried the following:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">% removing F1, F2, FT7, FT8, TP7, TP8, CP1, CP2:</span><br style="font-size:12.8px"><span style="font-size:12.8px">load('/Volumes/DATA/</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">Applications/fieldtrip-</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">20170425/template/layout/</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">easycapM1.mat');</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">% this plots the layout with electrodes on the correct positions:</span><br style="font-size:12.8px"><span style="font-size:12.8px">cfg = [];</span><br style="font-size:12.8px"><span style="font-size:12.8px">cfg.layout = lay;</span><br style="font-size:12.8px"><span style="font-size:12.8px">ft_layoutplot(cfg);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">for i = {'F1', 'F2', 'FT7', 'FT8', 'TP7', 'TP8', 'CP1', 'CP2'}</span><br style="font-size:12.8px"><span style="font-size:12.8px">    [truefalse, index] = ismember(i, lay.label);</span><br style="font-size:12.8px"><span style="font-size:12.8px">    if truefalse == 1</span><br style="font-size:12.8px"><span style="font-size:12.8px">        lay.label = setdiff(lay.label, lay.label{index});</span><br style="font-size:12.8px"><span style="font-size:12.8px">        lay.width = lay.width([1:(index-1), (index+1):end]);</span><br style="font-size:12.8px"><span style="font-size:12.8px">        lay.height = lay.height([1:(index-1), (index+1):end]);</span><br style="font-size:12.8px"><span style="font-size:12.8px">        lay.pos = lay.pos([1:(index-1), (index+1):end],:);</span><br style="font-size:12.8px"><span style="font-size:12.8px">    end</span><br style="font-size:12.8px"><span style="font-size:12.8px">end</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">% now suddenly many electrodes are plotted on wrong locations,</span><br style="font-size:12.8px"><span style="font-size:12.8px">% but we just wanted to remove some electrodes:</span><br style="font-size:12.8px"><span style="font-size:12.8px">cfg = [];</span><br style="font-size:12.8px"><span style="font-size:12.8px">cfg.layout = lay;</span><br style="font-size:12.8px"><span style="font-size:12.8px">ft_layoutplot(cfg);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Comments and suggestions will be much appreciated.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Kind regards,</span><br style="font-size:12.8px"><span style="font-size:12.8px">  Simone</span><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><font face="verdana, sans-serif"><br></font></div><font face="verdana, sans-serif"><div><font face="verdana, sans-serif">_____________________________________________</font></div>Dr. S.A. Sprenger<br></font><div><span style="font-family:verdana,sans-serif">University of Groningen</span></div><div><span style="font-family:verdana,sans-serif">Faculty of Arts</span></div><div><font face="verdana, sans-serif">Center for Language and Cognition</font></div><div><br></div><div><font face="verdana, sans-serif">Visiting address:</font></div><div><span style="color:rgb(51,51,51);font-size:11px"><font face="verdana, sans-serif">Oude Kijk in 't Jatstraat 26</font></span></div><div><span style="color:rgb(51,51,51);font-size:11px"><font face="verdana, sans-serif">Room 1315.420<br></font></span></div><font face="verdana, sans-serif"><span style="color:rgb(51,51,51);font-size:11px">9712 EK Groningen</span><span style="color:rgb(51,51,51);font-size:11px;background-color:rgb(238,238,238)"> </span><br></font><div><div style="color:rgb(51,51,51);font-size:11px"><font face="verdana, sans-serif"><br></font></div><div style="color:rgb(51,51,51);font-size:11px"><font face="verdana, sans-serif">Working hours: mo-thur</font></div><div style="color:rgb(51,51,51);font-size:11px"><div style="margin-top:5px"><div><font face="verdana, sans-serif"><div style="width:12px;height:12px;margin-bottom:1px;display:inline-block;vertical-align:middle;background-image:url("http://www.rug.nl/_definition/shared/images/sprite-mepa.png");background-position:-101px -4px"></div> <span style="vertical-align:middle">050 363 9619</span> </font></div></div></div></div></div></div></div>
</div></div></div>