<html><head></head><body bgcolor="#FFFFFF"><div>Note that Duncan's suggestions only make sense for a dataset with only one trial. Even then I'm not sure why he had problems with the output as it was but I can check.</div><div><br></div><div>Vladimir</div><div><br></div><div><br>On 15 Nov 2012, at 18:57, Zita Eva Patai <<a href="mailto:eva.patai@psy.ox.ac.uk">eva.patai@psy.ox.ac.uk</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>awesome! thank you Duncan:)<div><br></div><div>Thanks everyone for all the suggestions!!<br><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 6:24 PM, Duncan Astle <span dir="ltr"><<a href="mailto:Duncan.Astle@mrc-cbu.cam.ac.uk" target="_blank">Duncan.Astle@mrc-cbu.cam.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">Word up Zita,<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">Try this(replacing the filename for the file you want):
<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">D1 = spm_eeg_load(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#a020f0">'/imaging/as05/EEG
data/Load3Easy_TF/wmrtf_efMMspm8_raw_0001'</span><span style="font-size:10.0pt;font-family:"Courier New"">);</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">l3e1=D1.fttimelock;</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">l3e1.dimord=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#a020f0">'chan_freq_time'</span><span style="font-size:10.0pt;font-family:"Courier New"">;</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">l3e1.powspctrm = squeeze(D1.fttimelock.powspctrm);</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Extra tip: you first need to separate your conditions such that you have an SPM file for each subject for each condition……..<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Let me know how you get on,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">D.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">________________________________________________<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dr. Duncan Astle,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Programme Leader Track,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">British Academy Research Fellow,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">MRC Cognition and Brain Sciences Unit,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Chaucer Road,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Cambridge.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="mailto:Duncan.Astle@mrc-cbu.cam.ac.uk" target="_blank">Duncan.Astle@mrc-cbu.cam.ac.uk</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a> [mailto:<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>]
<b>On Behalf Of </b>Zita Eva Patai<br>
<b>Sent:</b> 15 November 2012 17:04<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] error when converting from spm to ft<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dear Jörn,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you for the quick reply. I will try your suggestion!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Many thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">z<u></u><u></u></p>
<div>
<p class="MsoNormal">On Thu, Nov 15, 2012 at 2:55 PM, "Jörn M. Horschig" <<a href="mailto:jm.horschig@donders.ru.nl" target="_blank">jm.horschig@donders.ru.nl</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Dear Zita,<br>
<br>
The function seems to convert the function not correctly to a freq datastructure - it seems more like raw data to me.<br>
<br>
freq data requires a .powspctrm field, which should be a matrix of observations x channels x freq x time. So you would need to use cell2mat on your .trial field. Probably you need to permute the dimensions to match this order. Additionally, you will need a
.dimord field which which should be 'rpt_chan_freq_time' and you need a .freq field that contains the frequencies in that matrix. Please first make sure that your trials actually have 3 dimensions, else something else in the conversion went wrong.<br>
<br>
I don't use SPM so no clue if there is a better way than doing it manually.<br>
<br>
Best,<br>
Jörn<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
On 11/14/2012 6:32 PM, Zita Eva Patai wrote:<u></u><u></u></p>
</div>
</div>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">Hello FT-ers <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">In the past i had no problem when converting my data from SPM (where i do preprocessing and averaging) to FT (where I do my cluster-stats and plotting)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Currently, I am using the new way to convert (previous version seems outdated 'nspm2ftrip') and I am hitting a wall: it says my data is not in the right format, ie: not freq data. But i know that it is...any advice would be much appreciated!
Not to mention is warns me my data is not epoched when it is indeed so...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">zita<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">*********************<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><b>>> D = spm_eeg_load</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">SPM M/EEG data object<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Type: evoked<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Transform: TF<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">8 conditions<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">326 channels<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">20 frequencies<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">501 samples/trial<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">8 trials<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sampling frequency: 250 Hz<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Loaded from file C:\Users\Eva Z Patai\Documents\MATLAB\epoched_data\tf\rmtf_rs01_timecorr.mat<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Use the syntax D(channels, frequencies, samples, trials) to access the data<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Type "methods('meeg')" for the list of methods performing other operations with the object<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Type "help meeg/method_name" to get help about methods<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>>> data = spm2ft(D)</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "11" to condition code 1<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "12" to condition code 2<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "21" to condition code 3<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "22" to condition code 4<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "31" to condition code 5<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "32" to condition code 6<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "41" to condition code 7<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">mapping condition label "42" to condition code 8<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">data = <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> fsample: 250.0000<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> label: {326x1 cell}<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> time: {1x8 cell}<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> trial: {1x8 cell}<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> trialinfo: [8x1 double]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> cfg: [1x1 struct]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>>> data2 = ft_checkdata(data, 'datatype', 'freq')</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Warning: the data does not contain a trial definition, assuming that the trials are consecutive segments of a continuous recording <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">> In utilities\private\warning_once at 81<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> In utilities\private\fixsampleinfo at 54<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> In ft_datatype_raw at 91<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> In ft_checkdata at 170 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:red">Error using ft_checkdata (line 288)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:red">This function requires freq data as input.</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Zita Patai<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DPhil, Experimental Psychology<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">University of Oxford<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://bcl.psy.ox.ac.uk/people/zita-eva-patai/" target="_blank">bcl.psy.ox.ac.uk/people/zita-eva-patai/</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div>
</div>
<pre>_______________________________________________<u></u><u></u></pre>
<pre>fieldtrip mailing list<u></u><u></u></pre>
<pre><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><u></u><u></u></pre>
<pre><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><u></u><u></u></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
<u></u><u></u></p>
<pre>-- <u></u><u></u></pre>
<pre>Jörn M. Horschig<u></u><u></u></pre>
<pre>PhD Student<u></u><u></u></pre>
<pre>Donders Institute for Brain, Cognition and Behaviour <u></u><u></u></pre>
<pre>Centre for Cognitive Neuroimaging<u></u><u></u></pre>
<pre>Radboud University Nijmegen <u></u><u></u></pre>
<pre>Neuronal Oscillations Group<u></u><u></u></pre>
<pre>FieldTrip Development Team<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre>P.O. Box 9101<u></u><u></u></pre>
<pre>NL-6500 HB Nijmegen<u></u><u></u></pre>
<pre>The Netherlands<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre>Contact:<u></u><u></u></pre>
<pre>E-Mail: <a href="mailto:jm.horschig@donders.ru.nl" target="_blank">jm.horschig@donders.ru.nl</a><u></u><u></u></pre>
<pre>Tel: <a href="tel:%2B31-%280%2924-36-68493" target="_blank">+31-(0)24-36-68493</a><u></u><u></u></pre>
<pre>Web: <a href="http://www.ru.nl/donders" target="_blank">http://www.ru.nl/donders</a><u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre>Visiting address:<u></u><u></u></pre>
<pre>Trigon, room 2.30<u></u><u></u></pre>
<pre>Kapittelweg 29<u></u><u></u></pre>
<pre>NL-6525 EN Nijmegen<u></u><u></u></pre>
<pre>The Netherlands<u></u><u></u></pre>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Zita Patai<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DPhil, Experimental Psychology<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">University of Oxford<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://bcl.psy.ox.ac.uk/people/zita-eva-patai/" target="_blank">bcl.psy.ox.ac.uk/people/zita-eva-patai/</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div>
<div>Zita Patai</div><div>DPhil, Experimental Psychology</div><div>University of Oxford</div><div><a href="http://bcl.psy.ox.ac.uk/people/zita-eva-patai/" target="_blank">bcl.psy.ox.ac.uk/people/zita-eva-patai/</a></div><div>
<br></div><br>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>fieldtrip mailing list</span><br><span><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a></span><br><span><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div></blockquote></body></html>