<div dir="ltr"><div>Dear Gaëlle,</div><div><br></div><div>To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.</div><div><br></div><div>Cheers,</div><div>Stephen<br></div><div><br></div>
</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <<a href="mailto:gaelle.leys@kuleuven.be">gaelle.leys@kuleuven.be</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="NL-BE">
<div class="gmail-m_459741866957694218WordSection1">
<p class="MsoNormal">Dear Fieldtrip community, <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-US">I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can’t seem to resolve.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I’m getting some errors.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph"><u></u><span lang="EN-US"><span>1)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span lang="EN-US">When trying to downsample with the default options, these are the errors that I get:
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">Error using resample>getSamples (line 357)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">The number of elements of Tx must match the number of rows of X when X is a matrix<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">Error in resample>nonUniformResample (line 123)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">[x, tx] = getSamples(varargin{1:2});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">Error in resample (line 116)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"> [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US">Error in ft_resampledata (line 228)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"> newdat = transpose(resample(transpose(olddat),fsres,fsorig));<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.2pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:red" lang="EN-US"> </span>
<span lang="EN-US">I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph"><u></u><span lang="EN-US"><span>2)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span lang="EN-US">When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Error using plot<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Vectors must be the same length.<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Error in ft_artifact_zvalue>redraw_cb (line 973)<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US"> plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Error in ft_artifact_zvalue (line 512)<u></u><u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph" style="margin-left:70.8pt"><span style="color:red" lang="EN-US"> redraw_cb(h);</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span lang="EN-US"> I’ve noticed that the xval and yval are different numbers, which of course doesn’t allow plotting. It seems like the xval changes according to the epoch length, however the yval remains
the same and equals the amount of samples in my continuous data.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="gmail-m_459741866957694218MsoListParagraph"><u></u><span lang="EN-US"><span>3)<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><span lang="EN-US">When choosing no for the interactive plot, I also get an error:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Error using zeros<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Size inputs must be integers.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt"><span style="color:red" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">Error in ft_artifact_zvalue (line 568)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt"><span style="color:red" lang="EN-US">dum = zeros(1,max(opt.trl(:,2)));</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’ve been looking into the functions and where it goes wrong, but I can’t seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Kind regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:rgb(29,141,176)" lang="EN-US">Gaëlle Leys<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Arial",sans-serif;color:rgb(51,51,51)" lang="EN-US">Research Associate
<br>
Brain & Cognition <br>
Tiensestraat 102 box 3714 <br>
3000 Leuven<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:10pt;font-family:"Arial",sans-serif;color:rgb(51,51,51)" lang="EN-US">Room PSI 02.33<br>
tel. </span><span style="font-size:10pt;font-family:"Arial",sans-serif;background:white none repeat scroll 0% 0%">+32 16 37 61 98</span><span style="font-family:"Arial",sans-serif;background:white none repeat scroll 0% 0%"> </span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>