<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Marta,<div class=""><br class=""></div><div class="">In your cfg.elec, a 3D description of electrodes positions is expected. Yet you have a 2D layout structure. I assume that your neighbours are also defined in this 2D plane. </div><div class="">Can you comment out the cfg.elec line and try again? Ft_read_sens is not supposed to work on 2D layout file, hence the error. </div><div class=""><br class=""></div><div class="">Good luck,</div><div class="">tzvetan</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 27 May 2021, at 22:24, Marta Topor <<a href="mailto:m.topor@surrey.ac.uk" class="">m.topor@surrey.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Dear colleagues, </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I came across a surprising error and I am struggling to figure it out. </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class="">I wrote a few scripts last year in version</span><span style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class=""> </span><span style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class="">fieldtrip-20200409. They all worked fine, last time I worked with those scripts in that version was January 2021. I had to take care of a few other tasks since then, so the project was on pause. I had my work laptop upgraded in the meantime which meant I had to upgrade to the newest Fieldtrip version.</span><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class="">I started working on that same project again, in version fieldtrip-20210525, and noticed layout file issues when interpolating channels. </span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class="">For a bit of background,  I am using the Mobita water-based 32 EEG electrode system. I created my own layout file in the previous Fieldtrip version which worked without any issues in all scripts.</span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class="">I now have an error using the ft_channelrepair() funtion and I think it relates to the ft_read_sens() funtion. </span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><b class="">The cfg I used: </b></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg = [];</span><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.method          = 'spline';</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.neighbours      = neighbours_EEG;</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.badchannel      = badchannels_train;</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.senstype        = 'EEG';</span></div></span><span style="font-family: "Courier New", monospace; font-size: 12pt; display: inline !important;" class="">cfg.elec            = layout_file;</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: "Courier New", monospace; font-size: 12pt; display: inline !important;" class="">mydata_interpolated_train = ft_channelrepair(cfg, mydata_artrm_train);</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; display: inline !important;" class=""><div class=""><br class=""></div><div class=""><b class="">The layout file fields are:</b></div><div class=""><span style="font-family: "Courier New", monospace;" class="">pos: [34×2 double]</span><div class=""><span style="font-family: "Courier New", monospace;" class="">label: {34×1 cell}</span></div><div class=""><span style="font-family: "Courier New", monospace;" class="">width: [34×1 double]</span></div><div class=""><span style="font-family: "Courier New", monospace;" class="">height: [34×1 double]</span></div><div class=""><span style="font-family: "Courier New", monospace;" class="">outline: {1×4 cell}</span></div><div class=""><span style="font-family: "Courier New", monospace;" class="">mask: {[101×2 double]}</span></div><span style="font-family: "Courier New", monospace;" class="">cfg: [1×1 struct]</span><br class=""></div><div class=""><br class=""></div><div class="">But I can only see these fields if I use the function importdata(). When I use the function ft_read_sens() and when I try to interpolate channels, I get the following error:</div><div class=""><br class=""></div><div class=""><b class="">Error message:</b></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Unrecognized function or variable 'lab'.</span><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in channelposition (line 352)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">n = size(lab,2);</span></div><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in ft_datatype_sens (line 438)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">        [chanpos, chanori, lab] = channelposition(sens);</span></div><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in ft_datatype_sens (line 240)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">    sens      = ft_datatype_sens(sens, new_argin{:});</span></div><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in ft_datatype_sens (line 207)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">    sens      = ft_datatype_sens(sens, new_argin{:});</span></div><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in ft_datatype_sens (line 180)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">    sens      = ft_datatype_sens(sens, new_argin{:});</span></div><div class=""><br class=""></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">Error in ft_read_sens (line 539)</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">sens = ft_datatype_sens(sens);</span></div><span style="font-size: 12pt;" class=""> </span><br class=""></div> </span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">There are no errors when I plot the channels using the following code though and it all looks absolutely fine:</span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg = [];</span><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.layout = layout_m; %layout_m is imported from the layout_file using the importdata() function</span></div><div class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">cfg.channel = 'eeg';</span></div><span style="font-family: "Courier New", monospace; font-size: 12pt;" class="">ft_layoutplot(cfg, mydata_artrm_train);</span><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: "Courier New", monospace; font-size: 12pt;" class=""><br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Any ideas what could be the issue here and how I could get it solved? </span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Thanks for your help in advance!</span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div id="Signature" class=""><div class=""><div class=""></div><div class=""></div><div class=""></div><div class=""></div><div class=""></div><div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class="">_________________________</span></div><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""></span><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class="">Marta Topor</span></div><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""></span><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class="">PhD Candidate</span></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 16px;" class="">Room 07AC04</span><br class=""></span></div><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""></span><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class="">School of Psychology</span></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class="">University of Surrey </span></div><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""></span><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;" class=""><br class=""></span></div></div></div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://doi.org/10.1371/journal.pcbi.1002202" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div></blockquote></div><br class=""></div></body></html>