<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hi 

Jan-Mathijs,<br><br>Thank you so much for your swift and thorough answer! <br><br>Sadly, removing the .trl, .channels and .dimord fields did not solve my problem. It did halve the number of warnings I get (from 8 to 4). A few quick tests showed me this came down to removing the .trl field and not the other ones. <br>I also get a warning about inconsistent sampleinfo, which I forgot to mention in my original email.<br><br>Could it be a problem with my FT path? I had path-related errors with SPM earlier, and I ended up solving them by adding ft_defaults in my startup.m file. <br><br>Another thing I found out is that the error I get (<font face="courier new, monospace">Array dimensions must match for binary array op.</font><font face="arial, sans-serif">) doesn't always happen at the same time. The processing counter goes up to trial 3, and then frequency somewhere between 1 and 24.  I'm not sure what this means, though.<br><br>Do you have any suggestions? <br><br>Thank you! <br><br>Thomas<br><br></font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 3 juin 2019 à 11:35, Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>> a écrit :<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 style="overflow-wrap: break-word;">
Hi Thomas,
<div><br>
<div>Thanks for your informative e-mail :). </div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Here's what I did:<br>
<br>
<br>
<b>1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)<br>
<br>
</b></div>
<div><b>2- Put that data into a structure built as follows, adding fields that FieldTrip required:</b><br>
<div><br>
</div>
<div><font face="courier new, monospace">    fsample: 1017           </font>(I know this is weird but we're stuck with it)</div>
<div><font face="courier new, monospace">   channels: [1 17 25 29]   </font>Added to keep track of in-house bookkeeping</div>
<div><font face="courier new, monospace">      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'  'Ch:25 idElectrodeSite:184' 
<br>
              'Ch:29 idElectrodeSite:185'}  </font>Not the right structure, but I don't have header files to get them from</div>
<div><font face="courier new, monospace">      trial: {55×1 cell}    </font>One cell per trial, with each being<font face="courier new, monospace"> [chan x time]</font></div>
<div><font face="courier new, monospace">       time: {55×1 cell}    </font>One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.</div>
<div><font face="courier new, monospace">        trl: [55×3 double]  </font>Built from scratch as if the trials were continuous. (Inspired by the FT function that does this) </div>
<div><font face="courier new, monospace">     dimord: 'chan_time'    </font>Added by hand, can't get Fieldtrip to recognize it</div>
<div><font face="courier new, monospace"> sampleinfo: [55×2 double]  </font>The first two columns of
<font face="courier new, monospace">trl</font></div>
</div>
<div><font face="courier new, monospace"><br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, sans-serif"><b>3- Try to use ft_freqanalysis using the following cfg (also attached)<br>
<br>
</b></font></div>
<div><font face="courier new, monospace">cfg = [];<br>
cfg.method= 'tfr';<br>
cfg.pad = 'nextpow2';<br>
cfg.width = 7;<br>
cfg.gwidth = 3;<br>
cfg.foi = [15:1:60];<br>
cfg.toi = 'all';</font><br>
</div>
<div><font face="arial, sans-serif"><br>
I first get the message: <br>
</font><font face="courier new, monospace">the input is raw data with 4 channels and 55 trial<br>
</font><font face="arial, sans-serif">This would be encouraging, but then,
</font><span style="font-family:arial,sans-serif">I get the following warnings:</span></div>
<div><font face="courier new, monospace"><br>
Warning: could not determine dimord of "trial" in: </font><font face="arial, sans-serif">(structure shown above)</font><br>
</div>
<div>
<div><font face="courier new, monospace">Warning: could not determine dimord of "trl" in:   </font><span style="font-family:arial,sans-serif">(structure shown above)<br>
...but four pairs of them.<br>
<br>
Looking through the debugger, I found out they're given when </span><span style="font-family:arial,sans-serif">ft_freqanalysis, calls ft_checkdata and ft_selectdata. <br>
</span><span style="font-family:arial,sans-serif"><b>Are these warnings something I should be worried about, or can everything work well the way it is?</b> <br>
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?<br>
<br>
</span></div>
<div><span style="font-family:arial,sans-serif">After the warnings, I get this:<br>
</span><font face="courier new, monospace"><br>
the call to "ft_selectdata" took 16 seconds<br>
processing trials<br>
trial 2, frequency 32 (46.18 Hz)<br>
<font color="#ff0000">Array dimensions must match for binary array op.<br>
<br>
Error in ft_freqanalysis (line 679)<br>
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);<br>
</font></font><span style="font-family:arial,sans-serif"><br>
</span></div>
</div>
<div><font face="arial, sans-serif">...which I simply don't know how to solve.<br>
<br>
<br>
<b>So in summary:</b> <br>
<br>
1- Is it possible to make FT work without using original files to get the data?<br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
Yes!</div>
<div><br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, sans-serif">2- If it is, what have I done wrong, and how could I make it work?<br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
See above.</div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, sans-serif">3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?<br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Not worrisome, they should go away if you do exactly as I told :).</div>
<div><br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, sans-serif">4- Any idea on how to solve the error message I get is appreciated, but a secondary objective. <br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Probably it goes away.</div>
<div><br>
</div>
<div>Keep up the good work and with best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, sans-serif"><br>
I attached the function I made to build the data structure in case it could help.<br>
<br>
<br>
Thank you very much for reading this long-winded message!<br>
<br>
Regards<br>
<br>
Thomas Lusignan, B. Sc. <br>
Paul Cisek's Lab<br>
Université de Montréal</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span id="gmail-m_8553826702683700469cid:f_jwb59hzt1"><GetFTLFP.m></span>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</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>