From mattmizumi at gmail.com Wed Oct 1 05:00:26 2014 From: mattmizumi at gmail.com (Matthijs van der Meer) Date: Tue, 30 Sep 2014 23:00:26 -0400 Subject: [FieldTrip] single-trial power correlation: why not? Message-ID: <542B6E4A.3090409@gmail.com> *Short version of question:* What can I do to get ft_connectivityanalysis to compute a power correlation for a single trial? Or is this a stupid question based on a misunderstanding of what this function is designed to do? Conceptually, there doesn't seem to be a problem with this, because if I have two signals I can compute the instantaneous power of each as a function of time for a given frequency, and correlate them. However, when calling ft_connectivityanalysis on the output of ft_freqanalysis with only one trial, an error is thrown. *Long version of question:* My data looks like this: hdr: [1x1 struct] label: {'X' 'Y'} fsample: 2000 trial: {1x351 cell} time: {1x351 cell} sampleinfo: [351x2 double] cfg: [1x1 struct] Now I run a frequency analysis on one trial: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.foi = 40:1:100; cfg.trials = 1; cfg.taper = 'hanning'; cfg.polyremoval = 1; cfg.channelcmb = {'X','Y'}; F = ft_freqanalysis(cfg,data_trl); Then I would like to do cfg = []; cfg.method = 'powcorr'; powcorr = ft_connectivityanalysis(cfg, F); But this gives this unhelpful error: Error using fixdimord (line 159) unexpected dimord "rpttapn_freq" Nosing around in ft_connectivityanalysis() suggests that the following line data = ft_selectdata(data, 'avgoverrpt', 'yes'); assumes that we want to average over repetitions (trials), which has unexpected results when there is only one trial. Skipping this line enables ft_connectivityanalysis() to run without errors, but the resulting power correlation has only NaNs. Any suggestions? I know I can do the whole thing manually with filtering and Hilbert transforms and such, or perhaps workaround by creating fake trials, but it would be useful to do this in ft neatly. From jm.horschig at donders.ru.nl Wed Oct 1 16:03:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 01 Oct 2014 16:03:38 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <542C09BA.4020501@donders.ru.nl> Hi Ana, from the first call with eventtype = '?', the output says > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' This means that there is one event type in our data, namely 'trigger', and the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. FieldTrip works that way that it passes on the cfg.trialdef structure to the trialfun that is specified. In your particular case, trialfun_bit2dec does not seem to have a very user-friendly error message, but the error message means that whatever eventtype and eventvalues you asked for, they are not present in your data. When looking at what you define, you can probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. However, checking back the output that you created with '?', there is no event type 'STATUS' in your data. Therefore, everything works fine with your trialfun. If you try specifying the trialdef properly, everything should work fine. A general advise when using an own trial fun and getting an error message: Try your code without specifying cfg.trialfun first. Then FieldTrip will use the standard trialfun, which should work if all your cfg-settings are fine. If the standard trialfun runs without errors, then your trialfun should do so too. If your trialfun, however, then crashes, the error is most likely in the trialfun that you used, and not in the cfg-settings. In your case, however, I am fairly certain that the cfg-settings you specified were causing your problem. I hope this helps. Best, Jörn On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > For a more simple check, when I try to read the events without the > trialfun ( so it uses ft_trialfun_general by default) I get the > original event values: > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 135 > evaluating trialfunction 'ft_trialfun_general' > reading the events from '27CW1.RAW' > the following events were found in the datafile > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' > no trials have been defined yet, see FT_DEFINETRIAL for further help > found 750 events > created 0 trials > the call to "ft_definetrial" took 4 seconds > > Then I try to use the trialfun, I get the same error > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialfun = 'trialfun_bit2dec'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > evaluating trialfunction 'trialfun_bit2dec' > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > So there is something the trialfun_bit2dec does that events cannot be > read anymore. > > > On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > wrote: > > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to > index an element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And > compare those with any of the ones falling under the switch case > statement? One way to do this, is to put a debug marker (red dot) > at the 'end' of the first for-loop (judging from the wiki). Then > check the value of event(i).value, and click the continue button > to move on to the next. An alternative way is to put a debug > marker after event = ft_read_event and to instantly check all > values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini > >: > > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini > > wrote: > > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = > 'saveonerror' and matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read > them with the raw data, they seem to be there, with the > DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk > > wrote: > > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]." > > that none of the triggers were found in your event > data. You might wanna check why this is happening, by > debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini > >: > > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I > followed your advice and I changed definetrial to > ft_definetrial and I confirm the function was > added to my paths. After doing this, the error I > get is: > > Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I > think I added what I think are useless lines but I > was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun > definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus > triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my > analysis because I would like to use only > Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > > wrote: > > Hi again Ana Laura, > > One other thing that I thought of was to make > sure that the function "trialfun_bit2dec" is > added to your paths in matlab, so that > ft_definetrial can find this function. > > By updating your fieldtrip to the most recent > version "trialfun_bit2dec" is *not* included. > So you'll need to store that as a separate .m > file in a location that can be accessed by the > paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > > > To: "FieldTrip discussion list" > > > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a > trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this > is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use > an old version of > > Fieldtrip for my scripts because I wrote > them long ago and this > > trialfun uses the new format (with > 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, > Nietzsche < > > n.lam at fcdonders.ru.nl > > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which > trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing > under "do the > > trial definition for the fully incongruent > (FIC) condition). > > > > Please try adding this: "cfg.trialfun = > 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see > below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% > trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error > message, it seemed that the > > problem was in the function > trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called > this function. I was > > wondering if the code you provide > corresponded to the code that > > created your error message? I'm guessing you > ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not > via definetrial). In which > > case, it was looking for > cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the > relevant information in > > the cfg (which is in the code you showed > us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < > diezmartini at gmail.com > > > > > To: "FieldTrip discussion list" < > fieldtrip at science.ru.nl > > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I > want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, > cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not > writing it in the correct part > > > of > > > my script. This is my trial definition > part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, > '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, > '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Nietzsche H.L. Lam, MSc > > PhD Candidate > > > > Max Planck Institute for Psycholinguistics > > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > > > Donders Institute for Brain, Cognition and > Behaviour, > > Centre for Cognitive Neuroimaging, > > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > > > n.lam at fcdonders.ru.nl > > > +31-24-3668219 > > > > > > neurobiologyoflanguage.com > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and > Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From sreenivasan.r.nadar at gmail.com Thu Oct 2 03:08:41 2014 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 1 Oct 2014 21:08:41 -0400 Subject: [FieldTrip] Preprocessing for Elekta Message-ID: Hello Robert, Is there any standard preprocessing script available for the Elekta MEG (306 sensors) system from your group? Thanks Regards, Sreenivasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 2 08:53:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 2 Oct 2014 08:53:18 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: Hi Sreenivasan, Just four days ago, Stephen posted the following to the list in response to an almost identical question: http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html Eelke On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. wrote: > Hello Robert, > > Is there any standard preprocessing script available for the Elekta MEG (306 > sensors) system from your group? > > Thanks > > Regards, > Sreenivasan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Thu Oct 2 10:34:49 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 2 Oct 2014 10:34:49 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Hi Sreenivasan, in addition to Eelke’s response you can also have a look here: http://fieldtrip.fcdonders.nl/getting_started/neuromag Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. best tzvetan > Hi Sreenivasan, > > Just four days ago, Stephen posted the following to the list in > response to an almost identical question: > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html > > Eelke > > On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. > wrote: >> Hello Robert, >> >> Is there any standard preprocessing script available for the Elekta MEG (306 >> sensors) system from your group? >> >> Thanks >> >> Regards, >> Sreenivasan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From spa268 at nyu.edu Thu Oct 2 12:37:47 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 2 Oct 2014 14:37:47 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eric, Thank you very much, this is what I had in mind! Best, Steve > > > Message: 1 > Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) > From: "Eric Maris" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Steve, > > > > Have a look here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests > > > > Best, > > > > Eric Maris > > > > From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] > Sent: woensdag 24 september 2014 11:18 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject > design > > > > Hi Eelke, > > > > Thanks for this information. I just wanted to jump in and ask: what about > for interactions in a mixed 2x2 design? For example, say I expect a > difference between conditions A and B for group 1, but not group 2. Would > the correct way to do this be to > > > > 1) make difference waves (A-B) for each participant, then > > 2) do a between-UO test on the difference waves using indepsamplesT? > > > > In the past I have always tested within-UO interactions using basically this > method (based on > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html ), > but I was under the impression that this is not OK for mixed designs (from > this post: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) > > > > Thanks, > > Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Thu Oct 2 14:24:39 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Thu, 2 Oct 2014 12:24:39 +0000 Subject: [FieldTrip] buffer.mexw64 not found Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.gwilliams at nyu.edu Thu Oct 2 16:02:12 2014 From: laura.gwilliams at nyu.edu (Laura Elizabeth Gwilliams) Date: Thu, 2 Oct 2014 18:02:12 +0400 Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system Message-ID: Dear Fieldtrippers, I am trying to run a time-frequency analysis, but I am having difficulty plotting the TFRs on the sensor arrays using ft_multiplotTFR. The reason for this is that I cannot find an appropriate *.lay file for my sensor array to use in the cfg.layout argument. I am using data from a Yokogawa MEG system with 208 channels. But when looking at the layout files available within fieldtrip, the "yokogawa440.lay" does not seem to have the correct number of sensors for my data. Do you know how I can either get my hands on the correct layout file, or create my own? I have looked at the tutorials for help (i.e., http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout) but this does not seem to solve my problem. It appears that I should be able to extract sensor information directly from my data to create my own .lay file, but there are no instructions on how to go about this. Any advice you can offer would be very much appreciated. Regards, Laura. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 2 16:23:11 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Thu, 2 Oct 2014 16:23:11 +0200 (CEST) Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system In-Reply-To: Message-ID: <1400667131.1960820.1412259791755.JavaMail.root@indus.zimbra.ru.nl> Hi Laura, Please take a look at this tutorial on creating a layout: http://fieldtrip.fcdonders.nl/tutorial/layout Best, Nietzsche ----- Original Message ----- > From: "Laura Elizabeth Gwilliams" > To: fieldtrip at science.ru.nl > Sent: Thursday, 2 October, 2014 4:02:12 PM > Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system > Dear Fieldtrippers, > > > I am trying to run a time-frequency analysis, but I am having > difficulty plotting the TFRs on the sensor arrays using > ft_multiplotTFR. The reason for this is that I cannot find an > appropriate *.lay file for my sensor array to use in the cfg.layout > argument. > > > I am using data from a Yokogawa MEG system with 208 channels. But when > looking at the layout files available within fieldtrip, the > "yokogawa440.lay" does not seem to have the correct number of sensors > for my data. > > > Do you know how I can either get my hands on the correct layout file, > or create my own? I have looked at the tutorials for help (i.e., > http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout ) but this > does not seem to solve my problem. It appears that I should be able to > extract sensor information directly from my data to create my own .lay > file, but there are no instructions on how to go about this. > > Any advice you can offer would be very much appreciated. > > > Regards, > Laura. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From r.oostenveld at donders.ru.nl Thu Oct 2 19:20:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 19:20:11 +0200 Subject: [FieldTrip] Fwd: Postdoc position, Stockholm, Sweden References: <71FFC072A22A7E448CD56F40BD593D677900EC95@KIMSX04.user.ki.se> Message-ID: <033EDCEA-66B1-464B-90C7-FC37BE3CA011@donders.ru.nl> Begin forwarded message: From: Daniel Lundqvist Subject: Postdoc position, Stockholm, Sweden English Postdoctoral Research Fellow in Magnetoencephalography (MEG) Karolinska Institutet, The Department of Clinical Neuroscience The Department of Clinical Neuroscience (CNS) conducts research and education in the field of neuroscience from the molecular level to the society level. The clinical research and education is conducted in collaboration with other research groups from the Karolinska Institutet, with other universities as well as the Stockholm County Council. Please visit our website for more information: ki.se/en/cns NatMEG – the National Facility for Magnetoencephalography (MEG) As of September 2013, Karolinska Institutet hosts a superbly equipped MEG lab. The lab, NatMEG, is a national facility, open for researchers from all across Sweden. The fact that NatMEG is a national facility is reflected by the wide array of projects currently ongoing/under initiation at NatMEG, covering areas such as next-generation SQUIDS, computational modelling, epilepsy work-ups, and cognitive neuroscience in the areas of memory, language, attention, perception, pain, music, decision making, emotion, autism, schizophrenia, Parkinson’s and Alzheimer’s disease, and more. The position as postdoctoral research fellow at NatMEG NatMEG currently have one post doc and three guest professors to support and initiate research at the lab. We are new expanding our team with another postdoc researcher. The 2 year position gives the researcher an unusual mix of inspiring interaction with researchers from a wide range of research areas and a freedom to pursuit one’s own qualified research questions. Please visit www.natmeg.se for more information. Duties The duties as a postdoc will consist of: Research and development of methods and analysis within MEG and EEG at the national infrastructure for magnetoencephalography (NatMEG), entailing some general operation. Scientific support to users at NatMEG, regarding methods, experimental design and analysis. The postdoc’s own qualified research within MEG, and/or simultaneous MEG & EEG. Entry requirements A person is eligible for a position as postdoctoral research fellow if he or she has obtained a PhD no more than seven years before the last date of employment as postdoc. It is highly valued if a candidate: Has strong skills and expertise in MEG analysis (preferably in FieldTrip and/or MNE). Has extensive MEG hands-on experience (preferably on an Elekta Triux or Vectorview system), with setting up experiments including peripheral stimulators. Has extensive hands-on experience from data collection, including system tuning, screening and subject preparations. Is independent, professional, and service minded, and enjoys interacting with researchers and research subjects. Has experience with psychophysiology measurements. Has experience with eye tracking measurements. Has a research interest within the cognitive neuroscience domain. Masters academic English It is also valued if a candidate: Has experience with MEG (and/or EEG) measurements on children, and on clinical populations such as Autism, Schizophrenia, Alzheimer's and Parkinson's disease, Has medical or psychology training Application process An employment application must contain the following documents in English or Swedish: 1. A complete curriculum vitae, including date of the thesis defence, title of the thesis, previous academic positions, academic title, current position, academic distinctions, and committee work 2. A clear description of how entry requirements are met 3. A complete list of publications 4. A summary of current work (no more than one page) 5. Verifications for crediting of illness, military service, work for labour unions or student organisations, parental leave or similar circumstances 6. Verification from the thesis defence committee or the equivalent (only if the thesis defence is scheduled within three months after the application deadline) The application is to be submitted in the MyNetwork recruitment system. Qualified candidates will initially be interviewed over Skype, and will also be asked to make a presentation of her/his research and research plans over Skype. The final evaluation of candidates may involve a lab visit and a formal interview at NatMEG and Karolinska Institutet. Karolinska Institutet is one of the world´s leading medical universities. Its mission is to contribute to the improvement of human health through research and education. Karolinska Institutet accounts for over 40 per cent of the medical academic research conducted in Sweden and offers the country´s broadest range of education in medicine and health sciences. Since 1901 the Nobel Assembly at Karolinska Institutet has selected the Nobel laureates in Physiology or Medicine. Pursuant to the regulations of the Swedish National Archives, applications are kept on file for two years after the appointment has gained legal force. The regulations do not apply to attachments that have been printed or otherwise published. Karolinska Institutet strives to provide a workplace that has approximately the same number of women and men, is free of discrimination and offers equal opportunity to everyone. For temp agencies and recruiters, and to salespersons: We politely, yet firmly, decline direct contact with temp agencies and recruiters, as well as those selling additional job announcements. Type of employment: Temporary position longer than 6 months Working hours: Full time Working hours: 100% City: Stockholm County: Stockholms län Country: Sweden Reference number: 2-3004/2014 Contact: 1. Daniel Lundqvist, Head of Unit, +46 8-524 832 62 2. Elin Johansson, HR Officer, +46 8-524 830 44 Union representative: 1. Arsalan Amir, SACO, 08 - 517 733 37, arsalan.amir at ki.se 2. Christina Hammarstedt, OFR, christina.hammarstedt at ki.se 3. Gunnar Stenberg, SEKO, 08-524 880 75 Published: 01.Oct.2014 Last application date: 21.Oct.2014 Return to job vacancies Application process Read more about the application process at http://ki.mynetworkglobal.com/en/what:job/jobID:43573/. Applications are to be submitted in the recruitment system MyNetwork. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8101 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 260 bytes Desc: not available URL: From russgport at gmail.com Thu Oct 2 20:10:58 2014 From: russgport at gmail.com (Russell G Port) Date: Thu, 2 Oct 2014 14:10:58 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data In-Reply-To: References: Message-ID: Dear All, Sorry for this repetitive email. I realize one I have asked this question before, I couldn't find the email before now, so I was not sure if it were the exact same question. Please ignore this email discussion. for those who were wondering here is the previous answer This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). Again thank is due to Dr. Schurger, and my apologizes On Tue, Sep 30, 2014 at 10:08 AM, Russell G Port wrote: > Hi All, > > I have a question, which I hope someone can help with. Currently I read in > my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins > for the length of the data. After proper removal of all jump and muscle > artifact, I apply ICA to the resample data (now 300Hz before it was > 1200Hz). This is just like fieldtrip's website suggests. Then I verify > which components I want to remove via topoplots and coherence in the time > domain with the ECG channels. So I now have the list of components that I > think are artifact and want removed. Can these components be applied for > rejection onto the same dataset, but differently parsed into epochs, now > trials being centered 1 second bins around a trigger? I am trying to see if > this works, because I hope if I include more data in the ICA analysis (all > data in the dataset) I will get a better components since there are more > trials to train the data on, rather than if I based trials around the > trigger. I guess what I want to know is if I can get better estimates of my > artifacts via using a larger dataset, and then apply then to the same > dataset just differently epoched? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Oct 2 21:53:16 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 2 Oct 2014 21:53:16 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Dear Anne, dear all, I did try to create a customized trialfunction serving my needs. This is what I came up with: function [trl, event] = response_trialfun(cfg); % read the header information and the events from the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); % search for "trigger" events value = [event(find(strcmp('ceck', {event.value}))).value]'; sample = [event(find(strcmp('ceck', {event.value}))).sample]'; % search for "trigger" events value2 = [event(find(strcmp('resp', {event.value}))).value]'; sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; % determine the number of samples before and after the trigger pretrig = -round(cfg.trialdef.prestim * hdr.Fs); posttrig = round(cfg.trialdef.poststim * hdr.Fs); % look for the combination of a trigger "7" followed by a trigger "64" % for each trigger except the last one trl = []; trlbegin = sample + pretrig trlend = sample + posttrig offset = pretrig RT = sample2 - sample newtrl = [trlbegin trlend RT]; trl = [trl; newtrl]; end In fact it seems to work, the trials look good and the RT is computed correctly. Only that after the preprocessing (with ft_preprocessing: %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] mov_data = ft_preprocessing(cfg); % ) there is no mov_data.trialinfo created. I thought that the information in trl above would be saved there. Without those I am not able to do the redefinition as planned (like Anne proposed: offset = (mov_data.trialinfo(:,3)); prestim = 0.75; poststim = 0.75; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); mov_data_small = ft_redefinetrial(cfg, mov_data); % then shift the time axis cfg = []; cfg.offset = -offset; mov_data_small = ft_redefinetrial(cfg, move_data_small); How come the information is not stored? Somebody an idea? Thanks a million Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 2 23:54:26 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 23:54:26 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> References: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Message-ID: <76680AE0-A354-4E90-ABC7-38AA915C9B03@donders.ru.nl> Hi Sreenivasan To follow up on the email from Stephen: Right at this moment we are running the workshop at the NatMEG in Stockholm. During this week we finished a number of dedicated tutorials that are based on data from the Elekta/Neuromag system. Besides MEG data, the tutorials also deal with simultaneously recorded EEG data. You can find them here http://fieldtrip.fcdonders.nl/tutorial/natmeg The accompanying tutorial data is not yet completely available from the ftp server, but will be made available in one of the upcoming weeks. Furthermore, it might be that the tutorial pages might move around on the wiki (and hence the URL might change) to fit them better in the existing content. Note that you should not take these or any other tutorials as “standard” scripts, nor as a recommendation of best practice. They serve as examples to teach how certain analyses work, but are still specific to one particular dataset in one particular experimental paradigm. In general the tutorials show how you *can* do the analysis, but not how you *should* do it. vänliga hälsningar, Robert On 02 Oct 2014, at 10:34, Tzvetan Popov wrote: > > Hi Sreenivasan, > in addition to Eelke’s response you can also have a look here: > > http://fieldtrip.fcdonders.nl/getting_started/neuromag > > Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. > best > tzvetan > > >> Hi Sreenivasan, >> >> Just four days ago, Stephen posted the following to the list in >> response to an almost identical question: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html >> >> Eelke >> >> On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. >> wrote: >>> Hello Robert, >>> >>> Is there any standard preprocessing script available for the Elekta MEG (306 >>> sensors) system from your group? >>> >>> Thanks >>> >>> Regards, >>> Sreenivasan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From boris.burle at univ-amu.fr Fri Oct 3 07:19:19 2014 From: boris.burle at univ-amu.fr (Boris BURLE) Date: Fri, 03 Oct 2014 07:19:19 +0200 Subject: [FieldTrip] Post-doc position Message-ID: <542E31D7.4070301@univ-amu.fr> Dear FieldTrip Users, The "Laboratoire de Neurosciences Cognitives" (Aix-Marseille Université, CNRS, Marseille, FR) is opening a post-doctoral position (EEG/MEG) to work on an ERC project aiming at deciphering pro-active and reactive cognitive control, within the team "Attention, Chronometry and Cortical Dynamics". Each position is offered for 12 months (first instance, potentially renewable). Applicants must have a PhD on Cognitive Neuroscience/Experimental Psychology (or related disciplines) and have a good knoedge on EEG and/or MEG processing. Knowledge on spatial analysis (CSD for EEG, inverse solution for EEG and MEG) is certainly a plus. Although not required, programming skills in high level scientific languages (Python, Matlab etc...) will be (highly) appreciated. The hosting group is equipped with several EEG systems (64 and 128 electrodes) and has access to a 248 magnetometers MEG system (4D Neuroimaging magnes 3600), coupled with an EEG system. When applying please indicate [post-doc EEG/MEG] in the subject of your mail. Salary will be adjusted based on experience, and will follow CNRS regulation (between 2000 and 2900€ net). The "Laboratoire de Neurosciences Cognitives" is embedded in a very active and large Brain Research community (the second largest in France), ranging from cellular physiology to social neurosciences. The hosting group has strong connections with the local Brain research community, and numerous international collaborations, that will benefit to the retained candidates. French speaking is not a requirement. Position starts as soon as possible, and will be opened until it is filled. Besides, Marseille is a very nice city in south of France, on the Mediterranean Sea, with a warm climate. It is also at about 1h30 from the Alps mountains, allowing easy access to hiking and winter sports. CV and motivation letters, along with informal enquiries, are to be sent to Boris BURLE (email: boris.burle at univ-amu.fr), with the appropriate subject heading (see above). All the best, B. Burle From m.goeldi at psychologie.uzh.ch Fri Oct 3 11:02:02 2014 From: m.goeldi at psychologie.uzh.ch (m.goeldi at psychologie.uzh.ch) Date: Fri, 3 Oct 2014 11:02:02 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming Message-ID: Hi fieldtrippers I am trying to do source localization for my EEG data with beamforming, but my results seem to indicate something has gone wrong. The subjects were exposed to a flickering screen of 14Hz so I expect atleast some activity in the visual cortex. The topoplot of a frequency analysis showed a 15Hz peak in the parietal area. The Problem: I always get extreme activity in a few voxels, usually around the fringes of my volume, several orders of magnitude larger than the rest. See attached figure 1. If I adjust the colorscale of my plot drastically i only get activity at the fringes of the brain/along the skull. See figure 2. This seems like a systematic error but at this point I am not sure where my error is. I am suspecting the forward/inverse model, the frequency analysis or my preprocessing pipeline. (So basically everything) I have created my source model using .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in fieldtrip and I have also tried to create the headmodel myself using .\fieldtrip-20140225\template\headmodel\standard_mri.mat. The results are slightly different as in where the extreme activities are, but qualitatively they are the same. A plot of the head and source model with the electrodes is attached in figure3. Source, head and electrodes seem to math up fine. The Questions: Is there something obviously wrong with my head/source model? Is there something wrong with how i calculate the cross spectral density matrix? And is there a way to visualize the output of ft_freqanalysis to do a sanity-check? Since there is no time dimension the ft plotting options don't work. Is there something wrong with my preprocessing pipeline? (Artifact rejection was done before using VisionAnalyzer2) Thanks in advance for your thoughts and inputs Cheers Maurice PS: Before submitting this I updated to the newest version of ft (20141002) to see if it was a version issue. It turns out that all the template files I had been using from my previous install (20140225) have vanished sometime inbetween. Is there a reason for this? Btw. I ran it with the new version and the old template files and the result is the same. Some Code: %% Preprocessing: cfg = [];                                           % empty configuration cfg.dataset                 = '..\Data\9 20131105 0928_Segmentation 3.dat';       % dataset  cfg.trialdef.eventtype      = 'Comment'; cfg.trialdef.prestim        = 0.3; cfg.trialdef.poststim       = 2; cfg.trialdef.eventvalue     = {'14HZ'}; cfg = ft_definetrial(cfg); % baseline correction cfg.demean = 'yes'; cfg.baselinewindow = [-0.3 0]; % rereference to avg over all cfg.reref = 'yes'; cfg.refchannel = 'all'; data = ft_preprocessing(cfg); % shifts and scales all channles of the the input data % to a mean of zero and a standard deviation of one. cfg = []; data = ft_channelnormalise(cfg,data); % load the manually realigned electrodes load('.\Data\electrodes_aligned.mat'); % Time window of interest cfg = [];                                           cfg.toilim = [0 2];                       dataPost = ft_redefinetrial(cfg, data); %% Calculating the cross spectral density matrix cfg            = []; cfg.method     = 'mtmfft'; cfg.taper = 'dpss'; cfg.output     = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq  = 2; cfg.foi        = 15; freqPost      = ft_freqanalysis(cfg, dataPost); %% The forward model and lead field matrix % load mri load('C:\Program Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') % make segments cfg          = []; segmentedmri = ft_volumesegment(cfg, mri); segmentedmri.transform = mri.transform; segmentedmri.anatomy   = mri.anatomy; %load template sourcemodel template = load('C:\Program Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); % compute source model cfg                = []; cfg.grid.warpmni   = 'yes'; cfg.grid.template  = template.sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri            = mri; sourcemodel        = ft_prepare_sourcemodel(cfg); % make headmodel cfg        = []; cfg.method = 'openmeeg'; hdm        = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); % lead field cfg                 = []; cfg.grid            = sourcemodel; cfg.elec            = elec; cfg.vol             = vol; cfg.channel = 'all'; cfg.normalize = 'yes';       % normalize instead of contrasting to noise estimate [grid] = ft_prepare_leadfield(cfg,freqPost); %% Source Analysis cfg              = []; cfg.elec         = elec; cfg.method       = 'dics'; cfg.frequency    = freqPost.freq;  cfg.grid         = grid; cfg.vol          = vol; cfg.keeptrials        = 'yes'; cfg.dics.lambda       = '10%'; cfg.dics.keepfilter   = 'yes'; cfg.dics.fixedori     = 'yes'; cfg.dics.realfilter   = 'yes'; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); cfg              = []; cfg.voxelcoord   = 'no'; cfg.parameter    = 'avg.pow'; cfg.interpmethod = 'nearest'; sourcePostInt_nocon  = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); % plot cfg              = []; cfg.method       = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; % cfg.funcolorlim   = [0.0 0.08]; % cfg.opacitylim    = [0.0 0.2]; cfg.opacitymap    = 'rampup'; ft_sourceplot(cfg,sourcePostInt_nocon); --- University of Zürich Maurice Göldi Department of Psychology Biopsychology Binzmühlestr. 14 / Box 5 CH - 8050 Z�rich Tel. +41 (0)44 635 74 55 www.psychologie.uzh.ch maurice.goeldi at uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Oct 3 11:25:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 03 Oct 2014 11:25:24 +0200 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> Message-ID: <542E6B84.2000106@donders.ru.nl> Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Fri Oct 3 11:27:15 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 3 Oct 2014 11:27:15 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: Hi Maurice, Having not read your post fully, the first thing that comes to mind is: are the units all in agreement for the geometric objects? I see you explicitly convert the headmodel to cm. You can apply the same function also to your source model, leadfield (probably redundant but can't hurt), and sensor definition. Does that help? Best, Eelke On 3 October 2014 11:02, wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, but > my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect atleast > some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the fringes of > my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at the > fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where my > error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities are, > but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact rejection > was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft (20141002) > to see if it was a version issue. > It turns out that all the template files I had been using from my previous > install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the result > is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation 3.dat'; > % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matt.craddock at uni-leipzig.de Fri Oct 3 12:11:29 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Fri, 03 Oct 2014 11:11:29 +0100 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: <542E7651.1040105@uni-leipzig.de> Hi Maurice, I think the problem is here: > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate Although the tutorial page says normalizing is an alternative to contrasting the noise estimate (http://fieldtrip.fcdonders.nl/tutorial/beamformer), it isn't - perhaps it should be, I don't know, but it doesn't make any difference currently as far as I can tell. Perhaps it does with MEG data. You'll get much more sensible results if you contrast against a noise estimate or another condition. So for example, try adding cfg.dics.projectnoise = 'yes'; when doing the source analysis step and looking at the NAI. You might also want to make sure the leadfield is generated using an alphabetical channel order if the channels in your data are not alphabetically ordered - see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 Cheers, Matt On 03/10/2014 10:02, m.goeldi at psychologie.uzh.ch wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, > but my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect > atleast some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the > fringes of my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at > the fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where > my error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities > are, but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact > rejection was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft > (20141002) to see if it was a version issue. > It turns out that all the template files I had been using from my > previous install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the > result is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation > 3.dat'; % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dr. Matt Craddock From diezmartini at gmail.com Sun Oct 5 22:34:35 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 5 Oct 2014 10:34:35 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <542C09BA.4020501@donders.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> <542C09BA.4020501@donders.ru.nl> Message-ID: Hi Jorn and all, As I said before, everything works ok when I use ft_trialfun_general instead of this trialfun. However, it is crucial for me to transform the event values with that trialfun. And now I use 'trigger' instead of 'STATUS' but it doesn't change much. Any other idea? THANK YOU! This is my script again: % CONGRUENT TRIALS DEFINITION cfg = [ ] ; cfg.dataset = 'location'; event = ft_read_event('location'); cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialfun = 'trialfun_bit2dec'; [cfg] = ft_definetrial(cfg); On Wed, Oct 1, 2014 at 4:03 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Ana, > > from the first call with eventtype = '?', the output says > >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> > > This means that there is one event type in our data, namely 'trigger', and > the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. > FieldTrip works that way that it passes on the cfg.trialdef structure to > the trialfun that is specified. In your particular case, trialfun_bit2dec > does not seem to have a very user-friendly error message, but the error > message means that whatever eventtype and eventvalues you asked for, they > are not present in your data. When looking at what you define, you can > probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. > However, checking back the output that you created with '?', there is no > event type 'STATUS' in your data. Therefore, everything works fine with > your trialfun. If you try specifying the trialdef properly, everything > should work fine. > > A general advise when using an own trial fun and getting an error message: > Try your code without specifying cfg.trialfun first. Then FieldTrip will > use the standard trialfun, which should work if all your cfg-settings are > fine. If the standard trialfun runs without errors, then your trialfun > should do so too. If your trialfun, however, then crashes, the error is > most likely in the trialfun that you used, and not in the cfg-settings. In > your case, however, I am fairly certain that the cfg-settings you specified > were causing your problem. > > I hope this helps. > Best, > Jörn > > > > > On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > >> For a more simple check, when I try to read the events without the >> trialfun ( so it uses ft_trialfun_general by default) I get the original >> event values: >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> >> Warning: no trialfun was specified, using ft_trialfun_general >> > In ft_definetrial at 135 >> evaluating trialfunction 'ft_trialfun_general' >> reading the events from '27CW1.RAW' >> the following events were found in the datafile >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> no trials have been defined yet, see FT_DEFINETRIAL for further help >> found 750 events >> created 0 trials >> the call to "ft_definetrial" took 4 seconds >> >> Then I try to use the trialfun, I get the same error >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialfun = 'trialfun_bit2dec'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> evaluating trialfunction 'trialfun_bit2dec' >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> So there is something the trialfun_bit2dec does that events cannot be >> read anymore. >> >> >> On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > a.stolk8 at gmail.com>> wrote: >> >> Hi Ana Laura, >> >> Your 'trl' is empty, which it shouldn't be. So anytime you try to >> index an element in it, it will throw an error. >> >> Can you check what 'event.values' you find in your dataset? And >> compare those with any of the ones falling under the switch case >> statement? One way to do this, is to put a debug marker (red dot) >> at the 'end' of the first for-loop (judging from the wiki). Then >> check the value of event(i).value, and click the continue button >> to move on to the next. An alternative way is to put a debug >> marker after event = ft_read_event and to instantly check all >> values of event with "[event(:).value]". >> >> Goodluck, >> Arjen >> >> 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini >> >: >> >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini >> > wrote: >> >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = >> 'saveonerror' and matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read >> them with the raw data, they seem to be there, with the >> DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk >> > wrote: >> >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]." >> >> that none of the triggers were found in your event >> data. You might wanna check why this is happening, by >> debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >> >> >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I >> followed your advice and I changed definetrial to >> ft_definetrial and I confirm the function was >> added to my paths. After doing this, the error I >> get is: >> >> Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I >> think I added what I think are useless lines but I >> was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun >> definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus >> triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my >> analysis because I would like to use only >> Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> > > wrote: >> >> Hi again Ana Laura, >> >> One other thing that I thought of was to make >> sure that the function "trialfun_bit2dec" is >> added to your paths in matlab, so that >> ft_definetrial can find this function. >> >> By updating your fieldtrip to the most recent >> version "trialfun_bit2dec" is *not* included. >> So you'll need to store that as a separate .m >> file in a location that can be accessed by the >> paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > > >> > To: "FieldTrip discussion list" >> > > >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a >> trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this >> is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use >> an old version of >> > Fieldtrip for my scripts because I wrote >> them long ago and this >> > trialfun uses the new format (with >> 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, >> Nietzsche < >> > n.lam at fcdonders.ru.nl >> > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which >> trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > >> http://fieldtrip.fcdonders.nl/ >> tutorial/preprocessing >> under "do the >> > trial definition for the fully incongruent >> (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = >> 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see >> below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% >> trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error >> message, it seemed that the >> > problem was in the function >> trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called >> this function. I was >> > wondering if the code you provide >> corresponded to the code that >> > created your error message? I'm guessing you >> ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not >> via definetrial). In which >> > case, it was looking for >> cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the >> relevant information in >> > the cfg (which is in the code you showed >> us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < >> diezmartini at gmail.com >> > >> > > To: "FieldTrip discussion list" < >> fieldtrip at science.ru.nl >> > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I >> want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/ >> faq/how_can_i_transform_trigger_values_from_bits_to_ >> decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, >> cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not >> writing it in the correct part >> > > of >> > > my script. This is my trial definition >> part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, >> '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, >> '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > >> _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> >> > > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > -- >> > Nietzsche H.L. Lam, MSc >> > PhD Candidate >> > >> > Max Planck Institute for Psycholinguistics >> > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> > >> > Donders Institute for Brain, Cognition and >> Behaviour, >> > Centre for Cognitive Neuroimaging, >> > Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> > >> > n.lam at fcdonders.ru.nl >> >> > +31-24-3668219 >> > >> > >> > neurobiologyoflanguage.com >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> -- >> Nietzsche H.L. Lam, MSc >> PhD Candidate >> >> Max Planck Institute for Psycholinguistics >> Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> >> Donders Institute for Brain, Cognition and >> Behaviour, >> Centre for Cognitive Neuroimaging, >> Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> >> n.lam at fcdonders.ru.nl >> >> +31-24-3668219 >> >> >> neurobiologyoflanguage.com >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 09:16:45 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 09:16:45 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Message-ID: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 11:46:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 11:46:55 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser In-Reply-To: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> References: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Message-ID: <021c01cfe14a$76c18fe0$6444afa0$@vanpelt@fcdonders.ru.nl> For everyone's information, I have found a solution based on a post some 4 years ago related to ft_resampledata (http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003095.ht ml). To make the ICA and artifact data align, the trl-field of the ICA-data needs to be 'resampled', as well as the artifact-samples: % i. Downsample data resamplefs = 150; cfg = []; cfg.resamplefs = resamplefs; cfg.detrend = 'no'; data150 = ft_resampledata(cfg, data); % 'Downsample' trial information to make trial start/end samplenrs correspond to artifact samplenrs data150.cfg.previous.trl(:,1:3) = round(data150.cfg.previous.trl(:,1:3) * (1/fs) * resamplefs); % ii. run ICA on downsampled data cfg = []; cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB cfg.channel = 'MEG'; cfg.runica.maxsteps = 120; eval(['comp150',num2str(n),'= ft_componentanalysis(cfg, data150);']); % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=ceil(art_eog_all*(resamplefs/fs)); % 'resample' artifact data cfg.artfctdef.muscle.artifact=ceil(art_muscle_all*(resamplefs/fs)); % 'resample' artifact data % visual inspection ft_databrowser(cfg, comp150',num2str(n),'); % 'Upsample' trial information again to original data150.cfg.previous.trl(:,1:3) = data.cfg.trl(:,1:3); Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Stan van Pelt Sent: maandag 6 oktober 2014 9:17 To: 'FieldTrip discussion list' Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Mon Oct 6 15:17:04 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Mon, 6 Oct 2014 13:17:04 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <542E6B84.2000106@donders.ru.nl> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... >> compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From giulia.rizza at tiscali.it Mon Oct 6 17:47:50 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Mon, 06 Oct 2014 17:47:50 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS Message-ID: <78737852a684659ce9b485523d53b552@tiscali.it> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed, as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Thank you so much for any help Giulia Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at fcdonders.ru.nl Mon Oct 6 17:56:36 2014 From: robert.oostenveld at fcdonders.ru.nl (Oostenveld, R. (Robert)) Date: Mon, 6 Oct 2014 15:56:36 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Message-ID: Hi Beth, The buffer.mexw64 file is present in the fieldtrip release. I suspect your initial problem is that a DLL is not being found, i.e. MATLAB loads the mex file as a dynamic link library (dll), and in that process there are some other dlls that also have to be loaded. You could diagnose this further with http://www.dependencywalker.com and the solution might be as simple as getting the correct MSVC dll (which is installed by default on some Windows versions, but not on others). Recompiling the buffer mex file on windows (esp 64) bit is not trivial, but you can find some hints onhttp://fieldtrip.fcdonders.nl/development/realtime/reference_implementation#compiling_the_code best Robert On 06 Oct 2014, at 15:17, Elizabeth Anne Bock, Ms > wrote: Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From cas243 at georgetown.edu Mon Oct 6 20:19:11 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Mon, 6 Oct 2014 14:19:11 -0400 Subject: [FieldTrip] grand average with dimord chan_chan_freq_time Message-ID: Dear FieldTrip Community, What's the best strategy for generating grand averages when data have dimord chan_chan_freq_time (output of ft_connectivityanalysis for method granger)? It appears that chan_chan_freq_time is an unsupported dimord in ft_freqgrandaverage. Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Oct 7 15:42:53 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Tue, 07 Oct 2014 15:42:53 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions Message-ID: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Dear fieldtripers, I would like to compare to conditions of an auditory oddball paradigm (target tones and standard tones). For the identification of the electrodes which show the biggest P300, I would like to use cluster based permutation test, i.e. I want to use ft_timelockstatistics, to identify the clusters with a significant difference between the target and the standardtones. Important: I don't want to do a group statistic, but I want to compare these two conditions within each subject, to identify interesting clusters for each subject separately. I wrote the script following the tutorials on the fieldtrip homepage. I already wrote a code but it does not work: %% for i = 3:10 % subject number mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' cd(mypfad) cd Kontrollen; List = dir cd (List(i).name); for j = 1:4 %session number cd (mypfad); cd Kontrollen; List = dir cd (List(i).name); eval(['cd M' num2str(j)]); load cleandata_tlt; %preprocessed timelocked data standardclean_tlt and targetclean_tlt cfg = [] cfg.neighbourdist = .09; cfg.layout= ulmegilay; cfg.method = 'distance'; Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) cfg = [] cfg.method = 'montecarlo' ; %significance probability cfg.statistic = 'ft_statfun_depsamplesT' cfg.correctm = 'cluster' cfg.clusteralpha = 0.05 %alpha level of the sample specific test statistic that will % be used for thresholding cfg.clusterstatistic = 'maxsum' cfg.minnbchan = 4 cfg.latency = [0.25 0.8] cfg.neighbours = Neighbours cfg.tail = 0 cfg.clustertail = 0 cfg.alpha = 0.025 cfg.numrandomization = 1000 design = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)]) cfg.design = design cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]' cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)] tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, standardclean_tlt ) cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; cd Kontrollen; List2 = dir cd (List2(i).name); eval(['cd M' num2str(j)]); save statnew tlt_statsnew end end This is what gets displayed while running the script: selected 245 channels selected 139 time bins selected 1 frequency bins using "ft_statistics_montecarlo" for the statistical testing using "ft_statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 189 total number of variables = 1 number of independent variables = 189 number of unit variables = 189 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach Then, this error occurs: Error using resampledesign (line 168) A within-units shuffling requires a at least one unit variable and at least one independent variable Error in ft_statistics_montecarlo (line 241) resample = resampledesign(cfg, design); Error in statistics_wrapper (line 310) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_timelockstatistics (line 113) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I have no clue where I made a mistake. I have unit variables and independent variables (189 if I understand it correctly). Is there anything I am missing? Any additional information or is the design matrix wrong? I really appreciate your help. Best regards, Barbara Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Tue Oct 7 15:55:36 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Tue, 7 Oct 2014 09:55:36 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions In-Reply-To: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> References: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Message-ID: Dear Barbara, Just three thoughts: 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension of the design matrix that contains the independent and unit variables? Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the design matrix). 2) I think the design matrix itself might be off, right now it just seems to have dimensions of 1 x (# targets+standards). It should have a second dimension which counts the # of trials, something like: design(1,:) = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial ,1)]) 3) Since this is a design where each trial is an observation, I think you should be using indepsamplesT for cfg.statistic (the trials aren't paired and there aren't necessarily identical #'s of trials for each condition. What do you think? Respectfully, Clara On Tue, Oct 7, 2014 at 9:42 AM, wrote: > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, I > would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting clusters > for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific test > statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 7 21:07:37 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 7 Oct 2014 21:07:37 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: <78737852a684659ce9b485523d53b552@tiscali.it> References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Giulia, > Dear Fieldtrippers > I'm writing to ask you some help on data in a single subject study. > I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. > I'm not sure how to proceed What you are referring to is a “between trial experiment” which is described in this tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq One possible way to go is to compute the TFR’s with cfg.keeptrials = ‘yes’. Next you’d treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Also please type “actvsblT” in the search bar and then click on “Search the FieldTrip mailing list”. There you’ll find some info about this. best tzvetan From giulia.rizza at tiscali.it Wed Oct 8 10:45:23 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Wed, 08 Oct 2014 10:45:23 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Tzvetan Thank you so much for your reply I will try these functions keeping in mind your explanation Best regards Giulia Il 07.10.2014 21:07 Tzvetan Popov ha scritto: > Hi Giulia, > >> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed > > What you are referring to is a "between trial experiment" which is described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] > One possible way to go is to compute the TFR's with cfg.keeptrials = 'yes'. Next you'd treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html [2] > >> , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. > > Also please type "actvsblT" in the search bar and then click on "Search the FieldTrip mailing list". There you'll find some info about this. > > best > tzvetan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl [3] > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Oct 8 13:31:46 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 08 Oct 2014 13:31:46 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: References: Message-ID: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Dear Clara, thank you for your comments. I ran it as an independent samples Test (it is true, that this is the correct way). I also changed the design matrix to cfg.design = [ones(1,size(targetclean_tlt.trial,1)) 2*ones(1,size(standardclean_tlt.trial,1))] It works and there are no more error messages. However, when it displays the progress of the calculation there is the field: total number of observations, total number of variables and number of independent variables. It recognizes correctly that there are 185 trials in total (both conditions together). But it only counts 1 variable and 1 independent variable. Shouldn't it recognize 2 variables as I have 2 conditions? Best regards, Barbara Zitat von fieldtrip-request at science.ru.nl: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Problem with ft_timelockstatistics, within subject comparison > of two conditions (barbara.schorr at uni-ulm.de) > 2. Re: Problem with ft_timelockstatistics, within subject > comparison of two conditions (Clara A. Scholl) > 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) > 4. Re: help for statistics on ERD/ERS (Giuly) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 07 Oct 2014 15:42:53 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, > I would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting > clusters for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific > test statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > Message: 2 > Date: Tue, 7 Oct 2014 09:55:36 -0400 > From: "Clara A. Scholl" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Barbara, > > Just three thoughts: > > 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension > of the design matrix that contains the independent and unit variables? > Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the > design matrix). > > 2) I think the design matrix itself might be off, right now it just seems > to have dimensions of 1 x (# targets+standards). It should have a second > dimension which counts the # of trials, something like: > > design(1,:) = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial > ,1)]) > > 3) Since this is a design where each trial is an observation, I think you > should be using indepsamplesT for cfg.statistic (the trials aren't paired > and there aren't necessarily identical #'s of trials for each condition. > > What do you think? > Respectfully, > Clara > > > On Tue, Oct 7, 2014 at 9:42 AM, wrote: > >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, I >> would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting clusters >> for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >> statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 7 Oct 2014 21:07:37 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Hi Giulia, > > >> Dear Fieldtrippers >> I'm writing to ask you some help on data in a single subject study. >> I did a time frequency decomposition and I would like to do a >> statistic to state whether the average TFR has significant ERD/ERS >> or not. >> I'm not sure how to proceed > What you are referring to is a ?between trial experiment? which is > described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > One possible way to go is to compute the TFR?s with cfg.keeptrials = > ?yes?. Next you?d treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you > can compute the statistical comparison in a similar fashion as > described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. > Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> , as a first step I compared the single trial baseline with the >> respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it >> is the correct way. > Also please type ?actvsblT? in the search bar and then click on > ?Search the FieldTrip mailing list?. There you?ll find some info > about this. > > best > tzvetan > > > > > ------------------------------ > > Message: 4 > Date: Wed, 08 Oct 2014 10:45:23 +0200 > From: Giuly > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Tzvetan > Thank you so much for your reply > I will try these > functions keeping in mind your explanation > Best regards > Giulia > > Il > 07.10.2014 21:07 Tzvetan Popov ha scritto: > >> Hi Giulia, >> >>> Dear > Fieldtrippers I'm writing to ask you some help on data in a single > subject study. I did a time frequency decomposition and I would like to > do a statistic to state whether the average TFR has significant ERD/ERS > or not. I'm not sure how to proceed >> >> What you are referring to is a > "between trial experiment" which is described in this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> > One possible way to go is to compute the TFR's with cfg.keeptrials = > 'yes'. Next you'd treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you can > compute the statistical comparison in a similar fashion as described in > the tutorial. >> Keep in mind that you have to cut the data into equal > lengths. Please have a look at this post : >> > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > [2] >> >>> , as a first step I compared the single trial baseline with > the respective event, with a t-test for each condition and band of > interest but I'm not really sure if this is enough and anyway if it is > the correct way. >> >> Also please type "actvsblT" in the search bar and > then click on "Search the FieldTrip mailing list". There you'll find > some info about this. >> >> best >> tzvetan >> >> > _______________________________________________ >> fieldtrip mailing > list >> fieldtrip at donders.ru.nl [3] >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] > > > > > Scopri istella, il nuovo motore per il web italiano. > Istella garantisce risultati di qualit? e la possibilit? di > condividere, in modo semplice e veloce, documenti, immagini, audio e > video. > Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Oct 8 17:21:12 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 8 Oct 2014 11:21:12 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> References: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Message-ID: Dear Barbara, I think you are right, the clustering output should report total number of variables=2 (and the total # of measurements = 185 trials, number of independent variables=1, and number of unit variables=1). I think your design matrix should have two rows, rather than 1. For example, if you had 5 trials total (2 of 1 trial type, 3 of the other trial type), you'd specify the design matrix: 1 2 3 1 2 1 1 1 2 2 Where cfg.uvar=1 and cfg.ivar=2. Row two is what you are specifying for design currently. Row 1 counts the observations of each trials (1:numTrialType1 1:numTrialType2). Does that help? Respectfully, Clara On Wed, Oct 8, 2014 at 7:31 AM, wrote: > Dear Clara, > > thank you for your comments. > > I ran it as an independent samples Test (it is true, that this is the > correct way). > I also changed the design matrix to > cfg.design = [ones(1,size(targetclean_tlt.trial,1)) > 2*ones(1,size(standardclean_tlt.trial,1))] > > It works and there are no more error messages. However, when it displays > the progress of the calculation there is the field: total number of > observations, total number of variables and number of independent > variables. It recognizes correctly that there are 185 trials in total (both > conditions together). But it only counts 1 variable and 1 independent > variable. Shouldn't it recognize 2 variables as I have 2 conditions? > > Best regards, > Barbara > > > Zitat von fieldtrip-request at science.ru.nl: > > Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Problem with ft_timelockstatistics, within subject comparison >> of two conditions (barbara.schorr at uni-ulm.de) >> 2. Re: Problem with ft_timelockstatistics, within subject >> comparison of two conditions (Clara A. Scholl) >> 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) >> 4. Re: help for statistics on ERD/ERS (Giuly) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 07 Oct 2014 15:42:53 +0200 >> From: barbara.schorr at uni-ulm.de >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> >> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; >> format="flowed" >> >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, >> I would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting >> clusters for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific >> test statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at >> least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 7 Oct 2014 09:55:36 -0400 >> From: "Clara A. Scholl" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: >> > gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> Dear Barbara, >> >> Just three thoughts: >> >> 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension >> of the design matrix that contains the independent and unit variables? >> Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the >> design matrix). >> >> 2) I think the design matrix itself might be off, right now it just seems >> to have dimensions of 1 x (# targets+standards). It should have a second >> dimension which counts the # of trials, something like: >> >> design(1,:) = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design(2,:)= ([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial >> ,1)]) >> >> 3) Since this is a design where each trial is an observation, I think you >> should be using indepsamplesT for cfg.statistic (the trials aren't paired >> and there aren't necessarily identical #'s of trials for each condition. >> >> What do you think? >> Respectfully, >> Clara >> >> >> On Tue, Oct 7, 2014 at 9:42 AM, wrote: >> >> Dear fieldtripers, >>> >>> I would like to compare to conditions of an auditory oddball paradigm >>> (target tones and standard tones). >>> For the identification of the electrodes which show the biggest P300, I >>> would like to use cluster based permutation test, i.e. I want to use >>> ft_timelockstatistics, to identify the clusters with a significant >>> difference between the target and the standardtones. >>> Important: I don't want to do a group statistic, but I want to compare >>> these two conditions within each subject, to identify interesting >>> clusters >>> for each subject separately. >>> >>> >>> I wrote the script following the tutorials on the fieldtrip homepage. >>> >>> I already wrote a code but it does not work: >>> %% >>> >>> for i = 3:10 % subject number >>> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >>> cd(mypfad) >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> for j = 1:4 %session number >>> cd (mypfad); >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> eval(['cd M' num2str(j)]); >>> load cleandata_tlt; %preprocessed timelocked data >>> standardclean_tlt and targetclean_tlt >>> >>> cfg = [] >>> cfg.neighbourdist = .09; >>> cfg.layout= ulmegilay; >>> cfg.method = 'distance'; >>> >>> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >>> >>> cfg = [] >>> cfg.method = 'montecarlo' ; %significance probability >>> cfg.statistic = 'ft_statfun_depsamplesT' >>> cfg.correctm = 'cluster' >>> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >>> statistic that will >>> % be used for thresholding >>> cfg.clusterstatistic = 'maxsum' >>> cfg.minnbchan = 4 >>> cfg.latency = [0.25 0.8] >>> cfg.neighbours = Neighbours >>> cfg.tail = 0 >>> cfg.clustertail = 0 >>> cfg.alpha = 0.025 >>> cfg.numrandomization = 1000 >>> >>> design = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]'; >>> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >>> trial,1)]) >>> >>> >>> cfg.design = design >>> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]' >>> cfg.uvar = [1:size(targetclean_tlt.trial) >>> 1:size(standardclean_tlt. >>> trial,1)] >>> >>> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >>> standardclean_tlt ) >>> >>> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >>> cd Kontrollen; >>> List2 = dir >>> cd (List2(i).name); >>> eval(['cd M' num2str(j)]); >>> save statnew tlt_statsnew >>> >>> end >>> end >>> >>> >>> This is what gets displayed while running the script: >>> >>> selected 245 channels >>> selected 139 time bins >>> selected 1 frequency bins >>> using "ft_statistics_montecarlo" for the statistical testing >>> using "ft_statfun_depsamplesT" for the single-sample statistics >>> constructing randomized design >>> total number of measurements = 189 >>> total number of variables = 1 >>> number of independent variables = 189 >>> number of unit variables = 189 >>> number of within-cell variables = 0 >>> number of control variables = 0 >>> using a permutation resampling approach >>> >>> Then, this error occurs: >>> >>> Error using resampledesign (line 168) >>> A within-units shuffling requires a at least one unit variable and at >>> least >>> one independent variable >>> >>> Error in ft_statistics_montecarlo (line 241) >>> resample = resampledesign(cfg, design); >>> >>> Error in statistics_wrapper (line 310) >>> [stat, cfg] = statmethod(cfg, dat, design); >>> >>> Error in ft_timelockstatistics (line 113) >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> I have no clue where I made a mistake. I have unit variables and >>> independent variables (189 if I understand it correctly). >>> Is there anything I am missing? Any additional information or is the >>> design matrix wrong? >>> >>> >>> I really appreciate your help. >>> >>> Best regards, >>> Barbara >>> >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141007/64be64b4/attachment-0001.html> >> >> ------------------------------ >> >> Message: 3 >> Date: Tue, 7 Oct 2014 21:07:37 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset=windows-1252 >> >> Hi Giulia, >> >> >> Dear Fieldtrippers >>> I'm writing to ask you some help on data in a single subject study. >>> I did a time frequency decomposition and I would like to do a statistic >>> to state whether the average TFR has significant ERD/ERS or not. >>> I'm not sure how to proceed >>> >> What you are referring to is a ?between trial experiment? which is >> described in this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> One possible way to go is to compute the TFR?s with cfg.keeptrials = >> ?yes?. Next you?d treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> Keep in mind that you have to cut the data into equal lengths. Please >> have a look at this post : >> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> >>> , as a first step I compared the single trial baseline with the >>> respective event, with a t-test for each condition and band of interest >>> but I'm not really sure if this is enough and anyway if it is the correct >>> way. >>> >> Also please type ?actvsblT? in the search bar and then click on ?Search >> the FieldTrip mailing list?. There you?ll find some info about this. >> >> best >> tzvetan >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 08 Oct 2014 10:45:23 +0200 >> From: Giuly >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Tzvetan >> Thank you so much for your reply >> I will try these >> functions keeping in mind your explanation >> Best regards >> Giulia >> >> Il >> 07.10.2014 21:07 Tzvetan Popov ha scritto: >> >> Hi Giulia, >>> >>> Dear >>>> >>> Fieldtrippers I'm writing to ask you some help on data in a single >> subject study. I did a time frequency decomposition and I would like to >> do a statistic to state whether the average TFR has significant ERD/ERS >> or not. I'm not sure how to proceed >> >>> >>> What you are referring to is a >>> >> "between trial experiment" which is described in this tutorial: >> >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> >>> >>> One possible way to go is to compute the TFR's with cfg.keeptrials = >> 'yes'. Next you'd treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> >>> Keep in mind that you have to cut the data into equal >>> >> lengths. Please have a look at this post : >> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> [2] >> >>> >>> , as a first step I compared the single trial baseline with >>>> >>> the respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it is >> the correct way. >> >>> >>> Also please type "actvsblT" in the search bar and >>> >> then click on "Search the FieldTrip mailing list". There you'll find >> some info about this. >> >>> >>> best >>> tzvetan >>> >>> >>> _______________________________________________ >> >>> fieldtrip mailing >>> >> list >> >>> fieldtrip at donders.ru.nl [3] >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] >> >> >> >> >> Scopri istella, il nuovo motore per il web italiano. >> Istella garantisce risultati di qualit? e la possibilit? di condividere, >> in modo semplice e veloce, documenti, immagini, audio e video. >> Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141008/ff2ad283/attachment-0001.html> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 47, Issue 6 >> **************************************** >> >> > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 11:51:45 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 11:51:45 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size Message-ID: <54365AB1.8040507@uni-tuebingen.de> Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: surfaceplot before 7mb after 220mb.jpg Type: image/jpeg Size: 156292 bytes Desc: not available URL: From dao4free at gmail.com Thu Oct 9 12:19:19 2014 From: dao4free at gmail.com (Pavel Goldstein) Date: Thu, 9 Oct 2014 13:19:19 +0300 Subject: [FieldTrip] Dealing with artifacts in continuous EEG data before Granger Causality analysis Message-ID: Dear FieldTrip list, I'm planning to apply Granger Causality (GC) models to my continuous EEG data, but I'm not sure about the preprocessing steps. I have read an article about filtering EEG data before GC analysis, but still it is not clear for me how to deal with removing some data segments with strong artifacts. Right now I'm planning to clean the data (2-minutes trials) by removing the artifacts using visual detection (+filtering notch+detrending) followed by GC analysis using 2 sec. windows (actually the final length of the windows should be identified by VAR model) . Using such preprocessing approach I would receive continuous data with "gaps" therefore some 2-sec segments may consist of the mixed data before and after the removed part. Such situations seem to me not appropriate for GC analysis. As a possible solutions I thought about 1) removing these mixed segments or 2) Dividing raw data (before artifacts rejection) on 2-sec segments and to remove completely such segments that will contain an artifact. Do I miss something? I would appreciate your advice on this matter. Thanks, Pavel -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Thu Oct 9 13:46:57 2014 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Thu, 9 Oct 2014 13:46:57 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" < jens.klinzing at uni-tuebingen.de>: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 18:32:07 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 18:32:07 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: <5436B887.9090305@uni-tuebingen.de> Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite > large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen > cases in which the size went from 13 GB to 150 MB just by clearing the > cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" > >: > > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies > to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same > but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer > ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my > ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the > renderer. > > I am sure it is something very simple and I'm just too blind to > see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Oct 9 19:06:15 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 9 Oct 2014 17:06:15 +0000 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: <5436B887.9090305@uni-tuebingen.de> References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: Hi Jens, It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. Best, Arjen -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] Sent: Thursday, October 09, 2014 6:32 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jens.klinzing at uni-tuebingen.de Thu Oct 9 19:44:18 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 19:44:18 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: <5436C972.1070709@uni-tuebingen.de> Hi Arjen, that's good news! Thanks for your help, Jens Am 09.10.2014 19:06, schrieb Stolk, A. (Arjen): > Hi Jens, > > It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. > > Best, > Arjen > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > ________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] > Sent: Thursday, October 09, 2014 6:32 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size > > Hi Erik, > wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). > > I still have a brain with a very dark color, though. Does anyone know how to get rid of that? > Why would these things change without an obvious reason? > > Thanks for your help, Eric!! > All the best, > Jens > > Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From N.Jain at tudelft.nl Fri Oct 10 14:10:30 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 10 Oct 2014 12:10:30 +0000 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DEE96@SRV384.tudelft.net> Hi Ricarda, I’m currently using .bdf files. EXG is for external signals like eye blinks or even EMG. You want to ideally remove the really bad channels from your signals first, then re-reference them to all electrodes (common average rereferencing). The really high vertical scale you’re seeing is due to digital trigger signals, I think. Just get rid of EXG, GSR etc electrodes, keep only the EEG electrodes. Then proceed with channel/trial rejection! Best of luck, Nishant Jain. TU Delft, Netherlands. From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: dinsdag 23 september 2014 16:34 To: FieldTrip discussion list Subject: Re: [FieldTrip] Reading in .bdf files Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann > wrote: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Sat Oct 11 03:58:49 2014 From: zriouil.imane at gmail.com (ZRIOUIL Imane) Date: Sat, 11 Oct 2014 01:58:49 +0000 Subject: [FieldTrip] Convert data .txt to .BDF? Message-ID: <4EA73B63-41EE-48E4-BA14-A9E7A89B3D61@gmail.com> Hello, Please, i want to convert my data with extension .txt to . BDF. Anyone have any idea Thank you From eelke.spaak at donders.ru.nl Sat Oct 11 11:40:05 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 11 Oct 2014 11:40:05 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Hi Katrin, The first *3* (not just 2) columns of the trl-matrix are special, they define the start and end sample of the trial, and the offset. Right now you are not storing the offset in the output of your trialfun. Instead, you put the RT in the third column. Since there are no columns 4 and above, no trialinfo is created (plus your time axes will likely be wrong as the RT is now interpreted as offset by FieldTrip). Change the relevant line to the following: newtrl = [trlbegin trlend offset RT]; and you should get a proper trialinfo. Best, Eelke On 2 October 2014 21:53, KatrinH Heimann wrote: > Dear Anne, dear all, > > I did try to create a customized trialfunction serving my needs. > This is what I came up with: > > function [trl, event] = response_trialfun(cfg); > > > > % read the header information and the events from the data > > hdr = ft_read_header(cfg.dataset); > > event = ft_read_event(cfg.dataset); > > > > > > % search for "trigger" events > > value = [event(find(strcmp('ceck', {event.value}))).value]'; > > sample = [event(find(strcmp('ceck', {event.value}))).sample]'; > > > > % search for "trigger" events > > value2 = [event(find(strcmp('resp', {event.value}))).value]'; > > sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; > > > > % determine the number of samples before and after the trigger > > pretrig = -round(cfg.trialdef.prestim * hdr.Fs); > > posttrig = round(cfg.trialdef.poststim * hdr.Fs); > > > > % look for the combination of a trigger "7" followed by a trigger "64" > > % for each trigger except the last one > > trl = []; > > > > trlbegin = sample + pretrig > > trlend = sample + posttrig > > offset = pretrig > > RT = sample2 - sample > > newtrl = [trlbegin trlend RT]; > > trl = [trl; newtrl]; > > > > end > > > > In fact it seems to work, the trials look good and the RT is computed > correctly. Only that after the preprocessing (with ft_preprocessing: > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-0.1 0] > > > > mov_data = ft_preprocessing(cfg); > > % > > ) there is no mov_data.trialinfo created. I thought that the information in > trl above would be saved there. Without those I am not able to do the > redefinition as planned (like Anne proposed: > > > > > offset = (mov_data.trialinfo(:,3)); > > prestim = 0.75; > > poststim = 0.75; > > > > cfg = []; > > cfg.begsample = round(offset - prestim*data.fsample); > > cfg.endsample = round(offset + poststim*data.fsample); > > mov_data_small = ft_redefinetrial(cfg, mov_data); > > > > % then shift the time axis > > cfg = []; > > cfg.offset = -offset; > > mov_data_small = ft_redefinetrial(cfg, move_data_small); > > > > > How come the information is not stored? Somebody an idea? > > Thanks a million > > Katrin > > > 2014-09-28 18:35 GMT+02:00 Anne Urai : >> >> Dear Katrin, >> >> if you use a custom trialfun >> (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) >> you can code the time between stimulus onset and response in an additional >> column. That way, you can shift the time axis of the data by this amount on >> each trial. For example: >> >> % redefine trials >> offset = (data.trialinfo(:,RTcol)); >> prestim = 1; >> poststim = 2; >> >> >> >> cfg = []; >> cfg.begsample = round(offset - prestim*data.fsample); >> cfg.endsample = round(offset + poststim*data.fsample); >> data = ft_redefinetrial(cfg, data); >> >> >> >> % then shift the time axis >> cfg = []; >> cfg.offset = -offset; >> data = ft_redefinetrial(cfg, data); >> >> % timelock >> cfg = []; >> cfg.keeptrials = 'yes'; >> data = ft_timelockanalysis(cfg, data); >> >> That way, your new data structure will now be response locked. Note that >> the timelockanalysis is optional, and only works when you have trials that >> are all the same length. >> >> If you do not want to use a custom trialfun, you could also rerun the same >> analysis as you have for the stimulus-locked data, but then taking the >> response code as your eventvalue. >> >> Good luck, >> >> --- >> Anne E. Urai, MSc >> PhD student | Institut für Neurophysiologie und Pathophysiologie | >> Universitätsklinikum Hamburg-Eppendorf >> Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com >> >> >> >> >> >> On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: >> >> Dear all, >> I know I asked this already twice, but I did not get the right answer yet >> and just cannot figure it out myself. >> So, I did cut my data in quite large trials using ft_define trial and >> logging it to the beginning of a slide. >> >> cfg = []; >> cfg.dataset = name; >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger >> cfg.trialdef.prestim = 0.216; % in seconds >> cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) >> cfg = ft_definetrial(cfg); >> >> >> >> % cancel out training trials >> cfg.trl([1:4],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> %structure trial - plus delay reported by EGE = 18 ms = 9 samples >> cfg.trl(:,3)=cfg.trl(:,3)-17 >> >> >> >> >> >> >> Then I preprocessed these trials >> >> %% preprocess data >> cfg.channel = 'all'; >> cfg.preproc.detrend = 'yes'; >> cfg.preproc.demean = 'yes'; >> cfg.preproc.baselinewindow = [-0.1 0] >> % >> mov_data = ft_preprocessing(cfg); >> % >> save (strcat(sb,'mov_data') , 'mov_data') >> >> >> >> >> Now I wanna cut out smaller pieces that are centered around another >> trigger - the response of the subject. I did not use this trigger at the >> beginning as then defining a baselinewindow is impossible (as the response >> is always happening at a different time). >> >> I tried to just use ft_definetrial again, as I don't see a possibility to >> use ft_redefine trial: >> >> cfg = [] >> cfg.dataset= strcat(sb,'mov_data.mat') >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'resp' >> cfg.trialdef.prestim = 0.75 >> cfg.trialdef.poststim = 0.75 >> >> >> >> mov_data_small = ft_definetrial(cfg) >> >> but I get the error message: >> >> Error using ft_read_header (line 1833) >> unsupported header format (matlab) >> >> Error in ft_trialfun_general (line 71) >> hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); >> >> Error in ft_definetrial (line 169) >> [trl, event] = feval(cfg.trialfun, cfg); >> >> >> >> >> I wonder if that is as the file produced by fieldtrip during the >> preprocessing is not one that is specified for ft_read_header - but how do I >> deal with this? >> >> Thanks a lot for your help >> >> Katrin >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mailtome.2113 at gmail.com Mon Oct 13 08:49:42 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 17:49:42 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Message-ID: Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Oct 13 11:41:20 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 13 Oct 2014 09:41:20 +0000 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Hi Arti, Try lowering the cfg.zlim values (%% Plot TFR). Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] Sent: Monday, 13 October 2014 5:49 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Oct 13 12:37:45 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 21:37:45 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? Thanks Arti On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > *Sent:* Monday, 13 October 2014 5:49 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency > analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I > have used the following script (I wrote the script from the examples on the > fieldtrip website), but I get the time frequency plots with huge values. > Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Oct 13 13:44:15 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 13 Oct 2014 13:44:15 +0200 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: <99C51A43-5E39-4C9C-949D-D8F4EEF3C539@uni-konstanz.de> Dear Arti, the units on the tutorial are in Tesla^2. In your case they might end up being in V^2 if you first convert them to volts instead of bits, i.e. the reason why you end up with those high values. So, to your question, your are not doing anything wrong. best tzvetan > Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? > Thanks > Arti > > On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > Sent: Monday, 13 October 2014 5:49 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Oct 13 17:16:52 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 13 Oct 2014 15:16:52 +0000 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' Message-ID: Hi all, In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been hoping to end up with a source file with both averaged and individual trials in source space, much as can be done with time locking in sensor space. However, my resulting source file only ever has avg data, regardless of what I tweak. Does anyone know what I may be doing wrong, or how I could possibly use beamformer with lcmv method and keep individual trials at source space grid points? Thanks in advance! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:49:23 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:49:23 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: Dear Kaelasha, I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* Good luck, Joram On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler wrote: > Hi all, > > In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been > hoping to end up with a source file with both averaged and individual > trials in source space, much as can be done with time locking in sensor > space. > > However, my resulting source file only ever has avg data, regardless of > what I tweak. > > Does anyone know what I may be doing wrong, or how I could possibly use > beamformer with lcmv method and keep individual trials at source space grid > points? > > Thanks in advance! > > Kaelasha Tyler > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:51:21 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:51:21 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: NB: cfg.keeptrials='yes'; is also handy, because this ensures the trial info matrix is left into the output structure, so you can do, e.g., correlations between the single-trial power and the RT of each trial, or some other trial-varying variable. - Joram On Mon, Oct 13, 2014 at 5:49 PM, Joram van Driel wrote: > Dear Kaelasha, > I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* > Good luck, > Joram > > On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler > wrote: > >> Hi all, >> >> In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been >> hoping to end up with a source file with both averaged and individual >> trials in source space, much as can be done with time locking in sensor >> space. >> >> However, my resulting source file only ever has avg data, regardless of >> what I tweak. >> >> Does anyone know what I may be doing wrong, or how I could possibly use >> beamformer with lcmv method and keep individual trials at source space grid >> points? >> >> Thanks in advance! >> >> Kaelasha Tyler >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 03:12:04 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Mon, 13 Oct 2014 18:12:04 -0700 Subject: [FieldTrip] unable to download Message-ID: Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 14 08:03:11 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 14 Oct 2014 06:03:11 +0000 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Hi Brittany, For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. Silly silly mistake on my part. Might be of help to you? Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] Sent: Tuesday, 14 October 2014 12:12 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] unable to download Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 14 09:27:01 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 14 Oct 2014 09:27:01 +0200 Subject: [FieldTrip] using clusterplot to plot percentage changes Message-ID: Dear all, I was wondering if it would be possible to plot percentage changes of power spectrum using ft_clusterplot function. As far as I understand, the zlim specified for the ft_clusterplot is the changes of the power spectrum, right? Does anyone know the unit of the zlim? My power spectrum was calculated using the mtmfft function. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 19:50:41 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Tue, 14 Oct 2014 10:50:41 -0700 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Thanks Kaelasha, I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? Brittany On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to > download the FT zip file from the FT server. What I was supped to be doing > I was dragging and dropping the zip file onto my computer where the file > transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Brittany Alperin [balperin07 at gmail.com] > *Sent:* Tuesday, 14 October 2014 12:12 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the > download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:36:05 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:36:05 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis Message-ID: Dear list, I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:39:36 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:39:36 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Apologies for the previous email. I hit send before finished typing I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; This is returning the following error Undefined function 'eq' for input arguments of type 'struct'. Error in filetype_check_uri (line 62) sep = find(filename==':'); Error in fetch_url (line 33) if filetype_check_uri(filename, 'sftp') Error in ft_read_header (line 105) filename = fetch_url(filename); Any help would be much appreciated. Regards, Arti On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek wrote: > Dear list, > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > > > cfg =[]; > > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > > > data_clean = ft_rejectvisual(cfg, dat); > > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias.treder at gmail.com Wed Oct 15 20:56:17 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Wed, 15 Oct 2014 19:56:17 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 15 22:09:43 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <577666873.3492259.1413403783469.JavaMail.root@bcbl.eu> Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matthias.treder at gmail.com Thu Oct 16 20:54:20 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Thu, 16 Oct 2014 19:54:20 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias > Message: 1 > Date: Wed, 15 Oct 2014 19:56:17 +0100 > From: Matthias Treder > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: > < > CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hello FieldTrippers, > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and > the result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires either > a field .mom or the structure of the data has to be rpttap_chan_freq, but I > have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: <577666873.3492259.1413403783469.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Hi Matthias, > > have you tried: > > cfg.keetrials = 'yes' in your cfg? > > Best, > Fred > > Fr?d?ric Roux > > ----- Original Message ----- > From: "Matthias Treder" > To: fieldtrip at science.ru.nl > Sent: Wednesday, October 15, 2014 8:56:17 PM > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > > > > > > > > Hello FieldTrippers, > > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and the > result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires > either a field .mom or the structure of the data has to be > rpttap_chan_freq, but I have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 13 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 16 23:12:40 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 16 Oct 2014 23:12:40 +0200 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: <8B1D8545-3F9C-47D8-B3AC-E067B859D029@donders.ru.nl> Dear Brittany and others Multiple people have reported intermittent download problems over the last few days. Last weekend the network in our building was renewed and reconfigured, and I suspect that there are still some issues with the new network. I have notified our ICT department and hope that they will fix it. In case you want the fieldtrip source code, there are some alternatives mentioned on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. With git or svn it is much easier to keep your copy of the fieldtrip code up to date. On the github page there is also a zip file, which is always the latest version. In case you want to download the tutorial data, I have no work around and can only suggest that you keep on trying. sorry for the inconvenience, Robert On 14 Oct 2014, at 19:50, Brittany Alperin wrote: > Thanks Kaelasha, > > I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? > > Brittany > > > > On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] > Sent: Tuesday, 14 October 2014 12:12 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 17 01:48:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 16 Oct 2014 16:48:00 -0700 Subject: [FieldTrip] source grand-average MNE Message-ID: <54405930.6040106@gmail.com> Hi all, I was wondering whether anyone has an insight into the problem I've been having when trying to run ft_sourcegrandaverage on the output from ft_sourceanalysis with cfg.method = 'mne'; I followed the procedure described in the tutorial "Source reconstruction of event-related fields using minimum-norm estimate" http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate and I'm working with MNI-warped grids. (I'm using version fieldtrip-20140801) With a call to ft_sourcegrandaverage over the subjects' data, I get the error a known error: "the input sources vary in the field pos". So what I did next was to set .pos and .dim for each subjects' source reconstruction to one same .pos and .dim from the template sourcemodel. In this case, the error I get is the following: Error using fixdimord (line 159) unexpected dimord "_ori_ori" Error in fixdimord (line 91) data = fixdimord(data); Error in ft_datatype_source (line 208) source = fixdimord(source); Error in ft_sourcegrandaverage (line 108) varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I haven't been able to download a more recent version of FT yet (server down?), so I apologise if my question would be solved by simply downloading a more recent FT version. Thanks a lot, Vitoria From f.roux at bcbl.eu Fri Oct 17 08:49:42 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Fri, 17 Oct 2014 08:49:42 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <90389720.3507978.1413528582649.JavaMail.root@bcbl.eu> Hi Matthias, if you want the dimensions of your data to be rpttap_chan_freq instead of rpttap_chan_freq_time you can try this cfg: cfg = []; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.pad = 'maxperlen'; cfg.keeptapers = 'yes'; cfg.keeptrials = 'yes'; cfg.foi = 0:Fs/2; Here instead of computing a spectrogram with wavelets, you are computing a spectrum (no temporal information) using either a hanning taper, or any other taper of your choice. The output of this cfg should give you a data-structure with the dimensions that you are interested in. Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Thursday, October 16, 2014 8:54:20 PM Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias Message: 1 Date: Wed, 15 Oct 2014 19:56:17 +0100 From: Matthias Treder < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com > Content-Type: text/plain; charset="utf-8" Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > ------------------------------ Message: 2 Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < 577666873.3492259.1413403783469.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Fr?d?ric Roux ----- Original Message ----- From: "Matthias Treder" < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 47, Issue 13 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From drbatalasandhya at gmail.com Fri Oct 17 16:37:04 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:07:04 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. as an alternate I have downloaded the zip file of the toolbox. Therefore I am in need of the example data . Can anyone please share the example data with me. thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From ms.fieldtrip at googlemail.com Fri Oct 17 17:09:04 2014 From: ms.fieldtrip at googlemail.com (Michael Meg) Date: Fri, 17 Oct 2014 17:09:04 +0200 Subject: [FieldTrip] Very short Morlet wavelets - non-zero mean correction missing ? Message-ID: Dear colleagues and friends, looking at the current Fieldtrip version (20141016), I could not find the "low-cycle correction" that you need for less than 5 cycles in Morlet wavelet analysis. On the other hand a gwidth (Gaussian width, I suppose) parameter defaults to 3 instead of five. Maybe it would be good to implement the correction by subtracting exp( (2*pi*freqoi(ifreqoi))2 / 2) from the complex exponential after its created? (The correction deals with the fact that the complex Morlet wavelet has a non-zero mean at the low cycle numbers. See for example: The Illustrated Wavelet Transform Handbook: Introductory Theory and Applications in Science, Egnineering, Medicine and Finance. Paul S Addison. page 35) Please disregard this email if this has been done in the meantime. Best, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Fri Oct 17 17:26:34 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:56:34 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . Can anyone please share the example data with me. Thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:04:37 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:04:37 +0200 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sandhya and others Please find below a short section forwarded from our local ICT staff. They are presently working together with the university ICT staff to get it resolved. The suggestion below might provide a work around. best regards, Robert Begin forwarded message: > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of setting > the transfer mode to "active". As an example you could use filezilla and force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active On 17 Oct 2014, at 17:26, batala sandhya wrote: > hello, > > I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:31:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:31:29 +0200 Subject: [FieldTrip] change in ft_rejectvisual regarding dataout.cfg.artifact Message-ID: <057A6C50-2437-447F-A8B4-2DA63F0B327F@donders.ru.nl> Dear all I recently made a change in ft_rejectvisual that some of you might want to be aware of. It has to do with keeping track of rejected data segments and the change was made in revision 9881, which you can see in detail at https://code.google.com/p/fieldtrip/source/detail?r=9881 It used to be that with dataout = ft_rejectvisual(cfg, datain); you would get dataout.cfg.artifact as a Nx2 matrix with the data segments that were marked as artifact. The new behaviour is that the Nx2 matrix is now to be found in either one of dataout.cfg.artfctdef.summary.artifact dataout.cfg.artfctdef.trial.artifact dataout.cfg.artfctdef.channel.artifact depening on whether cfg.method=summary/trial/channel. This makes ft_rejectvisual compatible with the other ft_artifact_xxx functions. So, you can now do cfg.keeptrial = ‘yes’ cfg.keepchannel = ‘yes’ dataout = ft_rejectvisual(cfg, datain); where dataout still contains all trials and channels, but subsequently you can use dataclean = ft_rejectartifact(dataout.cfg, datain) to remove them explicitly. This facilitates repeated passes of ft_rejectartifact for different channel types (EEG, planar gradiometers, magnetometers) and to store the manual work in between. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From Laura.Rueda at faber.kuleuven.be Mon Oct 20 18:17:25 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Mon, 20 Oct 2014 16:17:25 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics Message-ID: Dear all, I'm working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don't have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don't have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:49:47 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:49:47 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < Laura.Rueda at faber.kuleuven.be> wrote: > Dear all, > > > > I’m working with EEG data and the individual MRIs. I have a doubt about a > step for defining ROIs. I have EEG data during a task with 3 conditions > (C1, C2, C3) and during rest. I would like to know what is the main effect > of the conditions in my source data. I was recommended to use the contrast > of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, > which then are used to restrict the source and statistical analysis between > the conditions. This is what I do: > > > > - Estimate sources with the common filter for Task and Rest > separately. > > - Find sources that are significantly different between these > two conditions (ft_sourcestatistics with dependent T). > > - Use the position of these sources as ROIs in ft_sourceanalysis > for C1, C2 and C3 separately (but using a common filter of these > conditions). > > - Find sources that account for the main effect between > conditions (ft_sourcestatistics with dependent F). > > > > Now the problem is that if I use the position of the sources in > ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a > problem when using ft_sourcestatistics as cfg.dim needs to be specified and > if I do not specify it (because I don’t have a regular grid with 3 > dimensions as expected), I get the following error: > > > > Error using reshape > > To RESHAPE the number of elements must not change. > > > > Error in clusterstat (line 185) > > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > > Error in ft_statistics_montecarlo (line 361) > > [stat, cfg] = clusterstat(cfg, statrand, statobs); > > > > Error in statistics_wrapper (line 308) > > [stat, cfg] = statmethod(cfg, dat, design); > > > > Error in ft_sourcestatistics (line 107) > > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > > > > So does anybody know a way to work around this? > > > > And what do you think of the logic of these steps? > > > > Thank you in advance for any help! > > > > > > Cheers, > > > > Laura Rueda Delgado > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:58:30 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:58:30 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor wrote: > Hi Laura, > > If I understand your problem correctly, what I think you need to do is > create a template grid using ft_source_model, then use ft_source_model to > create a grid using each subjects' mri with the template grid, and finally > change the .dim and .pos parameters of the source analysis output to unwarp > from the subject grid to the template grid. The following code might help, > although I think there is also a tutorial that talks about this: > > template = ft_read_mri(templatefile); > template.coordsys = 'spm'; > > % segment the template brain and construct a volume conduction model > (i.e. head model) > > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % Subject mri > > mri = ft_read_mri(mrifile); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmented = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmented); > > % Prepare Source Model using template grid and subject mri > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > grid = ft_prepare_sourcemodel(cfg); > > % Unwarp Grid (For group analysis) > > src.dim = template_grid.dim; > src.pos = template_grid.pos; > > I hope this helps. > best, > > Max > > > > On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < > Laura.Rueda at faber.kuleuven.be> wrote: > >> Dear all, >> >> >> >> I’m working with EEG data and the individual MRIs. I have a doubt about a >> step for defining ROIs. I have EEG data during a task with 3 conditions >> (C1, C2, C3) and during rest. I would like to know what is the main effect >> of the conditions in my source data. I was recommended to use the contrast >> of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, >> which then are used to restrict the source and statistical analysis between >> the conditions. This is what I do: >> >> >> >> - Estimate sources with the common filter for Task and Rest >> separately. >> >> - Find sources that are significantly different between these >> two conditions (ft_sourcestatistics with dependent T). >> >> - Use the position of these sources as ROIs in >> ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter >> of these conditions). >> >> - Find sources that account for the main effect between >> conditions (ft_sourcestatistics with dependent F). >> >> >> >> Now the problem is that if I use the position of the sources in >> ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a >> problem when using ft_sourcestatistics as cfg.dim needs to be specified and >> if I do not specify it (because I don’t have a regular grid with 3 >> dimensions as expected), I get the following error: >> >> >> >> Error using reshape >> >> To RESHAPE the number of elements must not change. >> >> >> >> Error in clusterstat (line 185) >> >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> >> Error in ft_statistics_montecarlo (line 361) >> >> [stat, cfg] = clusterstat(cfg, statrand, statobs); >> >> >> >> Error in statistics_wrapper (line 308) >> >> [stat, cfg] = statmethod(cfg, dat, design); >> >> >> >> Error in ft_sourcestatistics (line 107) >> >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> >> >> >> >> So does anybody know a way to work around this? >> >> >> >> And what do you think of the logic of these steps? >> >> >> >> Thank you in advance for any help! >> >> >> >> >> >> Cheers, >> >> >> >> Laura Rueda Delgado >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From assaf.harel at wright.edu Mon Oct 20 23:18:19 2014 From: assaf.harel at wright.edu (Harel, Assaf) Date: Mon, 20 Oct 2014 17:18:19 -0400 Subject: [FieldTrip] Post Doc Position in Human Neuroscience and Visual Cognition Message-ID: <46894172-662A-4C53-86A7-1CAF709EAF59@wright.edu> Human Neuroscience and Visual Cognition Lab Department of Psychology Wright State University A post-doc position is now available at the newly established Human Neuroscience and Visual Cognition Lab at the Department of Psychology, Wright State University. The lab is headed by Dr. Assaf Harel and investigates high-level vision and its neural substrates. We are particularly interested in how visual recognition occurs in real-world settings and adopt a neuroergonomic approach to study the applied aspects of high-level vision. For this purpose, we employ a diversity of cognitive neuroscience methods, including fMRI, EEG, psychophysics, and eye tracking. Research topics include, but are not limited to the following areas: visual expertise, object and scene recognition, categorization and perceptual learning. The position is fully funded for two years. The successful candidate will hold a PhD in Cognitive Neuroscience, Cognitive Psychology, Neurobiology, Computer Science, or any other related discipline by the start date of the position. Strong background and familiarity with fMRI or EEG research is required. Experience in computer programming, especially with Matlab is highly encouraged and will be considered a strong advantage. Applicants should send their CV, a short statement of their research interests and contact information for two references to Dr. Assaf Harel at: assaf.harel at wright.edu. The Department of Psychology is housed in the College of Science and Mathematics, offers a Ph.D. in Human Factors and Industrial/ Organizational Psychology, and has 3 undergraduate concentration areas: (1) Cognition and Perception, (2) Industrial/ Organizational, and (3) Behavioral Neuroscience. Wright State University was recently ranked among the “Best in the Midwest” universities by The Princeton Review, listed among 260 Best National Universities in the annual “America’s Best Colleges” rankings by U.S. News and World Report, and ranked fourth nationally among universities with limited numbers of doctoral programs in the Faculty Scholarly Productivity Index. Wright State University is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 21 00:20:21 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Tue, 21 Oct 2014 00:20:21 +0200 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Dear Arti, I suppose you already solved your problem. Just in case. What the matlab error is telling you is: "you are giving me something (a structure) while I was expecting a string" (you will get familiar with that error. well or hopefully not). So in a nutshell you need to give ft_read_header a string, probably the name of the file you have your data exported to (extension included). A common error is calling ft_read_header like ft_read_header(cfg) because ft_databrowser or ft_preprocessing can open external files if you feed them with cfg.dataset - who is a string. In your case, this is happening because you are trying to read the header of a matlab variable - a structure of eeg data imported in fieldtrip format. So if what I say makes sense you will see this is not a fieldtrip problem indeed. So call something like ft_read_header('mydata.edf'). Last advice highlight ft_read_header and press F1. Ánimo and good luck with your data explorations 2014-10-15 3:39 GMT+02:00 Arti Abhishek : > Apologies for the previous email. I hit send before finished typing > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > cfg =[]; > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > data_clean = ft_rejectvisual(cfg, dat); > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > This is returning the following error > > Undefined function 'eq' for input arguments of type 'struct'. > > Error in filetype_check_uri (line 62) > sep = find(filename==':'); > > Error in fetch_url (line 33) > if filetype_check_uri(filename, 'sftp') > > Error in ft_read_header (line 105) > filename = fetch_url(filename); > > Any help would be much appreciated. > > Regards, > > Arti > > On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek > wrote: > >> Dear list, >> >> I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I >> have EEG data preprocessed and saved as .mat files. Now I want to further >> process the data. I used the following script >> >> Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', >> 's10', 's11', 's12'... >> >> 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; >> >> Triggers = [101 111 121]; >> >> Conditions = {'4Ch', '8Ch', '16Ch'}; >> >> for i=1:length(Subjects) >> >> for j=1:length (Conditions) >> >> >> >> cfg =[]; >> >> >> FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); >> >> >> >> DataFIC = load (FileName); >> >> hdr = ft_read_header (DataFIC); >> >> >> dat = ft_read_data(DataFIC, 'header', 'hdr'); >> >> cfg.method = 'summary'; >> >> cfg.channels = 'all'; >> >> >> >> data_clean = ft_rejectvisual(cfg, dat); >> >> >> save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') >> >> end; >> >> end; >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Tue Oct 21 03:41:01 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 21 Oct 2014 12:11:01 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Dear Eelke, Thank you for help regarding cluster-based permutation analysis of two or more conditions. I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. for k = 1:Nmt, % states for i = 1%:Ng, % groups for j = 1:Ns, % subjects % load files p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); % convert to eeglab to get channel locations EEG(j) = eeg2eeglab( p(j)); EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); % preprocessing in fieldtrip d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); % specify length of time to use in config time = EEG(j).xmax-EEG(j).xmin; % setup configuration for freqanalysis cfg = []; % clear cfg cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = 1:0.05:time; % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles cfg.keeptrials = 'yes'; % do freqanalysis freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) Any help would be appreciated. Kind regards, Dylan On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > and > > the two experimental designs (between- and within-UO), the tutorial > covers > > statistics on data in two conditions in a between-trials, in a > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > first > > averaging over all trials belonging to each of the experimental > conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Tue Oct 21 07:14:24 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Tue, 21 Oct 2014 10:44:24 +0530 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sir, As directed, I tried to connect via ftp client filezilla to connect to the host ftp but it was unable to make a connection displaying a error , screenshot of which is included as under [image: Inline image 1] Sir can you please suggest as to why this error occured Thanks and regard On Mon, Oct 20, 2014 at 6:34 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Sandhya and others > > Please find below a short section forwarded from our local ICT staff. They > are presently working together with the university ICT staff to get it > resolved. The suggestion below might provide a work around. > > best regards, > Robert > > > Begin forwarded message: > > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now > allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of > setting > the transfer mode to "active". As an example you could use filezilla and > force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active > > > > > > > On 17 Oct 2014, at 17:26, batala sandhya > wrote: > > hello, > > I am unable to connect to the ftp server to download the toolbox and > example data. As an alternate I have downloaded the master zip file of the > toolbox provided in the website . Therefore I am in need of the example > data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.JPG Type: image/jpeg Size: 82981 bytes Desc: not available URL: From Laura.Rueda at faber.kuleuven.be Tue Oct 21 10:17:42 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Tue, 21 Oct 2014 08:17:42 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Dear all and Max, Thank you for your comment. I think I wasn’t clear in my previous message I’ve added more explanation to the steps that I mentioned before: 1) Estimate sources with the common filter for Task and Rest separately: I create the headmodel from the invidual MRI, and create the grid from the individually warped template as described in the tutorial that you suggested. I use eLORETA. 2) Find sources (let’s call them ‘Task_vs_Rest’)that are significantly different between these two conditions (ft_sourcestatistics with dependent T): I run a cluster-based permutation on the sources after unwarping the positions to the positions of the template for group analysis. 3) Use the position of these sources (Task_vs_Rest) as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions): I get the index of the sources Task_vs_Rest and use this index for selecting the x,y,z coordinates (grid.pos) of the individually warped template. These x,y,z coordinates are my ROIs for ft_sourceanalysis. 4) Find sources (let’s call them ‘C1vsC2vsC3’) that account for the main effect between conditions (ft_sourcestatistics with dependent F). My question: I get stuck in step 4. The problem is that if I use the position of the sources Task_vs_Rest, as a way to select ROIs, I don’t have a regular grid anymore for steps 3 and 4. When using ft_sourcestatistics to find C1vsC2vsC3 (in step 4), cfg.dim needs to be specified. If I do not specify it (because I don’t have a regular grid with 3 dimensions as expected in step 4), I get the error shown in my previous message. The goal with these steps is to first obtain meaningful sources from the contrast Task (including C1, C2 and C3) vs Rest to use them for the contrast C1 vs C2 vs C3. Please let me know if these steps make any sense, and whether and/or how I could work around this error. Best regards, Laura Rueda Delgado KU Leuven - Department of Kinesiology Movement Control and Neuroplasticity Research Group Building De Nayer (GDN) Tervuursevest 101 bus 1501 3001 Leuven Belgium From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Max Cantor Sent: maandag 20 oktober 2014 18:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] Specific sources and ft_sourcestatistics I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor > wrote: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado > wrote: Dear all, I’m working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don’t have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue Oct 21 11:39:14 2014 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 21 Oct 2014 11:39:14 +0200 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <5322FFE6.7000902@donders.ru.nl> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> <5322FFE6.7000902@donders.ru.nl> Message-ID: <2BED38A7-3028-45B0-BCC4-78FC047F66C5@gmail.com> Hi Phyllis, I have a similar situation - ft_databrowser after appending - and I solved the problem of not seeing events at the right times by manually rebuilding them. For artefact rejection I found it important to know when in the trial eg. blinks occurred. There is the (undocumented?) cfg.event input option, which I used in the following way % ARTIFICIALLY REBUILD EVENTS for t = 1:length(data.trial), % get the distance between each event and the start of the trial samples(t,1) = trl(t,2)-trl(t,1); %int1 samples(t,2) = trl(t,5)-trl(t,1); %int2 samples(t,3) = trl(t,8)-trl(t,1); %resp samples(t,4) = trl(t,10)-trl(t,1); %fb % add the length of this trial samples(t,:) = samples(t,:) + (12*600*t-1); end samples = reshape(samples', 1, numel(samples)); % create events structure to feed into databrowser for i = 1:length(samples), e(i).type = 'x'; e(i).sample = samples(i); e(i).value = []; e(i).offset = 0; e(i).duration = 1; end cfg.event = e; cfg = ft_databrowser(cfg, data); in which the trl matrix I use has samples of events at column 2, 5, 8, and 10, and the first column has the start of the trial in samples. Also, each trial takes 12 seconds at sampling rate 600 Hz. For trials of unequal length, you need to do a bit better bookkeeping on the assumption that fieldtrip treats epoched data as continuous data from the same recording. Hope this helps! Cheers, Anne --- Anne E. Urai, MSc PhD student | Institute for Neuro- and Pathophysiology | University Medical Center Hamburg-Eppendorf | Hamburg, Germany | anneurai.wordpress.com On 14 Mar 2014, at 14:11, Jörn M. Horschig wrote: > Heyho, > > yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) > Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. > If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! > > Best, > Jörn > > > On 3/14/2014 1:52 PM, Phyllis Mania wrote: >> >> Dear Eelke, >> >> Calling ‘rmfield’ helped, thank you! >> >> Cheers, >> >> Phyllis >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 21 14:32:02 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 21 Oct 2014 14:32:02 +0200 Subject: [FieldTrip] Units for clusterplots Message-ID: Dear all, I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 21 15:05:59 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 21 Oct 2014 15:05:59 +0200 Subject: [FieldTrip] Units for clusterplots In-Reply-To: References: Message-ID: <23FF97F7-1C48-4E1E-A8AB-1EAC06C873A2@uni-konstanz.de> Dear Hweeling, it depends on the configuration you’d specify by cfg.parameter. I assume you didn’t specify anything so that in this case ft_clusterplot defaults to parameter ’stat’ with unit t-values. best tzvetan > Dear all, > I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? > Thanks. > Cheers, > Hweeling > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 21 15:57:43 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 13:57:43 +0000 Subject: [FieldTrip] no coil pos for planar combined data Message-ID: Hi all, I am having problems using ft_sourceanalysis with planar gradiometer data. I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow Using planar gradiometer data is mentioned in the tutorial, although not in detail. My problem: The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. I get the error: Reference to non-existent field 'avg'. I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. Any suggestions? If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. Is that possible? Thanks in advance! (and thank you to all previous very helpful responses on this list). Kaelasha Tyler PhD Candidate Brain and Psychological Science Research Centre Swinburne University of Technology Melbourne Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 21 17:05:07 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 21 Oct 2014 17:05:07 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > From ktyler at swin.edu.au Tue Oct 21 18:58:57 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 16:58:57 +0000 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: , Message-ID: Hi Eelke, Partly I was just following the tutorials suggestion. I am using a Neuromag system. Up until now I have been working primarily with the magnetometers. I was interested in what difference I would find with data from the planar gradiometers. I had understood that planar gradiometer sensor pairs measure planar magnetic fields perpendicular to each other, at a similar point near the scalp. That being the case, I would have thought that using original planar gradiometer data in source analysis without combining it would produce in nonsensical results. Wouldn't source data at one grid point would then be incongruously trying to represent two different sets of information? Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Wednesday, 22 October 2014 2:05 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] no coil pos for planar combined data Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From joramvandriel at gmail.com Tue Oct 21 21:25:55 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Tue, 21 Oct 2014 21:25:55 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, I believe (but I might be wrong), that you can use all three sensor types for Neuromag data (so the uncombined gradiometers *and* the magnetometers) with lcmv beamforming. That is, the weights (filters) of each voxel are computed based on covariance between sensors. Even if the different sensor types catch different aspects of the magnetic field, they probably covary as a function of, e.g., a stimulus, a cognitive process, or any underlying brain process. So in that sense, the more data, the better the source estimate, so why not use all 306 sensors? At least this worked for me and gave very sensible results. Maybe other fieldtrip users who use Neuromag data for beamforming can comment on this? - Joram On Tue, Oct 21, 2014 at 6:58 PM, Kaelasha Tyler wrote: > Hi Eelke, > > Partly I was just following the tutorials suggestion. > I am using a Neuromag system. Up until now I have been working primarily > with the magnetometers. > I was interested in what difference I would find with data from the planar > gradiometers. > > I had understood that planar gradiometer sensor pairs measure planar > magnetic fields perpendicular to each other, at a similar point near the > scalp. That being the case, I would have thought that using original planar > gradiometer data in source analysis without combining it would produce in > nonsensical results. Wouldn't source data at one grid point would then be > incongruously trying to represent two different sets of information? > > Kaelasha > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] > Sent: Wednesday, 22 October 2014 2:05 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] no coil pos for planar combined data > > Hi Kaelasha, > > Why do you want to do source analysis on combined planar gradiometer > data? In general, I would say this does not make sense. Instead, I > would use the original (axial or planar, depending on your system) > gradiometer data. > > Best, > Eelke > > On 21 October 2014 15:57, Kaelasha Tyler wrote: > > Hi all, > > > > I am having problems using ft_sourceanalysis with planar gradiometer > data. > > > > I am following a tutorial for beamforming with lcmv method (which I > believe is a work in progress) found here: > > > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > > Using planar gradiometer data is mentioned in the tutorial, although not > in detail. > > > > My problem: > > The .avg field produced by time locking, is lost when combining planar > gradiometers using 'ft_combineplanar'. > > In this case, I am unable to to use 'ft_sourceanalysis' on combined > planar gradiometer data. > > I get the error: Reference to non-existent field 'avg'. > > > > I reasoned that I may be able to keep the .avg filed if I combine the > planar gradiometer data at the outset, prior to timelocking. But in this > case, the gradiometer positions in data.grad does not include 'coilpos'. > Eg, no data.grad.coilpos. > > When calling 'ft_sourceanalysis' in this case, I get the error: > Reference to non-existent field 'coilpos'. > > > > Any suggestions? > > > > If the .grad.coilpos was retained when I combined the planar gradiometer > data at the outset, (after preprocessesing and prior to timelokcing) then I > would be able to use ft_sourceanalysis on planar gradiometer combined data > successfully. > > Is that possible? > > > > Thanks in advance! (and thank you to all previous very helpful responses > on this list). > > > > Kaelasha Tyler > > > > PhD Candidate > > Brain and Psychological Science Research Centre > > Swinburne University of Technology > > Melbourne > > Australia > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Wed Oct 22 10:51:58 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Wed, 22 Oct 2014 08:51:58 +0000 Subject: [FieldTrip] =?windows-1252?q?Weird_repetition_trails=85=2E_=28=2E?= =?windows-1252?q?cnt_files=29?= Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB50EE@UWMBX01.uw.lu.se> Dear fieldtripers, I am having problems for fieldtrip to read the .cnt neuroscan files. I noticed that, when I am plotting my trials (using ft_databrower), I get trials that are exactly the same. The data in each sample of that trial, for each channel, looks exactly the same! I don’t really know the reason for this and I have tried and checked different things: 1. My trl matrix is properly defined. It could be that the same sample numbers were used for extracting different trial numbers, but that is not the case. 2. Using curry to visualize the data showed that there is nothing wrong while converting my .dat into a .cnt file. 3. I notice that fieldtrip is using the loadcnt function from eeglab. For this reason I used eeglab to read the data. When I plot the trials using eeglab I don’t find these weird trials repetitions. 4. The trials that are repeated do not seem to be real (when I look into those trials repetitions using both with curry and eeglab the trials are completely different from what fieldtrip give me). Besides those weird repetitions or the other trials seems to match. 5. I do not get more trials then what I am asking for. My trl matrix has 312 rows and I get 312 trials. So those repeated trials are replacing some relevant information… 6. The data in each sample of those trials are the same, but the triggers are different. If I would continue with data analysis exactly the same trial would be latter classified as belonging to different experimental conditions. 7. Importantly while I am extracting the trials from the data using ft_preprocessing I get a warning message saying “events imported with a time shift might be innacurate”. 8. I am using the most recent version of fieldtrip (fieldtrip-20141021) Do you have any idea of what can be going on? I have been using fieldtrip before (.bdf files) and I never had this problem… Also, a colleague of mine is having the same exactly problem… Thank you very much in advance! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 22 12:09:44 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 22 Oct 2014 12:09:44 +0200 (CEST) Subject: [FieldTrip] source plot with cfg.method = 'ortho' slows down computer Message-ID: <1407267660.3560510.1413972584299.JavaMail.root@bcbl.eu> Dear all, I was wondering if anyone has experienced as similar problem when using ft_sourceplot. My cfg structure looks like this: cfg = []; cfg.funparameter = 'statmask'; cfg.method = 'ortho'; cfg.interactive = 'yes'; ft_sourceplot(cfg,Stats); The graphic takes a really long time (>30 sec) to discplay and when I reposition the cursor it takes a really long time to update the figure (>30 sec). I suspect the problem to be related to changes in the function as I haven't experienced these difficulties in the past. Could it be that there may be some graphical rendering issues responsible here? Hoping that someone can provide me with any hints, as data-visualization is being really sluggish and frustrating right now. Best, Fred --------------------------------------------------------------------------- From r.oostenveld at donders.ru.nl Wed Oct 22 15:24:03 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 22 Oct 2014 15:24:03 +0200 Subject: [FieldTrip] FTP fully working again References: <1413977946.863096.220074797.33689.14@otrs.dccn.nl> Message-ID: <29D3A1A1-69C3-4A4F-9A00-E348A8EEA064@donders.ru.nl> Dear all, Following the troubled network upgrade, there have been about two weeks in with our FTP service was not fully accessible. I just received notice that it has been restored and that all FTP clients should again work. best regards, Robert Begin forwarded message: > The DCCN ftp-server is now running like expected. Our network department changed the firewall rulesets so it's no longer necessary to change ftp-clients to active transfer mode. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Thu Oct 23 16:02:39 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Thu, 23 Oct 2014 14:02:39 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB5205@UWMBX01.uw.lu.se> Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here: https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 24 13:04:40 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 24 Oct 2014 11:04:40 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ines.bramao at psy.lu.se Fri Oct 24 13:47:10 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Fri, 24 Oct 2014 11:47:10 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files In-Reply-To: References: Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CBC7CF@UWMBX01.uw.lu.se> Dear Jan-Mathijs, Thank you very very much for looking into this issue! I will create the account at the bugzilla.fcdonders in order to follow up this. Please tell me if I can help in some other way (for example, provinding you more data). Best wishes, Inês ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Lam, N.H.L. (Nietzsche) [n.lam at fcdonders.ru.nl] Sent: 24 October 2014 13:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From fab.rotondi at gmail.com Fri Oct 24 16:58:26 2014 From: fab.rotondi at gmail.com (fabio rotondi) Date: Fri, 24 Oct 2014 16:58:26 +0200 Subject: [FieldTrip] LCMV time series reconstruction under multiple conditions (cov matrix problem) Message-ID: Dear Fieldtrip community, my name's Fabio and I'm currently investigating on MEG/EEG connectivity in source space. I'm dealing with a theoretical concern, related to the estimation of virtual electrodes' time series for resting state EEG data (128 channels, 512 Hz sampling frequency) under 3 conditions. For each subject, the recording protocol consists of three consecutive steps: 1 minute of resting with eyes closed (EC), 1 minute resting EC with auditory stimulation n.1, 1 minute resting EC with auditory stimulation n.2. The final aim is to estimate functional connectivity changes in source space under these conditions. My question regards the computation of the covariance matrix: in order to do this I identified 2 possible ways to proceed: 1. compute covariance matrix giving the whole 3-minute signal to ft_timelockanalysis, and then use this matrix to invert separately each of the three conditions; 2. compute a covariance matrix separately for each of the three conditions (thus on 60 seconds) and then invert each condition by using its respective covariance matrix. As far as I know, solution n.1 is in literature the most used. I think it is the solution named as "common filters", which assumes that there are the same signal generators differently active in the three different conditions. This assumption could not be valid in principle for my experiment, but I was wondering if computing three different covariance matrices could introduce any other bias. Thank you so much for your help, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Sun Oct 26 09:34:11 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Message-ID: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Oct 26 10:32:58 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 26 Oct 2014 10:32:58 +0100 Subject: [FieldTrip] topoplot - no match between data and layout In-Reply-To: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> References: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Message-ID: Hello,If the number of channels of your data and layout are not the same, there will be error. The alphabetical case is very important, like sometime your data label may be FCZ while the layout is FCz, you need to check that. Meanwhile, to avoid any error, the best option is to design your own layout base on your data as explained in detail in this tutorial http://fieldtrip.fcdonders.nl/tutorial/layoutGood luck! Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" From: e.caspar at ucl.ac.uk To: fieldtrip at science.ru.nl Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 28 09:15:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 28 Oct 2014 09:15:12 +0100 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From dylan.delosangeles at gmail.com Tue Oct 28 13:21:32 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 28 Oct 2014 22:51:32 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak wrote: > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one > unit-of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles > > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of two > or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up with > a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes > x 3 frequencies x 2049 time points, rather than one struct with a 4D > powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config > > time = EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis > > cfg = []; % clear cfg > > cfg.output = 'pow'; > > cfg.channel = 'EEG'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 0.5:3; % delta > > cfg.toi = 1:0.05:time; % length of each state > > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); > > end > > end > > end > > > > My second problem is loading in the second group of 12 subjects and what > that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous email, > that I should be using indepsamplesF for more than two conditions (I have > 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 > 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 > 7 7 8 8 9 9 10 10 11 11 (11 > conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two groups > > of observations, and not to the same group of observations measured in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) cell > > arrays, corresponding to the conditions, you can input them into the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > time-frequency > >> data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > trials) and > >> the two experimental designs (between- and within-UO), the tutorial > covers > >> statistics on data in two conditions in a between-trials, in a > within-trials > >> and in a within-subjects design. However, I am wondering if there is any > >> information about the fourth type of experiment design: > between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both groups are > >> measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > (multiple > >> subjects in multiple experimental conditions), such that my design is > >> multiple groups in multiple experimental conditions. Is it a case of > first > >> averaging over all trials belonging to each of the experimental > conditions > >> for each subject (as instructed in tutorial), and then averaging over > all > >> subjects in each group? > >> > >> Configuration code for setting up the design currently looks like this; > >> grp = 2; > >> subj = 11; > >> design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when doing > these > >> statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 19:16:19 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 14:16:19 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions Message-ID: Hi, So this is not a specific method-based question, but something more general. I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. *So boiling it down**, my questions are:* 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? 2. If it cannot be used this way, what situations is it meant for? -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 20:05:33 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 15:05:33 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. Hopefully someone else has something to add, or if I'm missing any stuff. Best Rodrigo On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > Hi, > > So this is not a specific method-based question, but something more > general. > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert > (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do > this in a more efficient and fieldtrip-compatible way. It seems I can use > this setting to get the analytic signal, phase, power, and other things, > but since this is on raw/epoched data, there is no obvious way I can think > of to apply a time or frequency series as in the other TFRs. It seems I > could either write a fieldtrip function from scratch, which I'm not > prepared to do, or write a function to reformat fieldtrip data to work > using the Cohen function, and then output it back into a fieldtrip > function, which would be fine but I'm more interested to know if the > ft_preproc_hilbert function can do what I want more efficiently. > > *So boiling it down**, my questions are:* > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 20:48:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 15:48:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From orionblue8 at gmail.com Tue Oct 28 20:54:14 2014 From: orionblue8 at gmail.com (Orion) Date: Tue, 28 Oct 2014 15:54:14 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, Can you clarify what you mean by a Hilbert time-frequency analysis? Performing hilbert on a signal will give several different outputs, like the envelope and phase, and if you want, the instantaneous frequency. But I don't understand the meaning of Hilbert time-frequency. There are ways of calculating hilbert that don't use fft, but as fars as I'm aware, the hilbert.m that calls fft.m provides a quick way to the desired outputs. Orion On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 21:42:37 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 16:42:37 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hm, let me see if I can articulate this properly (I may be a bit rusty with this, so this is as much a review for me as it is an attempt to explain it to anyone else). The Hilbert Transform itself provides the analytic signal, as Sr (the real part, or cosine) and Si (the imaginary part, or sine, which is 90 degrees from the Sr). This can be used to determine things like, as you mentioned, phase, envelope, instantaneous frequency, and power. If a TFR (or at least a power spectrum from a TFR) is the power at sensor x frequency x time, the data structure output from ft_preprocessing is itself not able to give us a TFR; we have to do an FFT or wavelet analysis to get the necessary data matrix, but you can also use Hilbert. I know, from a computational standpoint, how to go from point A to point B here for both wavelet and hilbert, but I'm struggling to articulate it in real words, which means I probably need to do some rereading. However, the point is that you can use Hilbert to get a nearly identical, albeit computationally quite different, time frequency representation as you can with wavelet analysis. I have some code to do both wavelet and hilbert on a sample EEGlab dataset. The sample data comes from the Cohen book, and even though I wrote the code myself, it is based on example code Cohen provides with the book, so unfortunately I'm not sure if it's ethical to share it, but that would hopefully clarify what I mean. That being said, I should be able to articulate it better myself. If anybody thinks they can explain what I'm talking about better I would greatly appreciate it, otherwise I might have to come back to you after I've done some rereading. On Tue, Oct 28, 2014 at 3:54 PM, Orion wrote: > Hi Max, > > Can you clarify what you mean by a Hilbert time-frequency analysis? > Performing hilbert on a signal will give several different outputs, like > the envelope and phase, and if you want, the instantaneous frequency. But > I don't understand the meaning of Hilbert time-frequency. > > There are ways of calculating hilbert that don't use fft, but as fars as > I'm aware, the hilbert.m that calls fft.m provides a quick way to the > desired outputs. > > Orion > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 21:50:36 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 16:50:36 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. Best On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Oct 29 08:26:29 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 29 Oct 2014 08:26:29 +0100 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: Dear all, The following paper by Andreas Bruns might offer some highly relevant background: Bruns (2004) J Neurosci Meth Fourier-, Hilbert- and wavelet-based signal analysis: are they really different approaches? http://www.sciencedirect.com/science/article/pii/S0165027004001098 Best, Eelke On 28 October 2014 21:50, Rodrigo Montefusco wrote: > To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. > > Best > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor > wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco > wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor > wrote: > Hi, > > So this is not a specific method-based question, but something more general. > > I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. > > So boiling it down, my questions are: > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From mcantor at umich.edu Wed Oct 29 14:40:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Wed, 29 Oct 2014 09:40:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: I will definitely need to read this, thank you! I am familiar with some of the differences between Wavelets and Hilbert, such as Wavelet filter kernel always being Gaussian whereas Hilbert can be varied, and Wavelets being somewhat more computationally efficient, but I was also under the impression that they are not fundamentally different. This discussion is actually something I've been having with a small group here at University of Michigan so this article may help clarify more details for us. On Wed, Oct 29, 2014 at 3:26 AM, Eelke Spaak wrote: > Dear all, > > The following paper by Andreas Bruns might offer some highly relevant > background: > > Bruns (2004) J Neurosci Meth > Fourier-, Hilbert- and wavelet-based signal analysis: are they really > different approaches? > http://www.sciencedirect.com/science/article/pii/S0165027004001098 > > Best, > Eelke > > On 28 October 2014 21:50, Rodrigo Montefusco > wrote: > > To where I understand, yes. Just remember that is amplitude and not > power (you probably knew that). I should remark that the filter part is > tricky and critical. > > > > Best > > > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor mcantor at umich.edu>> wrote: > > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > > Hi Max, > > > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > > > Hopefully someone else has something to add, or if I'm missing any stuff. > > > > Best > > > > Rodrigo > > > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor mcantor at umich.edu>> wrote: > > Hi, > > > > So this is not a specific method-based question, but something more > general. > > > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > > > However, I was wondering if it would be possible to use > ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in > ft_preprocessing) to do this in a more efficient and fieldtrip-compatible > way. It seems I can use this setting to get the analytic signal, phase, > power, and other things, but since this is on raw/epoched data, there is no > obvious way I can think of to apply a time or frequency series as in the > other TFRs. It seems I could either write a fieldtrip function from > scratch, which I'm not prepared to do, or write a function to reformat > fieldtrip data to work using the Cohen function, and then output it back > into a fieldtrip function, which would be fine but I'm more interested to > know if the ft_preproc_hilbert function can do what I want more efficiently. > > > > So boiling it down, my questions are: > > > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > > > 2. If it cannot be used this way, what situations is it meant for? > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexander_Nakhnikian at hms.harvard.edu Wed Oct 29 18:19:51 2014 From: Alexander_Nakhnikian at hms.harvard.edu (Nakhnikian, Alexander) Date: Wed, 29 Oct 2014 13:19:51 -0400 Subject: [FieldTrip] Cross-Spectral Input to ft_eloreta Message-ID: <574C31932EBF144DB111B356E91DEC2D014A3BE40CC7@ITCCRMAIL01.MED.HARVARD.EDU> Hello, I'm trying to perform source analysis on an EEG data set using ft_eloreta. I've set up the analysis using the dipole and volume conduction models included in fieldtrip. I want to perform the analysis in frequency space, which means I need to enter a cross-spectral matrix for the variable Cf. The cross-spectral matrix returned by ft_freqanalysis doesn't work. ft_eloreta runs into trouble on line 163 "csd = dip.filter{i}*Cf*dip.filter{i}' " where Cf is the cross-spectral density matrix returned by ft_freqanalysis. This matrix has many rows and its number of columns is equal to the number of frequencies analyzed. The row number is (numChannels*(numChannels-1))^2/2, so it's assigning a row index to each pair-wise combination of channels, ignoring complex conjugate pairs and autospectra. The problem is that dip.filter{i} has dimensionality 3 x numChannels, which means Cf must be a numChannels x numChannels matrix to make the linear algebra work out. Is there a program in fieldtrip that returns a square cross-spectral density matrix for the frequencies of interest? Are there methods papers by Pascual-Marqui or others that deal with how to construct the cross-spectral matrix? I am new both to fieldtrip and to eLORETA so any advice would be greatly appreciated. Thanks in advance, Alexander Nakhnikian From joseangel.pineda at ctb.upm.es Thu Oct 30 16:44:34 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:44:34 +0100 Subject: [FieldTrip] Fwd: In-Reply-To: References: Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Thu Oct 30 16:46:23 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:46:23 +0100 Subject: [FieldTrip] Senior Researcher position in Madrid, Spain Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Thu Oct 30 19:10:35 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Thu, 30 Oct 2014 19:10:35 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Fieldtripers! I have data collected with Neuroscan 32 channels quickcap (1020 standard). There is no template layout for it so I tried to create it myself and had to use Robert Oostenveld's help to succeed (please, see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). So now I have a nice layout. I have checked it with cfg = []; cfg.layout = 'quickcap32.lay' ft_layoutplot(cfg) And I have created a .mat file out of it with layout = ft_prepare_layout(cfg) save quickcap32.mat layout And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): templates_dir = 'D:/My Documents/MATLAB/template/layout/' load([templates_dir 'quickcap32.mat']); cfg = []; cfg.layout = lay; ... I get this *Undefined function or variable 'lay'* message. What am I doing wrong? Any tips will be GREATLY appreciated! Kind regards, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 30 19:37:31 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 30 Oct 2014 14:37:31 -0400 Subject: [FieldTrip] Undefined function or variable 'lay' In-Reply-To: References: Message-ID: Yanina, It looks like your layout variable is called "layout", but your cfg.layout is looking for a variable called "lay". The variable "lay" variable doesn't exist, but I bet "layout" does :-) Best, Raquel On Thu, Oct 30, 2014 at 2:10 PM, Yanina Prystauka wrote: > Dear Fieldtripers! > > I have data collected with Neuroscan 32 channels quickcap (1020 > standard). There is no template layout for it so I tried to create it > myself and had to use Robert Oostenveld's help to succeed (please, see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). > > So now I have a nice layout. I have checked it with > > cfg = []; > cfg.layout = 'quickcap32.lay' > ft_layoutplot(cfg) > > And I have created a .mat file out of it with > > layout = ft_prepare_layout(cfg) > > save quickcap32.mat layout > > And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): > > templates_dir = 'D:/My Documents/MATLAB/template/layout/' > > load([templates_dir 'quickcap32.mat']); > > cfg = []; > > cfg.layout = lay; > > ... I get this *Undefined function or variable 'lay'* message. > > What am I doing wrong? Any tips will be GREATLY appreciated! > > Kind regards, > > Yanina > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Fri Oct 31 13:19:18 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 12:19:18 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Oct 31 13:29:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 31 Oct 2014 13:29:30 +0100 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> References: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> Message-ID: Dear Emma, I've not read your full post, but can say this about the latter part: fieldnames() should be a builtin MATLAB command. Most likely your version of MATLAB is too old; could you try using a more recent version? Typically we try to support versions up to 5 years old for use with FieldTrip. Hope that helps, Best, Eelke On 31 October 2014 13:19, Emma Holmes wrote: > Dear all, > > I am trying to perform spatio-temporal cluster statistics to the sources of > an EEG dataset, which I localised using the SPM8 toolbox. > For each participant (averaged across trials), I have a .nii image > containing the source reconstruction for each of two conditions at multiple > different time points. Each nifti file contains a matrix of 91 x 109 x 91, > which corresponds to the source estimates at each voxel. > My aim is to identify sources of activity that span large clusters of voxels > and/or time points, similar to what I have done previously with the scalp > data. > > I understand that the function 'ft_sourcestatistics' should be able to > achieve this with the data output from the function 'ft_sourcegrandaverage'. > However, I am having difficulty structuring the data from the nifti files in > a format that can be successfully input to 'ft_sourcegrandaverage'. > > The data that I am trying to input to 'ft_sourcegrandaverage' contains a > cell array of structures--one for each participant. > As far as I understand from the documentation, each structure should contain > a 'pos' field, which specifies the [x y z] co-ordinates for each position in > the matrix (in my case, a matrix of size 91*109*91 x 3). > I have also included a 'time' field, containing a vector of the time points > to which each .nii image corresponds and a 'dim' field containing the vector > [91 109 91]. > > Could you please let me know whether or not this is correct and in which > field(s) I should subsequently add the source reconstruction estimates at > each time point. > So far, I have tried including an 'avg' field with the data at each time > point (91 x 109 x 91 x ntps). > However, when I do so, I get the following error: > > ??? Undefined function or method 'fieldnames' for input arguments of type > 'double'. > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > Error in ==> ft_checkdata at 578 > param = setdiff(parameterselection('all', data), exclude); > > Error in ==> ft_sourcegrandaverage at 81 > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, > 'feedback', 'no', > 'inside', 'logical', 'sourcerepresentation', 'new'); > > I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 > (although I have also tried other fieldtrip versions). > > Any help would be greatly appreciated. > > Best wishes, > Emma > From eh776 at york.ac.uk Fri Oct 31 14:45:04 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 13:45:04 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear Eelke, Thanks for your comment--a relevant suggestion. However, the fieldnames() command is present in my version of MATLAB when I type "help fieldnames". Therefore, I suspect my problem arises not because the function is unavailable, but because the input to the function is incorrect. The documentation states that the input to fieldnames() should be a structure. However, if data.avg should be a structure, this seems to conflict with other fieldtrip data types involving data.avg. I suspect that I should not input the source matrix to the data.avg field. However, I am unsure into which field it should go... Is there anyone who could help me? Best, Emma On 31 October 2014 13:29, Eelke Spaak wrote: > Dear Emma, > > I've not read your full post, but can say this about the latter part: > fieldnames() should be a builtin MATLAB command. Most likely your > version of MATLAB is too old; could you try using a more recent > version? Typically we try to support versions up to 5 years old for > use with FieldTrip. > > Hope that helps, > Best, > Eelke On 31 October 2014 13:19, Emma Holmes > wrote: >* Dear all, *>>* I am trying to perform spatio-temporal cluster statistics to the sources of *>* an EEG dataset, which I localised using the SPM8 toolbox. *>* For each participant (averaged across trials), I have a .nii image *>* containing the source reconstruction for each of two conditions at multiple *>* different time points. Each nifti file contains a matrix of 91 x 109 x 91, *>* which corresponds to the source estimates at each voxel. *>* My aim is to identify sources of activity that span large clusters of voxels *>* and/or time points, similar to what I have done previously with the scalp *>* data. *>>* I understand that the function 'ft_sourcestatistics' should be able to *>* achieve this with the data output from the function 'ft_sourcegrandaverage'. *>* However, I am having difficulty structuring the data from the nifti files in *>* a format that can be successfully input to 'ft_sourcegrandaverage'. *>>* The data that I am trying to input to 'ft_sourcegrandaverage' contains a *>* cell array of structures--one for each participant. *>* As far as I understand from the documentation, each structure should contain *>* a 'pos' field, which specifies the [x y z] co-ordinates for each position in *>* the matrix (in my case, a matrix of size 91*109*91 x 3). *>* I have also included a 'time' field, containing a vector of the time points *>* to which each .nii image corresponds and a 'dim' field containing the vector *>* [91 109 91]. *>>* Could you please let me know whether or not this is correct and in which *>* field(s) I should subsequently add the source reconstruction estimates at *>* each time point. *>* So far, I have tried including an 'avg' field with the data at each time *>* point (91 x 109 x 91 x ntps). *>* However, when I do so, I get the following error: *>>* ??? Undefined function or method 'fieldnames' for input arguments of type *>* 'double'. *>>* Error in ==> parameterselection at 47 *>* tmp = fieldnames(data.avg); *>>* Error in ==> ft_checkdata at 578 *>* param = setdiff(parameterselection('all', data), exclude); *>>* Error in ==> ft_sourcegrandaverage at 81 *>* varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, *>* 'feedback', 'no', *>* 'inside', 'logical', 'sourcerepresentation', 'new'); *>>* I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 *>* (although I have also tried other fieldtrip versions). *>>* Any help would be greatly appreciated. *>>* Best wishes, *>* Emma* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Fri Oct 31 16:28:59 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Fri, 31 Oct 2014 16:28:59 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Raquel, Thanks a lot for paying attention to my e-mail! I have messed up with the variables and didn't even notice, thanks for pointing that out! Good luck, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Fri Oct 31 16:47:38 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Fri, 31 Oct 2014 16:47:38 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions Message-ID: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 31 16:56:16 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 31 Oct 2014 16:56:16 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_testsbut instead of a 2-by-2 factorial design, I am using a 2-by-11 factorialdesign. As such, I am not sure how this translates when making differencedata structures. I hope I am not missing something obvious.Thanks again,DylanOn Tuesday, 28 October 2014, Eelke Spaak wrote:Dear Dylan,You don't want (or need) a single struct with a subj X chan X freq Xtime powspctrm. Instead, it is often convenient to collect eachindividual subject's struct in a *cell* array (rather than a structarray). See, for example, here:http://www.mathworks.nl/help/matlab/cell-arrays.html and here:http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/.At the statistics step you should pass in multiple structs, each onecorresponding to one unit-of-observa tion, to ft_freqstatistics. Thiscan be done like so:stat = ft_freqstatistics(cfg, struct11, struct12,struct13,...struct21, struct22, ...);or, using the cell arrays, like so:stat = ft_freqstatistics(cfg, groupA{:}, groupB{:});Make sure that each column in your design matrix describes oneunit-of-observation, in the order in which the structs are passed intoft_freqstatistics.Best,EelkeOn 21 October 2014 03:41, Dylan DeLosAngeles > wrote:> Dear Eelke,>> Thank you for help regarding cluster-based permutation analysis of two ormore conditions.>> I am using time-frequency data (not time-lock structures). My firstproblem seems to be getting my 12 subjects into the 4D powspectrum.>> My code below loads 12 subjects from the first group, but I end up with a1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x3 frequencies x 2049 time points, rather than one struct with a 4D powspctrmwith 12 subjects as rows x electrodes x freqs x time points.>> for k = 1:Nmt, % states> for i = 1%:Ng, % groups> for j = 1:Ns, % subjects>> % load files> p(j) = eeg3.eeg.load(fullfile(fpath,fname2));>> % convert to eeglab to get channel locations> EEG(j) = eeg2eeglab( p(j));> EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile);>> % preprocessing in fieldtrip> d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing');>> % specify length of time to use in config> time = EEG(j).xmax-EEG(j).xmin;>> % setup configuration for freqanalysis> cfg = []; % clear cfg> cfg.output = 'pow';> cfg.channel = 'EEG';> cfg.method = 'mtmconvol';> cfg.taper = 'hanning';> cfg.foi = 0.5:3; % delta> cfg.toi = 1:0.05:time; % length of each state> cfg.t_ftimwin = 7./cfg.foi; % 7 cycles> cfg .keeptrials = 'yes';>> % do freqanalysis> freqdata(j) = ft_freqanalysis( cfg, d(j));> end> end> end>> My second problem is loading in the second group of 12 subjects and whatthat will look like when I run ft_freqstatistics.>> Lastly, I just want to confirm what you said in your previous email, thatI should be using indepsamplesF for more than two conditions (I have 11),and therefore my design should look like this;> 1 2 1 2 1 2 1 2 1 2 1 2 12 1 2 1 2 1 2 1 2 (two groups)> 1 1 2 2 3 3 4 4 5 5 6 6 77 8 8 9 9 10 10 11 11 (11 conditions)>> Any help would be appreciated.>> Kind regards,> Dylan>>>>> On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote:> Hello Dylan,>> You can analyse a between-subje cts design exactly as you would a> between-trials design (at least as far as the statistics step is> concerned), in both cases the two conditions correspond to two groups> of observations, and not to the same group of observations measured in> two separate conditions (which would be a within-UO design). In> FieldTrip, you would typically compute averages per subject, then use> an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic> (not depsamples). indepsamplesT only requires one row in the design> matrix, indicating the condition.>> Note that if you have e.g. timelock structures in two (or more) cell> arrays, corresponding to the conditions, you can input them into the> statistics function as follows:>> stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:});>> without having to call ft_timelockgrandaverage. In fact, the above is> the preferred way to do statistics now. (The same holds for> ft_freqstatistics.)>> Hope that helps,> Best,> Eelke>> On 24 September 2014 0 2:32, Dylan DeLosAngeles> >> wrote:>> Hello,>>>> So far, the tutorial on "Cluster-based permutation tests ontime-frequency>> data" has been very helpful.>>>> Out of the four combinations from the two UO-types (subjects and trials)and>> the two experimental designs (between- and within-UO), the tutorialcovers>> statistics on data in two conditions in a between-trials, in awithin-trials>> and in a within-subjects design. However, I am wondering if there is any>> information about the fourth type of experiment design: between-subjects.>>>> I have data for 2 groups with 12 subjects in each group. Both groups are>> measured during 11 conditions.>> Can I approach this in a similar fashion to within-subjects design(multiple>> subjects in multiple experimental conditions), such that my design is>> multiple groups in multiple experimental conditions. Is it a case offirst>> averaging over all trial s belonging to each of the experimentalconditions>> for each subject (as instructed in tutorial), and then averaging over all>> subjects in each group?>>>> Configuration code for setting up the design currently looks like this;>> grp = 2;>> subj = 11;>> design = zeros(2, subj*grp);>>>> for i = 1:grp>> design(1,i:2:end) = i;>> end>>>> idx = 1;>> for i = 1:subj>> design(2,idx:idx+1) = i;>> idx = idx+2;>> end>>>> Is there anything else I need to take into consideration when doing these>> statistics?>>>> Thank you,>> Dr Dylan DeLosAngeles>> Research Fellow>> Brain Signal Laboratory>> Flinders University>>>> _______________________________________________>> fieldtrip mailing list>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip> _______________________________________________> fieldtrip mailing list> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>_______________________________________________fieldtrip mailing listfieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 31 17:02:09 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 31 Oct 2014 16:02:09 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> References: , <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> Message-ID: Hi Emma, In this part: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); it says that the function 'fieldnames' doesn't know how to deal with data that is of the type double. This is because fieldnames expects your data to be in the format of a struct. I'm guessing there was just an error in your implementation because from your message you understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones for each participant. Furthermore, you need to put your source estimates in data.pow.avg. Based on your description, you might try something like this (but it's not guaranteed to work because I'm not entirely sure about the details of your data) data.pos = [902629x3 double] data.dim = [91 109 91] data.time = [1 x Z double] % vector of time points data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency x time points, depending on your data). As a side note, the size of your data will be quite taxing on computational memory so you might also want to consider using a lower spatial resolution. Finally, in the future, when describing your data, it would be best to show the structure of your data as shown in matlab (as done above), because this makes it easier for everyone else to see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community Best, Nietzsche From: Emma Holmes > Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Date: October 31, 2014 at 1:19:18 PM GMT+1 To: > Reply-To: FieldTrip discussion list > Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattmizumi at gmail.com Wed Oct 1 05:00:26 2014 From: mattmizumi at gmail.com (Matthijs van der Meer) Date: Tue, 30 Sep 2014 23:00:26 -0400 Subject: [FieldTrip] single-trial power correlation: why not? Message-ID: <542B6E4A.3090409@gmail.com> *Short version of question:* What can I do to get ft_connectivityanalysis to compute a power correlation for a single trial? Or is this a stupid question based on a misunderstanding of what this function is designed to do? Conceptually, there doesn't seem to be a problem with this, because if I have two signals I can compute the instantaneous power of each as a function of time for a given frequency, and correlate them. However, when calling ft_connectivityanalysis on the output of ft_freqanalysis with only one trial, an error is thrown. *Long version of question:* My data looks like this: hdr: [1x1 struct] label: {'X' 'Y'} fsample: 2000 trial: {1x351 cell} time: {1x351 cell} sampleinfo: [351x2 double] cfg: [1x1 struct] Now I run a frequency analysis on one trial: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.foi = 40:1:100; cfg.trials = 1; cfg.taper = 'hanning'; cfg.polyremoval = 1; cfg.channelcmb = {'X','Y'}; F = ft_freqanalysis(cfg,data_trl); Then I would like to do cfg = []; cfg.method = 'powcorr'; powcorr = ft_connectivityanalysis(cfg, F); But this gives this unhelpful error: Error using fixdimord (line 159) unexpected dimord "rpttapn_freq" Nosing around in ft_connectivityanalysis() suggests that the following line data = ft_selectdata(data, 'avgoverrpt', 'yes'); assumes that we want to average over repetitions (trials), which has unexpected results when there is only one trial. Skipping this line enables ft_connectivityanalysis() to run without errors, but the resulting power correlation has only NaNs. Any suggestions? I know I can do the whole thing manually with filtering and Hilbert transforms and such, or perhaps workaround by creating fake trials, but it would be useful to do this in ft neatly. From jm.horschig at donders.ru.nl Wed Oct 1 16:03:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 01 Oct 2014 16:03:38 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <542C09BA.4020501@donders.ru.nl> Hi Ana, from the first call with eventtype = '?', the output says > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' This means that there is one event type in our data, namely 'trigger', and the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. FieldTrip works that way that it passes on the cfg.trialdef structure to the trialfun that is specified. In your particular case, trialfun_bit2dec does not seem to have a very user-friendly error message, but the error message means that whatever eventtype and eventvalues you asked for, they are not present in your data. When looking at what you define, you can probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. However, checking back the output that you created with '?', there is no event type 'STATUS' in your data. Therefore, everything works fine with your trialfun. If you try specifying the trialdef properly, everything should work fine. A general advise when using an own trial fun and getting an error message: Try your code without specifying cfg.trialfun first. Then FieldTrip will use the standard trialfun, which should work if all your cfg-settings are fine. If the standard trialfun runs without errors, then your trialfun should do so too. If your trialfun, however, then crashes, the error is most likely in the trialfun that you used, and not in the cfg-settings. In your case, however, I am fairly certain that the cfg-settings you specified were causing your problem. I hope this helps. Best, Jörn On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > For a more simple check, when I try to read the events without the > trialfun ( so it uses ft_trialfun_general by default) I get the > original event values: > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 135 > evaluating trialfunction 'ft_trialfun_general' > reading the events from '27CW1.RAW' > the following events were found in the datafile > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' > no trials have been defined yet, see FT_DEFINETRIAL for further help > found 750 events > created 0 trials > the call to "ft_definetrial" took 4 seconds > > Then I try to use the trialfun, I get the same error > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialfun = 'trialfun_bit2dec'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > evaluating trialfunction 'trialfun_bit2dec' > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > So there is something the trialfun_bit2dec does that events cannot be > read anymore. > > > On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > wrote: > > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to > index an element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And > compare those with any of the ones falling under the switch case > statement? One way to do this, is to put a debug marker (red dot) > at the 'end' of the first for-loop (judging from the wiki). Then > check the value of event(i).value, and click the continue button > to move on to the next. An alternative way is to put a debug > marker after event = ft_read_event and to instantly check all > values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini > >: > > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini > > wrote: > > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = > 'saveonerror' and matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read > them with the raw data, they seem to be there, with the > DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk > > wrote: > > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]." > > that none of the triggers were found in your event > data. You might wanna check why this is happening, by > debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini > >: > > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I > followed your advice and I changed definetrial to > ft_definetrial and I confirm the function was > added to my paths. After doing this, the error I > get is: > > Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I > think I added what I think are useless lines but I > was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun > definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus > triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my > analysis because I would like to use only > Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > > wrote: > > Hi again Ana Laura, > > One other thing that I thought of was to make > sure that the function "trialfun_bit2dec" is > added to your paths in matlab, so that > ft_definetrial can find this function. > > By updating your fieldtrip to the most recent > version "trialfun_bit2dec" is *not* included. > So you'll need to store that as a separate .m > file in a location that can be accessed by the > paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > > > To: "FieldTrip discussion list" > > > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a > trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this > is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use > an old version of > > Fieldtrip for my scripts because I wrote > them long ago and this > > trialfun uses the new format (with > 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, > Nietzsche < > > n.lam at fcdonders.ru.nl > > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which > trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing > under "do the > > trial definition for the fully incongruent > (FIC) condition). > > > > Please try adding this: "cfg.trialfun = > 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see > below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% > trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error > message, it seemed that the > > problem was in the function > trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called > this function. I was > > wondering if the code you provide > corresponded to the code that > > created your error message? I'm guessing you > ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not > via definetrial). In which > > case, it was looking for > cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the > relevant information in > > the cfg (which is in the code you showed > us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < > diezmartini at gmail.com > > > > > To: "FieldTrip discussion list" < > fieldtrip at science.ru.nl > > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I > want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, > cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not > writing it in the correct part > > > of > > > my script. This is my trial definition > part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, > '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, > '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Nietzsche H.L. Lam, MSc > > PhD Candidate > > > > Max Planck Institute for Psycholinguistics > > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > > > Donders Institute for Brain, Cognition and > Behaviour, > > Centre for Cognitive Neuroimaging, > > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > > > n.lam at fcdonders.ru.nl > > > +31-24-3668219 > > > > > > neurobiologyoflanguage.com > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and > Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From sreenivasan.r.nadar at gmail.com Thu Oct 2 03:08:41 2014 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 1 Oct 2014 21:08:41 -0400 Subject: [FieldTrip] Preprocessing for Elekta Message-ID: Hello Robert, Is there any standard preprocessing script available for the Elekta MEG (306 sensors) system from your group? Thanks Regards, Sreenivasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 2 08:53:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 2 Oct 2014 08:53:18 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: Hi Sreenivasan, Just four days ago, Stephen posted the following to the list in response to an almost identical question: http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html Eelke On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. wrote: > Hello Robert, > > Is there any standard preprocessing script available for the Elekta MEG (306 > sensors) system from your group? > > Thanks > > Regards, > Sreenivasan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Thu Oct 2 10:34:49 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 2 Oct 2014 10:34:49 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Hi Sreenivasan, in addition to Eelke’s response you can also have a look here: http://fieldtrip.fcdonders.nl/getting_started/neuromag Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. best tzvetan > Hi Sreenivasan, > > Just four days ago, Stephen posted the following to the list in > response to an almost identical question: > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html > > Eelke > > On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. > wrote: >> Hello Robert, >> >> Is there any standard preprocessing script available for the Elekta MEG (306 >> sensors) system from your group? >> >> Thanks >> >> Regards, >> Sreenivasan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From spa268 at nyu.edu Thu Oct 2 12:37:47 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 2 Oct 2014 14:37:47 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eric, Thank you very much, this is what I had in mind! Best, Steve > > > Message: 1 > Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) > From: "Eric Maris" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Steve, > > > > Have a look here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests > > > > Best, > > > > Eric Maris > > > > From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] > Sent: woensdag 24 september 2014 11:18 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject > design > > > > Hi Eelke, > > > > Thanks for this information. I just wanted to jump in and ask: what about > for interactions in a mixed 2x2 design? For example, say I expect a > difference between conditions A and B for group 1, but not group 2. Would > the correct way to do this be to > > > > 1) make difference waves (A-B) for each participant, then > > 2) do a between-UO test on the difference waves using indepsamplesT? > > > > In the past I have always tested within-UO interactions using basically this > method (based on > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html ), > but I was under the impression that this is not OK for mixed designs (from > this post: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) > > > > Thanks, > > Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Thu Oct 2 14:24:39 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Thu, 2 Oct 2014 12:24:39 +0000 Subject: [FieldTrip] buffer.mexw64 not found Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.gwilliams at nyu.edu Thu Oct 2 16:02:12 2014 From: laura.gwilliams at nyu.edu (Laura Elizabeth Gwilliams) Date: Thu, 2 Oct 2014 18:02:12 +0400 Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system Message-ID: Dear Fieldtrippers, I am trying to run a time-frequency analysis, but I am having difficulty plotting the TFRs on the sensor arrays using ft_multiplotTFR. The reason for this is that I cannot find an appropriate *.lay file for my sensor array to use in the cfg.layout argument. I am using data from a Yokogawa MEG system with 208 channels. But when looking at the layout files available within fieldtrip, the "yokogawa440.lay" does not seem to have the correct number of sensors for my data. Do you know how I can either get my hands on the correct layout file, or create my own? I have looked at the tutorials for help (i.e., http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout) but this does not seem to solve my problem. It appears that I should be able to extract sensor information directly from my data to create my own .lay file, but there are no instructions on how to go about this. Any advice you can offer would be very much appreciated. Regards, Laura. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 2 16:23:11 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Thu, 2 Oct 2014 16:23:11 +0200 (CEST) Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system In-Reply-To: Message-ID: <1400667131.1960820.1412259791755.JavaMail.root@indus.zimbra.ru.nl> Hi Laura, Please take a look at this tutorial on creating a layout: http://fieldtrip.fcdonders.nl/tutorial/layout Best, Nietzsche ----- Original Message ----- > From: "Laura Elizabeth Gwilliams" > To: fieldtrip at science.ru.nl > Sent: Thursday, 2 October, 2014 4:02:12 PM > Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system > Dear Fieldtrippers, > > > I am trying to run a time-frequency analysis, but I am having > difficulty plotting the TFRs on the sensor arrays using > ft_multiplotTFR. The reason for this is that I cannot find an > appropriate *.lay file for my sensor array to use in the cfg.layout > argument. > > > I am using data from a Yokogawa MEG system with 208 channels. But when > looking at the layout files available within fieldtrip, the > "yokogawa440.lay" does not seem to have the correct number of sensors > for my data. > > > Do you know how I can either get my hands on the correct layout file, > or create my own? I have looked at the tutorials for help (i.e., > http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout ) but this > does not seem to solve my problem. It appears that I should be able to > extract sensor information directly from my data to create my own .lay > file, but there are no instructions on how to go about this. > > Any advice you can offer would be very much appreciated. > > > Regards, > Laura. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From r.oostenveld at donders.ru.nl Thu Oct 2 19:20:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 19:20:11 +0200 Subject: [FieldTrip] Fwd: Postdoc position, Stockholm, Sweden References: <71FFC072A22A7E448CD56F40BD593D677900EC95@KIMSX04.user.ki.se> Message-ID: <033EDCEA-66B1-464B-90C7-FC37BE3CA011@donders.ru.nl> Begin forwarded message: From: Daniel Lundqvist Subject: Postdoc position, Stockholm, Sweden English Postdoctoral Research Fellow in Magnetoencephalography (MEG) Karolinska Institutet, The Department of Clinical Neuroscience The Department of Clinical Neuroscience (CNS) conducts research and education in the field of neuroscience from the molecular level to the society level. The clinical research and education is conducted in collaboration with other research groups from the Karolinska Institutet, with other universities as well as the Stockholm County Council. Please visit our website for more information: ki.se/en/cns NatMEG – the National Facility for Magnetoencephalography (MEG) As of September 2013, Karolinska Institutet hosts a superbly equipped MEG lab. The lab, NatMEG, is a national facility, open for researchers from all across Sweden. The fact that NatMEG is a national facility is reflected by the wide array of projects currently ongoing/under initiation at NatMEG, covering areas such as next-generation SQUIDS, computational modelling, epilepsy work-ups, and cognitive neuroscience in the areas of memory, language, attention, perception, pain, music, decision making, emotion, autism, schizophrenia, Parkinson’s and Alzheimer’s disease, and more. The position as postdoctoral research fellow at NatMEG NatMEG currently have one post doc and three guest professors to support and initiate research at the lab. We are new expanding our team with another postdoc researcher. The 2 year position gives the researcher an unusual mix of inspiring interaction with researchers from a wide range of research areas and a freedom to pursuit one’s own qualified research questions. Please visit www.natmeg.se for more information. Duties The duties as a postdoc will consist of: Research and development of methods and analysis within MEG and EEG at the national infrastructure for magnetoencephalography (NatMEG), entailing some general operation. Scientific support to users at NatMEG, regarding methods, experimental design and analysis. The postdoc’s own qualified research within MEG, and/or simultaneous MEG & EEG. Entry requirements A person is eligible for a position as postdoctoral research fellow if he or she has obtained a PhD no more than seven years before the last date of employment as postdoc. It is highly valued if a candidate: Has strong skills and expertise in MEG analysis (preferably in FieldTrip and/or MNE). Has extensive MEG hands-on experience (preferably on an Elekta Triux or Vectorview system), with setting up experiments including peripheral stimulators. Has extensive hands-on experience from data collection, including system tuning, screening and subject preparations. Is independent, professional, and service minded, and enjoys interacting with researchers and research subjects. Has experience with psychophysiology measurements. Has experience with eye tracking measurements. Has a research interest within the cognitive neuroscience domain. Masters academic English It is also valued if a candidate: Has experience with MEG (and/or EEG) measurements on children, and on clinical populations such as Autism, Schizophrenia, Alzheimer's and Parkinson's disease, Has medical or psychology training Application process An employment application must contain the following documents in English or Swedish: 1. A complete curriculum vitae, including date of the thesis defence, title of the thesis, previous academic positions, academic title, current position, academic distinctions, and committee work 2. A clear description of how entry requirements are met 3. A complete list of publications 4. A summary of current work (no more than one page) 5. Verifications for crediting of illness, military service, work for labour unions or student organisations, parental leave or similar circumstances 6. Verification from the thesis defence committee or the equivalent (only if the thesis defence is scheduled within three months after the application deadline) The application is to be submitted in the MyNetwork recruitment system. Qualified candidates will initially be interviewed over Skype, and will also be asked to make a presentation of her/his research and research plans over Skype. The final evaluation of candidates may involve a lab visit and a formal interview at NatMEG and Karolinska Institutet. Karolinska Institutet is one of the world´s leading medical universities. Its mission is to contribute to the improvement of human health through research and education. Karolinska Institutet accounts for over 40 per cent of the medical academic research conducted in Sweden and offers the country´s broadest range of education in medicine and health sciences. Since 1901 the Nobel Assembly at Karolinska Institutet has selected the Nobel laureates in Physiology or Medicine. Pursuant to the regulations of the Swedish National Archives, applications are kept on file for two years after the appointment has gained legal force. The regulations do not apply to attachments that have been printed or otherwise published. Karolinska Institutet strives to provide a workplace that has approximately the same number of women and men, is free of discrimination and offers equal opportunity to everyone. For temp agencies and recruiters, and to salespersons: We politely, yet firmly, decline direct contact with temp agencies and recruiters, as well as those selling additional job announcements. Type of employment: Temporary position longer than 6 months Working hours: Full time Working hours: 100% City: Stockholm County: Stockholms län Country: Sweden Reference number: 2-3004/2014 Contact: 1. Daniel Lundqvist, Head of Unit, +46 8-524 832 62 2. Elin Johansson, HR Officer, +46 8-524 830 44 Union representative: 1. Arsalan Amir, SACO, 08 - 517 733 37, arsalan.amir at ki.se 2. Christina Hammarstedt, OFR, christina.hammarstedt at ki.se 3. Gunnar Stenberg, SEKO, 08-524 880 75 Published: 01.Oct.2014 Last application date: 21.Oct.2014 Return to job vacancies Application process Read more about the application process at http://ki.mynetworkglobal.com/en/what:job/jobID:43573/. Applications are to be submitted in the recruitment system MyNetwork. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8101 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 260 bytes Desc: not available URL: From russgport at gmail.com Thu Oct 2 20:10:58 2014 From: russgport at gmail.com (Russell G Port) Date: Thu, 2 Oct 2014 14:10:58 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data In-Reply-To: References: Message-ID: Dear All, Sorry for this repetitive email. I realize one I have asked this question before, I couldn't find the email before now, so I was not sure if it were the exact same question. Please ignore this email discussion. for those who were wondering here is the previous answer This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). Again thank is due to Dr. Schurger, and my apologizes On Tue, Sep 30, 2014 at 10:08 AM, Russell G Port wrote: > Hi All, > > I have a question, which I hope someone can help with. Currently I read in > my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins > for the length of the data. After proper removal of all jump and muscle > artifact, I apply ICA to the resample data (now 300Hz before it was > 1200Hz). This is just like fieldtrip's website suggests. Then I verify > which components I want to remove via topoplots and coherence in the time > domain with the ECG channels. So I now have the list of components that I > think are artifact and want removed. Can these components be applied for > rejection onto the same dataset, but differently parsed into epochs, now > trials being centered 1 second bins around a trigger? I am trying to see if > this works, because I hope if I include more data in the ICA analysis (all > data in the dataset) I will get a better components since there are more > trials to train the data on, rather than if I based trials around the > trigger. I guess what I want to know is if I can get better estimates of my > artifacts via using a larger dataset, and then apply then to the same > dataset just differently epoched? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Oct 2 21:53:16 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 2 Oct 2014 21:53:16 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Dear Anne, dear all, I did try to create a customized trialfunction serving my needs. This is what I came up with: function [trl, event] = response_trialfun(cfg); % read the header information and the events from the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); % search for "trigger" events value = [event(find(strcmp('ceck', {event.value}))).value]'; sample = [event(find(strcmp('ceck', {event.value}))).sample]'; % search for "trigger" events value2 = [event(find(strcmp('resp', {event.value}))).value]'; sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; % determine the number of samples before and after the trigger pretrig = -round(cfg.trialdef.prestim * hdr.Fs); posttrig = round(cfg.trialdef.poststim * hdr.Fs); % look for the combination of a trigger "7" followed by a trigger "64" % for each trigger except the last one trl = []; trlbegin = sample + pretrig trlend = sample + posttrig offset = pretrig RT = sample2 - sample newtrl = [trlbegin trlend RT]; trl = [trl; newtrl]; end In fact it seems to work, the trials look good and the RT is computed correctly. Only that after the preprocessing (with ft_preprocessing: %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] mov_data = ft_preprocessing(cfg); % ) there is no mov_data.trialinfo created. I thought that the information in trl above would be saved there. Without those I am not able to do the redefinition as planned (like Anne proposed: offset = (mov_data.trialinfo(:,3)); prestim = 0.75; poststim = 0.75; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); mov_data_small = ft_redefinetrial(cfg, mov_data); % then shift the time axis cfg = []; cfg.offset = -offset; mov_data_small = ft_redefinetrial(cfg, move_data_small); How come the information is not stored? Somebody an idea? Thanks a million Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 2 23:54:26 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 23:54:26 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> References: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Message-ID: <76680AE0-A354-4E90-ABC7-38AA915C9B03@donders.ru.nl> Hi Sreenivasan To follow up on the email from Stephen: Right at this moment we are running the workshop at the NatMEG in Stockholm. During this week we finished a number of dedicated tutorials that are based on data from the Elekta/Neuromag system. Besides MEG data, the tutorials also deal with simultaneously recorded EEG data. You can find them here http://fieldtrip.fcdonders.nl/tutorial/natmeg The accompanying tutorial data is not yet completely available from the ftp server, but will be made available in one of the upcoming weeks. Furthermore, it might be that the tutorial pages might move around on the wiki (and hence the URL might change) to fit them better in the existing content. Note that you should not take these or any other tutorials as “standard” scripts, nor as a recommendation of best practice. They serve as examples to teach how certain analyses work, but are still specific to one particular dataset in one particular experimental paradigm. In general the tutorials show how you *can* do the analysis, but not how you *should* do it. vänliga hälsningar, Robert On 02 Oct 2014, at 10:34, Tzvetan Popov wrote: > > Hi Sreenivasan, > in addition to Eelke’s response you can also have a look here: > > http://fieldtrip.fcdonders.nl/getting_started/neuromag > > Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. > best > tzvetan > > >> Hi Sreenivasan, >> >> Just four days ago, Stephen posted the following to the list in >> response to an almost identical question: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html >> >> Eelke >> >> On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. >> wrote: >>> Hello Robert, >>> >>> Is there any standard preprocessing script available for the Elekta MEG (306 >>> sensors) system from your group? >>> >>> Thanks >>> >>> Regards, >>> Sreenivasan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From boris.burle at univ-amu.fr Fri Oct 3 07:19:19 2014 From: boris.burle at univ-amu.fr (Boris BURLE) Date: Fri, 03 Oct 2014 07:19:19 +0200 Subject: [FieldTrip] Post-doc position Message-ID: <542E31D7.4070301@univ-amu.fr> Dear FieldTrip Users, The "Laboratoire de Neurosciences Cognitives" (Aix-Marseille Université, CNRS, Marseille, FR) is opening a post-doctoral position (EEG/MEG) to work on an ERC project aiming at deciphering pro-active and reactive cognitive control, within the team "Attention, Chronometry and Cortical Dynamics". Each position is offered for 12 months (first instance, potentially renewable). Applicants must have a PhD on Cognitive Neuroscience/Experimental Psychology (or related disciplines) and have a good knoedge on EEG and/or MEG processing. Knowledge on spatial analysis (CSD for EEG, inverse solution for EEG and MEG) is certainly a plus. Although not required, programming skills in high level scientific languages (Python, Matlab etc...) will be (highly) appreciated. The hosting group is equipped with several EEG systems (64 and 128 electrodes) and has access to a 248 magnetometers MEG system (4D Neuroimaging magnes 3600), coupled with an EEG system. When applying please indicate [post-doc EEG/MEG] in the subject of your mail. Salary will be adjusted based on experience, and will follow CNRS regulation (between 2000 and 2900€ net). The "Laboratoire de Neurosciences Cognitives" is embedded in a very active and large Brain Research community (the second largest in France), ranging from cellular physiology to social neurosciences. The hosting group has strong connections with the local Brain research community, and numerous international collaborations, that will benefit to the retained candidates. French speaking is not a requirement. Position starts as soon as possible, and will be opened until it is filled. Besides, Marseille is a very nice city in south of France, on the Mediterranean Sea, with a warm climate. It is also at about 1h30 from the Alps mountains, allowing easy access to hiking and winter sports. CV and motivation letters, along with informal enquiries, are to be sent to Boris BURLE (email: boris.burle at univ-amu.fr), with the appropriate subject heading (see above). All the best, B. Burle From m.goeldi at psychologie.uzh.ch Fri Oct 3 11:02:02 2014 From: m.goeldi at psychologie.uzh.ch (m.goeldi at psychologie.uzh.ch) Date: Fri, 3 Oct 2014 11:02:02 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming Message-ID: Hi fieldtrippers I am trying to do source localization for my EEG data with beamforming, but my results seem to indicate something has gone wrong. The subjects were exposed to a flickering screen of 14Hz so I expect atleast some activity in the visual cortex. The topoplot of a frequency analysis showed a 15Hz peak in the parietal area. The Problem: I always get extreme activity in a few voxels, usually around the fringes of my volume, several orders of magnitude larger than the rest. See attached figure 1. If I adjust the colorscale of my plot drastically i only get activity at the fringes of the brain/along the skull. See figure 2. This seems like a systematic error but at this point I am not sure where my error is. I am suspecting the forward/inverse model, the frequency analysis or my preprocessing pipeline. (So basically everything) I have created my source model using .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in fieldtrip and I have also tried to create the headmodel myself using .\fieldtrip-20140225\template\headmodel\standard_mri.mat. The results are slightly different as in where the extreme activities are, but qualitatively they are the same. A plot of the head and source model with the electrodes is attached in figure3. Source, head and electrodes seem to math up fine. The Questions: Is there something obviously wrong with my head/source model? Is there something wrong with how i calculate the cross spectral density matrix? And is there a way to visualize the output of ft_freqanalysis to do a sanity-check? Since there is no time dimension the ft plotting options don't work. Is there something wrong with my preprocessing pipeline? (Artifact rejection was done before using VisionAnalyzer2) Thanks in advance for your thoughts and inputs Cheers Maurice PS: Before submitting this I updated to the newest version of ft (20141002) to see if it was a version issue. It turns out that all the template files I had been using from my previous install (20140225) have vanished sometime inbetween. Is there a reason for this? Btw. I ran it with the new version and the old template files and the result is the same. Some Code: %% Preprocessing: cfg = [];                                           % empty configuration cfg.dataset                 = '..\Data\9 20131105 0928_Segmentation 3.dat';       % dataset  cfg.trialdef.eventtype      = 'Comment'; cfg.trialdef.prestim        = 0.3; cfg.trialdef.poststim       = 2; cfg.trialdef.eventvalue     = {'14HZ'}; cfg = ft_definetrial(cfg); % baseline correction cfg.demean = 'yes'; cfg.baselinewindow = [-0.3 0]; % rereference to avg over all cfg.reref = 'yes'; cfg.refchannel = 'all'; data = ft_preprocessing(cfg); % shifts and scales all channles of the the input data % to a mean of zero and a standard deviation of one. cfg = []; data = ft_channelnormalise(cfg,data); % load the manually realigned electrodes load('.\Data\electrodes_aligned.mat'); % Time window of interest cfg = [];                                           cfg.toilim = [0 2];                       dataPost = ft_redefinetrial(cfg, data); %% Calculating the cross spectral density matrix cfg            = []; cfg.method     = 'mtmfft'; cfg.taper = 'dpss'; cfg.output     = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq  = 2; cfg.foi        = 15; freqPost      = ft_freqanalysis(cfg, dataPost); %% The forward model and lead field matrix % load mri load('C:\Program Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') % make segments cfg          = []; segmentedmri = ft_volumesegment(cfg, mri); segmentedmri.transform = mri.transform; segmentedmri.anatomy   = mri.anatomy; %load template sourcemodel template = load('C:\Program Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); % compute source model cfg                = []; cfg.grid.warpmni   = 'yes'; cfg.grid.template  = template.sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri            = mri; sourcemodel        = ft_prepare_sourcemodel(cfg); % make headmodel cfg        = []; cfg.method = 'openmeeg'; hdm        = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); % lead field cfg                 = []; cfg.grid            = sourcemodel; cfg.elec            = elec; cfg.vol             = vol; cfg.channel = 'all'; cfg.normalize = 'yes';       % normalize instead of contrasting to noise estimate [grid] = ft_prepare_leadfield(cfg,freqPost); %% Source Analysis cfg              = []; cfg.elec         = elec; cfg.method       = 'dics'; cfg.frequency    = freqPost.freq;  cfg.grid         = grid; cfg.vol          = vol; cfg.keeptrials        = 'yes'; cfg.dics.lambda       = '10%'; cfg.dics.keepfilter   = 'yes'; cfg.dics.fixedori     = 'yes'; cfg.dics.realfilter   = 'yes'; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); cfg              = []; cfg.voxelcoord   = 'no'; cfg.parameter    = 'avg.pow'; cfg.interpmethod = 'nearest'; sourcePostInt_nocon  = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); % plot cfg              = []; cfg.method       = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; % cfg.funcolorlim   = [0.0 0.08]; % cfg.opacitylim    = [0.0 0.2]; cfg.opacitymap    = 'rampup'; ft_sourceplot(cfg,sourcePostInt_nocon); --- University of Zürich Maurice Göldi Department of Psychology Biopsychology Binzmühlestr. 14 / Box 5 CH - 8050 Z�rich Tel. +41 (0)44 635 74 55 www.psychologie.uzh.ch maurice.goeldi at uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Oct 3 11:25:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 03 Oct 2014 11:25:24 +0200 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> Message-ID: <542E6B84.2000106@donders.ru.nl> Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Fri Oct 3 11:27:15 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 3 Oct 2014 11:27:15 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: Hi Maurice, Having not read your post fully, the first thing that comes to mind is: are the units all in agreement for the geometric objects? I see you explicitly convert the headmodel to cm. You can apply the same function also to your source model, leadfield (probably redundant but can't hurt), and sensor definition. Does that help? Best, Eelke On 3 October 2014 11:02, wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, but > my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect atleast > some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the fringes of > my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at the > fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where my > error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities are, > but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact rejection > was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft (20141002) > to see if it was a version issue. > It turns out that all the template files I had been using from my previous > install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the result > is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation 3.dat'; > % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matt.craddock at uni-leipzig.de Fri Oct 3 12:11:29 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Fri, 03 Oct 2014 11:11:29 +0100 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: <542E7651.1040105@uni-leipzig.de> Hi Maurice, I think the problem is here: > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate Although the tutorial page says normalizing is an alternative to contrasting the noise estimate (http://fieldtrip.fcdonders.nl/tutorial/beamformer), it isn't - perhaps it should be, I don't know, but it doesn't make any difference currently as far as I can tell. Perhaps it does with MEG data. You'll get much more sensible results if you contrast against a noise estimate or another condition. So for example, try adding cfg.dics.projectnoise = 'yes'; when doing the source analysis step and looking at the NAI. You might also want to make sure the leadfield is generated using an alphabetical channel order if the channels in your data are not alphabetically ordered - see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 Cheers, Matt On 03/10/2014 10:02, m.goeldi at psychologie.uzh.ch wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, > but my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect > atleast some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the > fringes of my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at > the fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where > my error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities > are, but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact > rejection was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft > (20141002) to see if it was a version issue. > It turns out that all the template files I had been using from my > previous install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the > result is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation > 3.dat'; % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dr. Matt Craddock From diezmartini at gmail.com Sun Oct 5 22:34:35 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 5 Oct 2014 10:34:35 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <542C09BA.4020501@donders.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> <542C09BA.4020501@donders.ru.nl> Message-ID: Hi Jorn and all, As I said before, everything works ok when I use ft_trialfun_general instead of this trialfun. However, it is crucial for me to transform the event values with that trialfun. And now I use 'trigger' instead of 'STATUS' but it doesn't change much. Any other idea? THANK YOU! This is my script again: % CONGRUENT TRIALS DEFINITION cfg = [ ] ; cfg.dataset = 'location'; event = ft_read_event('location'); cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialfun = 'trialfun_bit2dec'; [cfg] = ft_definetrial(cfg); On Wed, Oct 1, 2014 at 4:03 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Ana, > > from the first call with eventtype = '?', the output says > >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> > > This means that there is one event type in our data, namely 'trigger', and > the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. > FieldTrip works that way that it passes on the cfg.trialdef structure to > the trialfun that is specified. In your particular case, trialfun_bit2dec > does not seem to have a very user-friendly error message, but the error > message means that whatever eventtype and eventvalues you asked for, they > are not present in your data. When looking at what you define, you can > probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. > However, checking back the output that you created with '?', there is no > event type 'STATUS' in your data. Therefore, everything works fine with > your trialfun. If you try specifying the trialdef properly, everything > should work fine. > > A general advise when using an own trial fun and getting an error message: > Try your code without specifying cfg.trialfun first. Then FieldTrip will > use the standard trialfun, which should work if all your cfg-settings are > fine. If the standard trialfun runs without errors, then your trialfun > should do so too. If your trialfun, however, then crashes, the error is > most likely in the trialfun that you used, and not in the cfg-settings. In > your case, however, I am fairly certain that the cfg-settings you specified > were causing your problem. > > I hope this helps. > Best, > Jörn > > > > > On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > >> For a more simple check, when I try to read the events without the >> trialfun ( so it uses ft_trialfun_general by default) I get the original >> event values: >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> >> Warning: no trialfun was specified, using ft_trialfun_general >> > In ft_definetrial at 135 >> evaluating trialfunction 'ft_trialfun_general' >> reading the events from '27CW1.RAW' >> the following events were found in the datafile >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> no trials have been defined yet, see FT_DEFINETRIAL for further help >> found 750 events >> created 0 trials >> the call to "ft_definetrial" took 4 seconds >> >> Then I try to use the trialfun, I get the same error >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialfun = 'trialfun_bit2dec'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> evaluating trialfunction 'trialfun_bit2dec' >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> So there is something the trialfun_bit2dec does that events cannot be >> read anymore. >> >> >> On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > a.stolk8 at gmail.com>> wrote: >> >> Hi Ana Laura, >> >> Your 'trl' is empty, which it shouldn't be. So anytime you try to >> index an element in it, it will throw an error. >> >> Can you check what 'event.values' you find in your dataset? And >> compare those with any of the ones falling under the switch case >> statement? One way to do this, is to put a debug marker (red dot) >> at the 'end' of the first for-loop (judging from the wiki). Then >> check the value of event(i).value, and click the continue button >> to move on to the next. An alternative way is to put a debug >> marker after event = ft_read_event and to instantly check all >> values of event with "[event(:).value]". >> >> Goodluck, >> Arjen >> >> 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini >> >: >> >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini >> > wrote: >> >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = >> 'saveonerror' and matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read >> them with the raw data, they seem to be there, with the >> DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk >> > wrote: >> >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]." >> >> that none of the triggers were found in your event >> data. You might wanna check why this is happening, by >> debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >> >> >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I >> followed your advice and I changed definetrial to >> ft_definetrial and I confirm the function was >> added to my paths. After doing this, the error I >> get is: >> >> Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I >> think I added what I think are useless lines but I >> was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun >> definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus >> triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my >> analysis because I would like to use only >> Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> > > wrote: >> >> Hi again Ana Laura, >> >> One other thing that I thought of was to make >> sure that the function "trialfun_bit2dec" is >> added to your paths in matlab, so that >> ft_definetrial can find this function. >> >> By updating your fieldtrip to the most recent >> version "trialfun_bit2dec" is *not* included. >> So you'll need to store that as a separate .m >> file in a location that can be accessed by the >> paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > > >> > To: "FieldTrip discussion list" >> > > >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a >> trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this >> is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use >> an old version of >> > Fieldtrip for my scripts because I wrote >> them long ago and this >> > trialfun uses the new format (with >> 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, >> Nietzsche < >> > n.lam at fcdonders.ru.nl >> > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which >> trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > >> http://fieldtrip.fcdonders.nl/ >> tutorial/preprocessing >> under "do the >> > trial definition for the fully incongruent >> (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = >> 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see >> below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% >> trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error >> message, it seemed that the >> > problem was in the function >> trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called >> this function. I was >> > wondering if the code you provide >> corresponded to the code that >> > created your error message? I'm guessing you >> ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not >> via definetrial). In which >> > case, it was looking for >> cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the >> relevant information in >> > the cfg (which is in the code you showed >> us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < >> diezmartini at gmail.com >> > >> > > To: "FieldTrip discussion list" < >> fieldtrip at science.ru.nl >> > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I >> want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/ >> faq/how_can_i_transform_trigger_values_from_bits_to_ >> decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, >> cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not >> writing it in the correct part >> > > of >> > > my script. This is my trial definition >> part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, >> '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, >> '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > >> _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> >> > > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > -- >> > Nietzsche H.L. Lam, MSc >> > PhD Candidate >> > >> > Max Planck Institute for Psycholinguistics >> > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> > >> > Donders Institute for Brain, Cognition and >> Behaviour, >> > Centre for Cognitive Neuroimaging, >> > Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> > >> > n.lam at fcdonders.ru.nl >> >> > +31-24-3668219 >> > >> > >> > neurobiologyoflanguage.com >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> -- >> Nietzsche H.L. Lam, MSc >> PhD Candidate >> >> Max Planck Institute for Psycholinguistics >> Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> >> Donders Institute for Brain, Cognition and >> Behaviour, >> Centre for Cognitive Neuroimaging, >> Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> >> n.lam at fcdonders.ru.nl >> >> +31-24-3668219 >> >> >> neurobiologyoflanguage.com >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 09:16:45 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 09:16:45 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Message-ID: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 11:46:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 11:46:55 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser In-Reply-To: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> References: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Message-ID: <021c01cfe14a$76c18fe0$6444afa0$@vanpelt@fcdonders.ru.nl> For everyone's information, I have found a solution based on a post some 4 years ago related to ft_resampledata (http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003095.ht ml). To make the ICA and artifact data align, the trl-field of the ICA-data needs to be 'resampled', as well as the artifact-samples: % i. Downsample data resamplefs = 150; cfg = []; cfg.resamplefs = resamplefs; cfg.detrend = 'no'; data150 = ft_resampledata(cfg, data); % 'Downsample' trial information to make trial start/end samplenrs correspond to artifact samplenrs data150.cfg.previous.trl(:,1:3) = round(data150.cfg.previous.trl(:,1:3) * (1/fs) * resamplefs); % ii. run ICA on downsampled data cfg = []; cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB cfg.channel = 'MEG'; cfg.runica.maxsteps = 120; eval(['comp150',num2str(n),'= ft_componentanalysis(cfg, data150);']); % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=ceil(art_eog_all*(resamplefs/fs)); % 'resample' artifact data cfg.artfctdef.muscle.artifact=ceil(art_muscle_all*(resamplefs/fs)); % 'resample' artifact data % visual inspection ft_databrowser(cfg, comp150',num2str(n),'); % 'Upsample' trial information again to original data150.cfg.previous.trl(:,1:3) = data.cfg.trl(:,1:3); Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Stan van Pelt Sent: maandag 6 oktober 2014 9:17 To: 'FieldTrip discussion list' Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Mon Oct 6 15:17:04 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Mon, 6 Oct 2014 13:17:04 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <542E6B84.2000106@donders.ru.nl> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... >> compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From giulia.rizza at tiscali.it Mon Oct 6 17:47:50 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Mon, 06 Oct 2014 17:47:50 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS Message-ID: <78737852a684659ce9b485523d53b552@tiscali.it> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed, as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Thank you so much for any help Giulia Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at fcdonders.ru.nl Mon Oct 6 17:56:36 2014 From: robert.oostenveld at fcdonders.ru.nl (Oostenveld, R. (Robert)) Date: Mon, 6 Oct 2014 15:56:36 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Message-ID: Hi Beth, The buffer.mexw64 file is present in the fieldtrip release. I suspect your initial problem is that a DLL is not being found, i.e. MATLAB loads the mex file as a dynamic link library (dll), and in that process there are some other dlls that also have to be loaded. You could diagnose this further with http://www.dependencywalker.com and the solution might be as simple as getting the correct MSVC dll (which is installed by default on some Windows versions, but not on others). Recompiling the buffer mex file on windows (esp 64) bit is not trivial, but you can find some hints onhttp://fieldtrip.fcdonders.nl/development/realtime/reference_implementation#compiling_the_code best Robert On 06 Oct 2014, at 15:17, Elizabeth Anne Bock, Ms > wrote: Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From cas243 at georgetown.edu Mon Oct 6 20:19:11 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Mon, 6 Oct 2014 14:19:11 -0400 Subject: [FieldTrip] grand average with dimord chan_chan_freq_time Message-ID: Dear FieldTrip Community, What's the best strategy for generating grand averages when data have dimord chan_chan_freq_time (output of ft_connectivityanalysis for method granger)? It appears that chan_chan_freq_time is an unsupported dimord in ft_freqgrandaverage. Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Oct 7 15:42:53 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Tue, 07 Oct 2014 15:42:53 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions Message-ID: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Dear fieldtripers, I would like to compare to conditions of an auditory oddball paradigm (target tones and standard tones). For the identification of the electrodes which show the biggest P300, I would like to use cluster based permutation test, i.e. I want to use ft_timelockstatistics, to identify the clusters with a significant difference between the target and the standardtones. Important: I don't want to do a group statistic, but I want to compare these two conditions within each subject, to identify interesting clusters for each subject separately. I wrote the script following the tutorials on the fieldtrip homepage. I already wrote a code but it does not work: %% for i = 3:10 % subject number mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' cd(mypfad) cd Kontrollen; List = dir cd (List(i).name); for j = 1:4 %session number cd (mypfad); cd Kontrollen; List = dir cd (List(i).name); eval(['cd M' num2str(j)]); load cleandata_tlt; %preprocessed timelocked data standardclean_tlt and targetclean_tlt cfg = [] cfg.neighbourdist = .09; cfg.layout= ulmegilay; cfg.method = 'distance'; Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) cfg = [] cfg.method = 'montecarlo' ; %significance probability cfg.statistic = 'ft_statfun_depsamplesT' cfg.correctm = 'cluster' cfg.clusteralpha = 0.05 %alpha level of the sample specific test statistic that will % be used for thresholding cfg.clusterstatistic = 'maxsum' cfg.minnbchan = 4 cfg.latency = [0.25 0.8] cfg.neighbours = Neighbours cfg.tail = 0 cfg.clustertail = 0 cfg.alpha = 0.025 cfg.numrandomization = 1000 design = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)]) cfg.design = design cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]' cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)] tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, standardclean_tlt ) cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; cd Kontrollen; List2 = dir cd (List2(i).name); eval(['cd M' num2str(j)]); save statnew tlt_statsnew end end This is what gets displayed while running the script: selected 245 channels selected 139 time bins selected 1 frequency bins using "ft_statistics_montecarlo" for the statistical testing using "ft_statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 189 total number of variables = 1 number of independent variables = 189 number of unit variables = 189 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach Then, this error occurs: Error using resampledesign (line 168) A within-units shuffling requires a at least one unit variable and at least one independent variable Error in ft_statistics_montecarlo (line 241) resample = resampledesign(cfg, design); Error in statistics_wrapper (line 310) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_timelockstatistics (line 113) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I have no clue where I made a mistake. I have unit variables and independent variables (189 if I understand it correctly). Is there anything I am missing? Any additional information or is the design matrix wrong? I really appreciate your help. Best regards, Barbara Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Tue Oct 7 15:55:36 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Tue, 7 Oct 2014 09:55:36 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions In-Reply-To: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> References: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Message-ID: Dear Barbara, Just three thoughts: 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension of the design matrix that contains the independent and unit variables? Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the design matrix). 2) I think the design matrix itself might be off, right now it just seems to have dimensions of 1 x (# targets+standards). It should have a second dimension which counts the # of trials, something like: design(1,:) = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial ,1)]) 3) Since this is a design where each trial is an observation, I think you should be using indepsamplesT for cfg.statistic (the trials aren't paired and there aren't necessarily identical #'s of trials for each condition. What do you think? Respectfully, Clara On Tue, Oct 7, 2014 at 9:42 AM, wrote: > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, I > would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting clusters > for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific test > statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 7 21:07:37 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 7 Oct 2014 21:07:37 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: <78737852a684659ce9b485523d53b552@tiscali.it> References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Giulia, > Dear Fieldtrippers > I'm writing to ask you some help on data in a single subject study. > I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. > I'm not sure how to proceed What you are referring to is a “between trial experiment” which is described in this tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq One possible way to go is to compute the TFR’s with cfg.keeptrials = ‘yes’. Next you’d treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Also please type “actvsblT” in the search bar and then click on “Search the FieldTrip mailing list”. There you’ll find some info about this. best tzvetan From giulia.rizza at tiscali.it Wed Oct 8 10:45:23 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Wed, 08 Oct 2014 10:45:23 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Tzvetan Thank you so much for your reply I will try these functions keeping in mind your explanation Best regards Giulia Il 07.10.2014 21:07 Tzvetan Popov ha scritto: > Hi Giulia, > >> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed > > What you are referring to is a "between trial experiment" which is described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] > One possible way to go is to compute the TFR's with cfg.keeptrials = 'yes'. Next you'd treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html [2] > >> , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. > > Also please type "actvsblT" in the search bar and then click on "Search the FieldTrip mailing list". There you'll find some info about this. > > best > tzvetan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl [3] > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Oct 8 13:31:46 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 08 Oct 2014 13:31:46 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: References: Message-ID: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Dear Clara, thank you for your comments. I ran it as an independent samples Test (it is true, that this is the correct way). I also changed the design matrix to cfg.design = [ones(1,size(targetclean_tlt.trial,1)) 2*ones(1,size(standardclean_tlt.trial,1))] It works and there are no more error messages. However, when it displays the progress of the calculation there is the field: total number of observations, total number of variables and number of independent variables. It recognizes correctly that there are 185 trials in total (both conditions together). But it only counts 1 variable and 1 independent variable. Shouldn't it recognize 2 variables as I have 2 conditions? Best regards, Barbara Zitat von fieldtrip-request at science.ru.nl: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Problem with ft_timelockstatistics, within subject comparison > of two conditions (barbara.schorr at uni-ulm.de) > 2. Re: Problem with ft_timelockstatistics, within subject > comparison of two conditions (Clara A. Scholl) > 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) > 4. Re: help for statistics on ERD/ERS (Giuly) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 07 Oct 2014 15:42:53 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, > I would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting > clusters for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific > test statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > Message: 2 > Date: Tue, 7 Oct 2014 09:55:36 -0400 > From: "Clara A. Scholl" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Barbara, > > Just three thoughts: > > 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension > of the design matrix that contains the independent and unit variables? > Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the > design matrix). > > 2) I think the design matrix itself might be off, right now it just seems > to have dimensions of 1 x (# targets+standards). It should have a second > dimension which counts the # of trials, something like: > > design(1,:) = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial > ,1)]) > > 3) Since this is a design where each trial is an observation, I think you > should be using indepsamplesT for cfg.statistic (the trials aren't paired > and there aren't necessarily identical #'s of trials for each condition. > > What do you think? > Respectfully, > Clara > > > On Tue, Oct 7, 2014 at 9:42 AM, wrote: > >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, I >> would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting clusters >> for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >> statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 7 Oct 2014 21:07:37 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Hi Giulia, > > >> Dear Fieldtrippers >> I'm writing to ask you some help on data in a single subject study. >> I did a time frequency decomposition and I would like to do a >> statistic to state whether the average TFR has significant ERD/ERS >> or not. >> I'm not sure how to proceed > What you are referring to is a ?between trial experiment? which is > described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > One possible way to go is to compute the TFR?s with cfg.keeptrials = > ?yes?. Next you?d treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you > can compute the statistical comparison in a similar fashion as > described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. > Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> , as a first step I compared the single trial baseline with the >> respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it >> is the correct way. > Also please type ?actvsblT? in the search bar and then click on > ?Search the FieldTrip mailing list?. There you?ll find some info > about this. > > best > tzvetan > > > > > ------------------------------ > > Message: 4 > Date: Wed, 08 Oct 2014 10:45:23 +0200 > From: Giuly > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Tzvetan > Thank you so much for your reply > I will try these > functions keeping in mind your explanation > Best regards > Giulia > > Il > 07.10.2014 21:07 Tzvetan Popov ha scritto: > >> Hi Giulia, >> >>> Dear > Fieldtrippers I'm writing to ask you some help on data in a single > subject study. I did a time frequency decomposition and I would like to > do a statistic to state whether the average TFR has significant ERD/ERS > or not. I'm not sure how to proceed >> >> What you are referring to is a > "between trial experiment" which is described in this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> > One possible way to go is to compute the TFR's with cfg.keeptrials = > 'yes'. Next you'd treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you can > compute the statistical comparison in a similar fashion as described in > the tutorial. >> Keep in mind that you have to cut the data into equal > lengths. Please have a look at this post : >> > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > [2] >> >>> , as a first step I compared the single trial baseline with > the respective event, with a t-test for each condition and band of > interest but I'm not really sure if this is enough and anyway if it is > the correct way. >> >> Also please type "actvsblT" in the search bar and > then click on "Search the FieldTrip mailing list". There you'll find > some info about this. >> >> best >> tzvetan >> >> > _______________________________________________ >> fieldtrip mailing > list >> fieldtrip at donders.ru.nl [3] >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] > > > > > Scopri istella, il nuovo motore per il web italiano. > Istella garantisce risultati di qualit? e la possibilit? di > condividere, in modo semplice e veloce, documenti, immagini, audio e > video. > Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Oct 8 17:21:12 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 8 Oct 2014 11:21:12 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> References: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Message-ID: Dear Barbara, I think you are right, the clustering output should report total number of variables=2 (and the total # of measurements = 185 trials, number of independent variables=1, and number of unit variables=1). I think your design matrix should have two rows, rather than 1. For example, if you had 5 trials total (2 of 1 trial type, 3 of the other trial type), you'd specify the design matrix: 1 2 3 1 2 1 1 1 2 2 Where cfg.uvar=1 and cfg.ivar=2. Row two is what you are specifying for design currently. Row 1 counts the observations of each trials (1:numTrialType1 1:numTrialType2). Does that help? Respectfully, Clara On Wed, Oct 8, 2014 at 7:31 AM, wrote: > Dear Clara, > > thank you for your comments. > > I ran it as an independent samples Test (it is true, that this is the > correct way). > I also changed the design matrix to > cfg.design = [ones(1,size(targetclean_tlt.trial,1)) > 2*ones(1,size(standardclean_tlt.trial,1))] > > It works and there are no more error messages. However, when it displays > the progress of the calculation there is the field: total number of > observations, total number of variables and number of independent > variables. It recognizes correctly that there are 185 trials in total (both > conditions together). But it only counts 1 variable and 1 independent > variable. Shouldn't it recognize 2 variables as I have 2 conditions? > > Best regards, > Barbara > > > Zitat von fieldtrip-request at science.ru.nl: > > Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Problem with ft_timelockstatistics, within subject comparison >> of two conditions (barbara.schorr at uni-ulm.de) >> 2. Re: Problem with ft_timelockstatistics, within subject >> comparison of two conditions (Clara A. Scholl) >> 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) >> 4. Re: help for statistics on ERD/ERS (Giuly) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 07 Oct 2014 15:42:53 +0200 >> From: barbara.schorr at uni-ulm.de >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> >> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; >> format="flowed" >> >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, >> I would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting >> clusters for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific >> test statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at >> least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 7 Oct 2014 09:55:36 -0400 >> From: "Clara A. Scholl" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: >> > gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> Dear Barbara, >> >> Just three thoughts: >> >> 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension >> of the design matrix that contains the independent and unit variables? >> Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the >> design matrix). >> >> 2) I think the design matrix itself might be off, right now it just seems >> to have dimensions of 1 x (# targets+standards). It should have a second >> dimension which counts the # of trials, something like: >> >> design(1,:) = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design(2,:)= ([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial >> ,1)]) >> >> 3) Since this is a design where each trial is an observation, I think you >> should be using indepsamplesT for cfg.statistic (the trials aren't paired >> and there aren't necessarily identical #'s of trials for each condition. >> >> What do you think? >> Respectfully, >> Clara >> >> >> On Tue, Oct 7, 2014 at 9:42 AM, wrote: >> >> Dear fieldtripers, >>> >>> I would like to compare to conditions of an auditory oddball paradigm >>> (target tones and standard tones). >>> For the identification of the electrodes which show the biggest P300, I >>> would like to use cluster based permutation test, i.e. I want to use >>> ft_timelockstatistics, to identify the clusters with a significant >>> difference between the target and the standardtones. >>> Important: I don't want to do a group statistic, but I want to compare >>> these two conditions within each subject, to identify interesting >>> clusters >>> for each subject separately. >>> >>> >>> I wrote the script following the tutorials on the fieldtrip homepage. >>> >>> I already wrote a code but it does not work: >>> %% >>> >>> for i = 3:10 % subject number >>> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >>> cd(mypfad) >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> for j = 1:4 %session number >>> cd (mypfad); >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> eval(['cd M' num2str(j)]); >>> load cleandata_tlt; %preprocessed timelocked data >>> standardclean_tlt and targetclean_tlt >>> >>> cfg = [] >>> cfg.neighbourdist = .09; >>> cfg.layout= ulmegilay; >>> cfg.method = 'distance'; >>> >>> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >>> >>> cfg = [] >>> cfg.method = 'montecarlo' ; %significance probability >>> cfg.statistic = 'ft_statfun_depsamplesT' >>> cfg.correctm = 'cluster' >>> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >>> statistic that will >>> % be used for thresholding >>> cfg.clusterstatistic = 'maxsum' >>> cfg.minnbchan = 4 >>> cfg.latency = [0.25 0.8] >>> cfg.neighbours = Neighbours >>> cfg.tail = 0 >>> cfg.clustertail = 0 >>> cfg.alpha = 0.025 >>> cfg.numrandomization = 1000 >>> >>> design = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]'; >>> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >>> trial,1)]) >>> >>> >>> cfg.design = design >>> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]' >>> cfg.uvar = [1:size(targetclean_tlt.trial) >>> 1:size(standardclean_tlt. >>> trial,1)] >>> >>> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >>> standardclean_tlt ) >>> >>> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >>> cd Kontrollen; >>> List2 = dir >>> cd (List2(i).name); >>> eval(['cd M' num2str(j)]); >>> save statnew tlt_statsnew >>> >>> end >>> end >>> >>> >>> This is what gets displayed while running the script: >>> >>> selected 245 channels >>> selected 139 time bins >>> selected 1 frequency bins >>> using "ft_statistics_montecarlo" for the statistical testing >>> using "ft_statfun_depsamplesT" for the single-sample statistics >>> constructing randomized design >>> total number of measurements = 189 >>> total number of variables = 1 >>> number of independent variables = 189 >>> number of unit variables = 189 >>> number of within-cell variables = 0 >>> number of control variables = 0 >>> using a permutation resampling approach >>> >>> Then, this error occurs: >>> >>> Error using resampledesign (line 168) >>> A within-units shuffling requires a at least one unit variable and at >>> least >>> one independent variable >>> >>> Error in ft_statistics_montecarlo (line 241) >>> resample = resampledesign(cfg, design); >>> >>> Error in statistics_wrapper (line 310) >>> [stat, cfg] = statmethod(cfg, dat, design); >>> >>> Error in ft_timelockstatistics (line 113) >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> I have no clue where I made a mistake. I have unit variables and >>> independent variables (189 if I understand it correctly). >>> Is there anything I am missing? Any additional information or is the >>> design matrix wrong? >>> >>> >>> I really appreciate your help. >>> >>> Best regards, >>> Barbara >>> >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141007/64be64b4/attachment-0001.html> >> >> ------------------------------ >> >> Message: 3 >> Date: Tue, 7 Oct 2014 21:07:37 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset=windows-1252 >> >> Hi Giulia, >> >> >> Dear Fieldtrippers >>> I'm writing to ask you some help on data in a single subject study. >>> I did a time frequency decomposition and I would like to do a statistic >>> to state whether the average TFR has significant ERD/ERS or not. >>> I'm not sure how to proceed >>> >> What you are referring to is a ?between trial experiment? which is >> described in this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> One possible way to go is to compute the TFR?s with cfg.keeptrials = >> ?yes?. Next you?d treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> Keep in mind that you have to cut the data into equal lengths. Please >> have a look at this post : >> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> >>> , as a first step I compared the single trial baseline with the >>> respective event, with a t-test for each condition and band of interest >>> but I'm not really sure if this is enough and anyway if it is the correct >>> way. >>> >> Also please type ?actvsblT? in the search bar and then click on ?Search >> the FieldTrip mailing list?. There you?ll find some info about this. >> >> best >> tzvetan >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 08 Oct 2014 10:45:23 +0200 >> From: Giuly >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Tzvetan >> Thank you so much for your reply >> I will try these >> functions keeping in mind your explanation >> Best regards >> Giulia >> >> Il >> 07.10.2014 21:07 Tzvetan Popov ha scritto: >> >> Hi Giulia, >>> >>> Dear >>>> >>> Fieldtrippers I'm writing to ask you some help on data in a single >> subject study. I did a time frequency decomposition and I would like to >> do a statistic to state whether the average TFR has significant ERD/ERS >> or not. I'm not sure how to proceed >> >>> >>> What you are referring to is a >>> >> "between trial experiment" which is described in this tutorial: >> >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> >>> >>> One possible way to go is to compute the TFR's with cfg.keeptrials = >> 'yes'. Next you'd treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> >>> Keep in mind that you have to cut the data into equal >>> >> lengths. Please have a look at this post : >> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> [2] >> >>> >>> , as a first step I compared the single trial baseline with >>>> >>> the respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it is >> the correct way. >> >>> >>> Also please type "actvsblT" in the search bar and >>> >> then click on "Search the FieldTrip mailing list". There you'll find >> some info about this. >> >>> >>> best >>> tzvetan >>> >>> >>> _______________________________________________ >> >>> fieldtrip mailing >>> >> list >> >>> fieldtrip at donders.ru.nl [3] >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] >> >> >> >> >> Scopri istella, il nuovo motore per il web italiano. >> Istella garantisce risultati di qualit? e la possibilit? di condividere, >> in modo semplice e veloce, documenti, immagini, audio e video. >> Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141008/ff2ad283/attachment-0001.html> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 47, Issue 6 >> **************************************** >> >> > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 11:51:45 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 11:51:45 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size Message-ID: <54365AB1.8040507@uni-tuebingen.de> Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: surfaceplot before 7mb after 220mb.jpg Type: image/jpeg Size: 156292 bytes Desc: not available URL: From dao4free at gmail.com Thu Oct 9 12:19:19 2014 From: dao4free at gmail.com (Pavel Goldstein) Date: Thu, 9 Oct 2014 13:19:19 +0300 Subject: [FieldTrip] Dealing with artifacts in continuous EEG data before Granger Causality analysis Message-ID: Dear FieldTrip list, I'm planning to apply Granger Causality (GC) models to my continuous EEG data, but I'm not sure about the preprocessing steps. I have read an article about filtering EEG data before GC analysis, but still it is not clear for me how to deal with removing some data segments with strong artifacts. Right now I'm planning to clean the data (2-minutes trials) by removing the artifacts using visual detection (+filtering notch+detrending) followed by GC analysis using 2 sec. windows (actually the final length of the windows should be identified by VAR model) . Using such preprocessing approach I would receive continuous data with "gaps" therefore some 2-sec segments may consist of the mixed data before and after the removed part. Such situations seem to me not appropriate for GC analysis. As a possible solutions I thought about 1) removing these mixed segments or 2) Dividing raw data (before artifacts rejection) on 2-sec segments and to remove completely such segments that will contain an artifact. Do I miss something? I would appreciate your advice on this matter. Thanks, Pavel -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Thu Oct 9 13:46:57 2014 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Thu, 9 Oct 2014 13:46:57 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" < jens.klinzing at uni-tuebingen.de>: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 18:32:07 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 18:32:07 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: <5436B887.9090305@uni-tuebingen.de> Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite > large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen > cases in which the size went from 13 GB to 150 MB just by clearing the > cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" > >: > > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies > to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same > but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer > ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my > ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the > renderer. > > I am sure it is something very simple and I'm just too blind to > see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Oct 9 19:06:15 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 9 Oct 2014 17:06:15 +0000 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: <5436B887.9090305@uni-tuebingen.de> References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: Hi Jens, It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. Best, Arjen -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] Sent: Thursday, October 09, 2014 6:32 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jens.klinzing at uni-tuebingen.de Thu Oct 9 19:44:18 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 19:44:18 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: <5436C972.1070709@uni-tuebingen.de> Hi Arjen, that's good news! Thanks for your help, Jens Am 09.10.2014 19:06, schrieb Stolk, A. (Arjen): > Hi Jens, > > It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. > > Best, > Arjen > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > ________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] > Sent: Thursday, October 09, 2014 6:32 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size > > Hi Erik, > wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). > > I still have a brain with a very dark color, though. Does anyone know how to get rid of that? > Why would these things change without an obvious reason? > > Thanks for your help, Eric!! > All the best, > Jens > > Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From N.Jain at tudelft.nl Fri Oct 10 14:10:30 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 10 Oct 2014 12:10:30 +0000 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DEE96@SRV384.tudelft.net> Hi Ricarda, I’m currently using .bdf files. EXG is for external signals like eye blinks or even EMG. You want to ideally remove the really bad channels from your signals first, then re-reference them to all electrodes (common average rereferencing). The really high vertical scale you’re seeing is due to digital trigger signals, I think. Just get rid of EXG, GSR etc electrodes, keep only the EEG electrodes. Then proceed with channel/trial rejection! Best of luck, Nishant Jain. TU Delft, Netherlands. From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: dinsdag 23 september 2014 16:34 To: FieldTrip discussion list Subject: Re: [FieldTrip] Reading in .bdf files Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann > wrote: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Sat Oct 11 03:58:49 2014 From: zriouil.imane at gmail.com (ZRIOUIL Imane) Date: Sat, 11 Oct 2014 01:58:49 +0000 Subject: [FieldTrip] Convert data .txt to .BDF? Message-ID: <4EA73B63-41EE-48E4-BA14-A9E7A89B3D61@gmail.com> Hello, Please, i want to convert my data with extension .txt to . BDF. Anyone have any idea Thank you From eelke.spaak at donders.ru.nl Sat Oct 11 11:40:05 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 11 Oct 2014 11:40:05 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Hi Katrin, The first *3* (not just 2) columns of the trl-matrix are special, they define the start and end sample of the trial, and the offset. Right now you are not storing the offset in the output of your trialfun. Instead, you put the RT in the third column. Since there are no columns 4 and above, no trialinfo is created (plus your time axes will likely be wrong as the RT is now interpreted as offset by FieldTrip). Change the relevant line to the following: newtrl = [trlbegin trlend offset RT]; and you should get a proper trialinfo. Best, Eelke On 2 October 2014 21:53, KatrinH Heimann wrote: > Dear Anne, dear all, > > I did try to create a customized trialfunction serving my needs. > This is what I came up with: > > function [trl, event] = response_trialfun(cfg); > > > > % read the header information and the events from the data > > hdr = ft_read_header(cfg.dataset); > > event = ft_read_event(cfg.dataset); > > > > > > % search for "trigger" events > > value = [event(find(strcmp('ceck', {event.value}))).value]'; > > sample = [event(find(strcmp('ceck', {event.value}))).sample]'; > > > > % search for "trigger" events > > value2 = [event(find(strcmp('resp', {event.value}))).value]'; > > sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; > > > > % determine the number of samples before and after the trigger > > pretrig = -round(cfg.trialdef.prestim * hdr.Fs); > > posttrig = round(cfg.trialdef.poststim * hdr.Fs); > > > > % look for the combination of a trigger "7" followed by a trigger "64" > > % for each trigger except the last one > > trl = []; > > > > trlbegin = sample + pretrig > > trlend = sample + posttrig > > offset = pretrig > > RT = sample2 - sample > > newtrl = [trlbegin trlend RT]; > > trl = [trl; newtrl]; > > > > end > > > > In fact it seems to work, the trials look good and the RT is computed > correctly. Only that after the preprocessing (with ft_preprocessing: > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-0.1 0] > > > > mov_data = ft_preprocessing(cfg); > > % > > ) there is no mov_data.trialinfo created. I thought that the information in > trl above would be saved there. Without those I am not able to do the > redefinition as planned (like Anne proposed: > > > > > offset = (mov_data.trialinfo(:,3)); > > prestim = 0.75; > > poststim = 0.75; > > > > cfg = []; > > cfg.begsample = round(offset - prestim*data.fsample); > > cfg.endsample = round(offset + poststim*data.fsample); > > mov_data_small = ft_redefinetrial(cfg, mov_data); > > > > % then shift the time axis > > cfg = []; > > cfg.offset = -offset; > > mov_data_small = ft_redefinetrial(cfg, move_data_small); > > > > > How come the information is not stored? Somebody an idea? > > Thanks a million > > Katrin > > > 2014-09-28 18:35 GMT+02:00 Anne Urai : >> >> Dear Katrin, >> >> if you use a custom trialfun >> (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) >> you can code the time between stimulus onset and response in an additional >> column. That way, you can shift the time axis of the data by this amount on >> each trial. For example: >> >> % redefine trials >> offset = (data.trialinfo(:,RTcol)); >> prestim = 1; >> poststim = 2; >> >> >> >> cfg = []; >> cfg.begsample = round(offset - prestim*data.fsample); >> cfg.endsample = round(offset + poststim*data.fsample); >> data = ft_redefinetrial(cfg, data); >> >> >> >> % then shift the time axis >> cfg = []; >> cfg.offset = -offset; >> data = ft_redefinetrial(cfg, data); >> >> % timelock >> cfg = []; >> cfg.keeptrials = 'yes'; >> data = ft_timelockanalysis(cfg, data); >> >> That way, your new data structure will now be response locked. Note that >> the timelockanalysis is optional, and only works when you have trials that >> are all the same length. >> >> If you do not want to use a custom trialfun, you could also rerun the same >> analysis as you have for the stimulus-locked data, but then taking the >> response code as your eventvalue. >> >> Good luck, >> >> --- >> Anne E. Urai, MSc >> PhD student | Institut für Neurophysiologie und Pathophysiologie | >> Universitätsklinikum Hamburg-Eppendorf >> Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com >> >> >> >> >> >> On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: >> >> Dear all, >> I know I asked this already twice, but I did not get the right answer yet >> and just cannot figure it out myself. >> So, I did cut my data in quite large trials using ft_define trial and >> logging it to the beginning of a slide. >> >> cfg = []; >> cfg.dataset = name; >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger >> cfg.trialdef.prestim = 0.216; % in seconds >> cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) >> cfg = ft_definetrial(cfg); >> >> >> >> % cancel out training trials >> cfg.trl([1:4],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> %structure trial - plus delay reported by EGE = 18 ms = 9 samples >> cfg.trl(:,3)=cfg.trl(:,3)-17 >> >> >> >> >> >> >> Then I preprocessed these trials >> >> %% preprocess data >> cfg.channel = 'all'; >> cfg.preproc.detrend = 'yes'; >> cfg.preproc.demean = 'yes'; >> cfg.preproc.baselinewindow = [-0.1 0] >> % >> mov_data = ft_preprocessing(cfg); >> % >> save (strcat(sb,'mov_data') , 'mov_data') >> >> >> >> >> Now I wanna cut out smaller pieces that are centered around another >> trigger - the response of the subject. I did not use this trigger at the >> beginning as then defining a baselinewindow is impossible (as the response >> is always happening at a different time). >> >> I tried to just use ft_definetrial again, as I don't see a possibility to >> use ft_redefine trial: >> >> cfg = [] >> cfg.dataset= strcat(sb,'mov_data.mat') >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'resp' >> cfg.trialdef.prestim = 0.75 >> cfg.trialdef.poststim = 0.75 >> >> >> >> mov_data_small = ft_definetrial(cfg) >> >> but I get the error message: >> >> Error using ft_read_header (line 1833) >> unsupported header format (matlab) >> >> Error in ft_trialfun_general (line 71) >> hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); >> >> Error in ft_definetrial (line 169) >> [trl, event] = feval(cfg.trialfun, cfg); >> >> >> >> >> I wonder if that is as the file produced by fieldtrip during the >> preprocessing is not one that is specified for ft_read_header - but how do I >> deal with this? >> >> Thanks a lot for your help >> >> Katrin >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mailtome.2113 at gmail.com Mon Oct 13 08:49:42 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 17:49:42 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Message-ID: Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Oct 13 11:41:20 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 13 Oct 2014 09:41:20 +0000 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Hi Arti, Try lowering the cfg.zlim values (%% Plot TFR). Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] Sent: Monday, 13 October 2014 5:49 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Oct 13 12:37:45 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 21:37:45 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? Thanks Arti On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > *Sent:* Monday, 13 October 2014 5:49 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency > analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I > have used the following script (I wrote the script from the examples on the > fieldtrip website), but I get the time frequency plots with huge values. > Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Oct 13 13:44:15 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 13 Oct 2014 13:44:15 +0200 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: <99C51A43-5E39-4C9C-949D-D8F4EEF3C539@uni-konstanz.de> Dear Arti, the units on the tutorial are in Tesla^2. In your case they might end up being in V^2 if you first convert them to volts instead of bits, i.e. the reason why you end up with those high values. So, to your question, your are not doing anything wrong. best tzvetan > Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? > Thanks > Arti > > On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > Sent: Monday, 13 October 2014 5:49 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Oct 13 17:16:52 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 13 Oct 2014 15:16:52 +0000 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' Message-ID: Hi all, In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been hoping to end up with a source file with both averaged and individual trials in source space, much as can be done with time locking in sensor space. However, my resulting source file only ever has avg data, regardless of what I tweak. Does anyone know what I may be doing wrong, or how I could possibly use beamformer with lcmv method and keep individual trials at source space grid points? Thanks in advance! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:49:23 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:49:23 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: Dear Kaelasha, I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* Good luck, Joram On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler wrote: > Hi all, > > In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been > hoping to end up with a source file with both averaged and individual > trials in source space, much as can be done with time locking in sensor > space. > > However, my resulting source file only ever has avg data, regardless of > what I tweak. > > Does anyone know what I may be doing wrong, or how I could possibly use > beamformer with lcmv method and keep individual trials at source space grid > points? > > Thanks in advance! > > Kaelasha Tyler > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:51:21 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:51:21 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: NB: cfg.keeptrials='yes'; is also handy, because this ensures the trial info matrix is left into the output structure, so you can do, e.g., correlations between the single-trial power and the RT of each trial, or some other trial-varying variable. - Joram On Mon, Oct 13, 2014 at 5:49 PM, Joram van Driel wrote: > Dear Kaelasha, > I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* > Good luck, > Joram > > On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler > wrote: > >> Hi all, >> >> In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been >> hoping to end up with a source file with both averaged and individual >> trials in source space, much as can be done with time locking in sensor >> space. >> >> However, my resulting source file only ever has avg data, regardless of >> what I tweak. >> >> Does anyone know what I may be doing wrong, or how I could possibly use >> beamformer with lcmv method and keep individual trials at source space grid >> points? >> >> Thanks in advance! >> >> Kaelasha Tyler >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 03:12:04 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Mon, 13 Oct 2014 18:12:04 -0700 Subject: [FieldTrip] unable to download Message-ID: Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 14 08:03:11 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 14 Oct 2014 06:03:11 +0000 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Hi Brittany, For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. Silly silly mistake on my part. Might be of help to you? Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] Sent: Tuesday, 14 October 2014 12:12 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] unable to download Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 14 09:27:01 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 14 Oct 2014 09:27:01 +0200 Subject: [FieldTrip] using clusterplot to plot percentage changes Message-ID: Dear all, I was wondering if it would be possible to plot percentage changes of power spectrum using ft_clusterplot function. As far as I understand, the zlim specified for the ft_clusterplot is the changes of the power spectrum, right? Does anyone know the unit of the zlim? My power spectrum was calculated using the mtmfft function. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 19:50:41 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Tue, 14 Oct 2014 10:50:41 -0700 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Thanks Kaelasha, I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? Brittany On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to > download the FT zip file from the FT server. What I was supped to be doing > I was dragging and dropping the zip file onto my computer where the file > transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Brittany Alperin [balperin07 at gmail.com] > *Sent:* Tuesday, 14 October 2014 12:12 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the > download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:36:05 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:36:05 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis Message-ID: Dear list, I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:39:36 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:39:36 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Apologies for the previous email. I hit send before finished typing I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; This is returning the following error Undefined function 'eq' for input arguments of type 'struct'. Error in filetype_check_uri (line 62) sep = find(filename==':'); Error in fetch_url (line 33) if filetype_check_uri(filename, 'sftp') Error in ft_read_header (line 105) filename = fetch_url(filename); Any help would be much appreciated. Regards, Arti On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek wrote: > Dear list, > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > > > cfg =[]; > > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > > > data_clean = ft_rejectvisual(cfg, dat); > > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias.treder at gmail.com Wed Oct 15 20:56:17 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Wed, 15 Oct 2014 19:56:17 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 15 22:09:43 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <577666873.3492259.1413403783469.JavaMail.root@bcbl.eu> Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matthias.treder at gmail.com Thu Oct 16 20:54:20 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Thu, 16 Oct 2014 19:54:20 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias > Message: 1 > Date: Wed, 15 Oct 2014 19:56:17 +0100 > From: Matthias Treder > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: > < > CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hello FieldTrippers, > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and > the result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires either > a field .mom or the structure of the data has to be rpttap_chan_freq, but I > have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: <577666873.3492259.1413403783469.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Hi Matthias, > > have you tried: > > cfg.keetrials = 'yes' in your cfg? > > Best, > Fred > > Fr?d?ric Roux > > ----- Original Message ----- > From: "Matthias Treder" > To: fieldtrip at science.ru.nl > Sent: Wednesday, October 15, 2014 8:56:17 PM > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > > > > > > > > Hello FieldTrippers, > > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and the > result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires > either a field .mom or the structure of the data has to be > rpttap_chan_freq, but I have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 13 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 16 23:12:40 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 16 Oct 2014 23:12:40 +0200 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: <8B1D8545-3F9C-47D8-B3AC-E067B859D029@donders.ru.nl> Dear Brittany and others Multiple people have reported intermittent download problems over the last few days. Last weekend the network in our building was renewed and reconfigured, and I suspect that there are still some issues with the new network. I have notified our ICT department and hope that they will fix it. In case you want the fieldtrip source code, there are some alternatives mentioned on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. With git or svn it is much easier to keep your copy of the fieldtrip code up to date. On the github page there is also a zip file, which is always the latest version. In case you want to download the tutorial data, I have no work around and can only suggest that you keep on trying. sorry for the inconvenience, Robert On 14 Oct 2014, at 19:50, Brittany Alperin wrote: > Thanks Kaelasha, > > I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? > > Brittany > > > > On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] > Sent: Tuesday, 14 October 2014 12:12 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 17 01:48:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 16 Oct 2014 16:48:00 -0700 Subject: [FieldTrip] source grand-average MNE Message-ID: <54405930.6040106@gmail.com> Hi all, I was wondering whether anyone has an insight into the problem I've been having when trying to run ft_sourcegrandaverage on the output from ft_sourceanalysis with cfg.method = 'mne'; I followed the procedure described in the tutorial "Source reconstruction of event-related fields using minimum-norm estimate" http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate and I'm working with MNI-warped grids. (I'm using version fieldtrip-20140801) With a call to ft_sourcegrandaverage over the subjects' data, I get the error a known error: "the input sources vary in the field pos". So what I did next was to set .pos and .dim for each subjects' source reconstruction to one same .pos and .dim from the template sourcemodel. In this case, the error I get is the following: Error using fixdimord (line 159) unexpected dimord "_ori_ori" Error in fixdimord (line 91) data = fixdimord(data); Error in ft_datatype_source (line 208) source = fixdimord(source); Error in ft_sourcegrandaverage (line 108) varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I haven't been able to download a more recent version of FT yet (server down?), so I apologise if my question would be solved by simply downloading a more recent FT version. Thanks a lot, Vitoria From f.roux at bcbl.eu Fri Oct 17 08:49:42 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Fri, 17 Oct 2014 08:49:42 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <90389720.3507978.1413528582649.JavaMail.root@bcbl.eu> Hi Matthias, if you want the dimensions of your data to be rpttap_chan_freq instead of rpttap_chan_freq_time you can try this cfg: cfg = []; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.pad = 'maxperlen'; cfg.keeptapers = 'yes'; cfg.keeptrials = 'yes'; cfg.foi = 0:Fs/2; Here instead of computing a spectrogram with wavelets, you are computing a spectrum (no temporal information) using either a hanning taper, or any other taper of your choice. The output of this cfg should give you a data-structure with the dimensions that you are interested in. Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Thursday, October 16, 2014 8:54:20 PM Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias Message: 1 Date: Wed, 15 Oct 2014 19:56:17 +0100 From: Matthias Treder < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com > Content-Type: text/plain; charset="utf-8" Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > ------------------------------ Message: 2 Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < 577666873.3492259.1413403783469.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Fr?d?ric Roux ----- Original Message ----- From: "Matthias Treder" < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 47, Issue 13 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From drbatalasandhya at gmail.com Fri Oct 17 16:37:04 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:07:04 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. as an alternate I have downloaded the zip file of the toolbox. Therefore I am in need of the example data . Can anyone please share the example data with me. thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From ms.fieldtrip at googlemail.com Fri Oct 17 17:09:04 2014 From: ms.fieldtrip at googlemail.com (Michael Meg) Date: Fri, 17 Oct 2014 17:09:04 +0200 Subject: [FieldTrip] Very short Morlet wavelets - non-zero mean correction missing ? Message-ID: Dear colleagues and friends, looking at the current Fieldtrip version (20141016), I could not find the "low-cycle correction" that you need for less than 5 cycles in Morlet wavelet analysis. On the other hand a gwidth (Gaussian width, I suppose) parameter defaults to 3 instead of five. Maybe it would be good to implement the correction by subtracting exp( (2*pi*freqoi(ifreqoi))2 / 2) from the complex exponential after its created? (The correction deals with the fact that the complex Morlet wavelet has a non-zero mean at the low cycle numbers. See for example: The Illustrated Wavelet Transform Handbook: Introductory Theory and Applications in Science, Egnineering, Medicine and Finance. Paul S Addison. page 35) Please disregard this email if this has been done in the meantime. Best, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Fri Oct 17 17:26:34 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:56:34 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . Can anyone please share the example data with me. Thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:04:37 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:04:37 +0200 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sandhya and others Please find below a short section forwarded from our local ICT staff. They are presently working together with the university ICT staff to get it resolved. The suggestion below might provide a work around. best regards, Robert Begin forwarded message: > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of setting > the transfer mode to "active". As an example you could use filezilla and force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active On 17 Oct 2014, at 17:26, batala sandhya wrote: > hello, > > I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:31:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:31:29 +0200 Subject: [FieldTrip] change in ft_rejectvisual regarding dataout.cfg.artifact Message-ID: <057A6C50-2437-447F-A8B4-2DA63F0B327F@donders.ru.nl> Dear all I recently made a change in ft_rejectvisual that some of you might want to be aware of. It has to do with keeping track of rejected data segments and the change was made in revision 9881, which you can see in detail at https://code.google.com/p/fieldtrip/source/detail?r=9881 It used to be that with dataout = ft_rejectvisual(cfg, datain); you would get dataout.cfg.artifact as a Nx2 matrix with the data segments that were marked as artifact. The new behaviour is that the Nx2 matrix is now to be found in either one of dataout.cfg.artfctdef.summary.artifact dataout.cfg.artfctdef.trial.artifact dataout.cfg.artfctdef.channel.artifact depening on whether cfg.method=summary/trial/channel. This makes ft_rejectvisual compatible with the other ft_artifact_xxx functions. So, you can now do cfg.keeptrial = ‘yes’ cfg.keepchannel = ‘yes’ dataout = ft_rejectvisual(cfg, datain); where dataout still contains all trials and channels, but subsequently you can use dataclean = ft_rejectartifact(dataout.cfg, datain) to remove them explicitly. This facilitates repeated passes of ft_rejectartifact for different channel types (EEG, planar gradiometers, magnetometers) and to store the manual work in between. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From Laura.Rueda at faber.kuleuven.be Mon Oct 20 18:17:25 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Mon, 20 Oct 2014 16:17:25 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics Message-ID: Dear all, I'm working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don't have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don't have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:49:47 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:49:47 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < Laura.Rueda at faber.kuleuven.be> wrote: > Dear all, > > > > I’m working with EEG data and the individual MRIs. I have a doubt about a > step for defining ROIs. I have EEG data during a task with 3 conditions > (C1, C2, C3) and during rest. I would like to know what is the main effect > of the conditions in my source data. I was recommended to use the contrast > of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, > which then are used to restrict the source and statistical analysis between > the conditions. This is what I do: > > > > - Estimate sources with the common filter for Task and Rest > separately. > > - Find sources that are significantly different between these > two conditions (ft_sourcestatistics with dependent T). > > - Use the position of these sources as ROIs in ft_sourceanalysis > for C1, C2 and C3 separately (but using a common filter of these > conditions). > > - Find sources that account for the main effect between > conditions (ft_sourcestatistics with dependent F). > > > > Now the problem is that if I use the position of the sources in > ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a > problem when using ft_sourcestatistics as cfg.dim needs to be specified and > if I do not specify it (because I don’t have a regular grid with 3 > dimensions as expected), I get the following error: > > > > Error using reshape > > To RESHAPE the number of elements must not change. > > > > Error in clusterstat (line 185) > > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > > Error in ft_statistics_montecarlo (line 361) > > [stat, cfg] = clusterstat(cfg, statrand, statobs); > > > > Error in statistics_wrapper (line 308) > > [stat, cfg] = statmethod(cfg, dat, design); > > > > Error in ft_sourcestatistics (line 107) > > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > > > > So does anybody know a way to work around this? > > > > And what do you think of the logic of these steps? > > > > Thank you in advance for any help! > > > > > > Cheers, > > > > Laura Rueda Delgado > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:58:30 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:58:30 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor wrote: > Hi Laura, > > If I understand your problem correctly, what I think you need to do is > create a template grid using ft_source_model, then use ft_source_model to > create a grid using each subjects' mri with the template grid, and finally > change the .dim and .pos parameters of the source analysis output to unwarp > from the subject grid to the template grid. The following code might help, > although I think there is also a tutorial that talks about this: > > template = ft_read_mri(templatefile); > template.coordsys = 'spm'; > > % segment the template brain and construct a volume conduction model > (i.e. head model) > > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % Subject mri > > mri = ft_read_mri(mrifile); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmented = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmented); > > % Prepare Source Model using template grid and subject mri > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > grid = ft_prepare_sourcemodel(cfg); > > % Unwarp Grid (For group analysis) > > src.dim = template_grid.dim; > src.pos = template_grid.pos; > > I hope this helps. > best, > > Max > > > > On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < > Laura.Rueda at faber.kuleuven.be> wrote: > >> Dear all, >> >> >> >> I’m working with EEG data and the individual MRIs. I have a doubt about a >> step for defining ROIs. I have EEG data during a task with 3 conditions >> (C1, C2, C3) and during rest. I would like to know what is the main effect >> of the conditions in my source data. I was recommended to use the contrast >> of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, >> which then are used to restrict the source and statistical analysis between >> the conditions. This is what I do: >> >> >> >> - Estimate sources with the common filter for Task and Rest >> separately. >> >> - Find sources that are significantly different between these >> two conditions (ft_sourcestatistics with dependent T). >> >> - Use the position of these sources as ROIs in >> ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter >> of these conditions). >> >> - Find sources that account for the main effect between >> conditions (ft_sourcestatistics with dependent F). >> >> >> >> Now the problem is that if I use the position of the sources in >> ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a >> problem when using ft_sourcestatistics as cfg.dim needs to be specified and >> if I do not specify it (because I don’t have a regular grid with 3 >> dimensions as expected), I get the following error: >> >> >> >> Error using reshape >> >> To RESHAPE the number of elements must not change. >> >> >> >> Error in clusterstat (line 185) >> >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> >> Error in ft_statistics_montecarlo (line 361) >> >> [stat, cfg] = clusterstat(cfg, statrand, statobs); >> >> >> >> Error in statistics_wrapper (line 308) >> >> [stat, cfg] = statmethod(cfg, dat, design); >> >> >> >> Error in ft_sourcestatistics (line 107) >> >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> >> >> >> >> So does anybody know a way to work around this? >> >> >> >> And what do you think of the logic of these steps? >> >> >> >> Thank you in advance for any help! >> >> >> >> >> >> Cheers, >> >> >> >> Laura Rueda Delgado >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From assaf.harel at wright.edu Mon Oct 20 23:18:19 2014 From: assaf.harel at wright.edu (Harel, Assaf) Date: Mon, 20 Oct 2014 17:18:19 -0400 Subject: [FieldTrip] Post Doc Position in Human Neuroscience and Visual Cognition Message-ID: <46894172-662A-4C53-86A7-1CAF709EAF59@wright.edu> Human Neuroscience and Visual Cognition Lab Department of Psychology Wright State University A post-doc position is now available at the newly established Human Neuroscience and Visual Cognition Lab at the Department of Psychology, Wright State University. The lab is headed by Dr. Assaf Harel and investigates high-level vision and its neural substrates. We are particularly interested in how visual recognition occurs in real-world settings and adopt a neuroergonomic approach to study the applied aspects of high-level vision. For this purpose, we employ a diversity of cognitive neuroscience methods, including fMRI, EEG, psychophysics, and eye tracking. Research topics include, but are not limited to the following areas: visual expertise, object and scene recognition, categorization and perceptual learning. The position is fully funded for two years. The successful candidate will hold a PhD in Cognitive Neuroscience, Cognitive Psychology, Neurobiology, Computer Science, or any other related discipline by the start date of the position. Strong background and familiarity with fMRI or EEG research is required. Experience in computer programming, especially with Matlab is highly encouraged and will be considered a strong advantage. Applicants should send their CV, a short statement of their research interests and contact information for two references to Dr. Assaf Harel at: assaf.harel at wright.edu. The Department of Psychology is housed in the College of Science and Mathematics, offers a Ph.D. in Human Factors and Industrial/ Organizational Psychology, and has 3 undergraduate concentration areas: (1) Cognition and Perception, (2) Industrial/ Organizational, and (3) Behavioral Neuroscience. Wright State University was recently ranked among the “Best in the Midwest” universities by The Princeton Review, listed among 260 Best National Universities in the annual “America’s Best Colleges” rankings by U.S. News and World Report, and ranked fourth nationally among universities with limited numbers of doctoral programs in the Faculty Scholarly Productivity Index. Wright State University is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 21 00:20:21 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Tue, 21 Oct 2014 00:20:21 +0200 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Dear Arti, I suppose you already solved your problem. Just in case. What the matlab error is telling you is: "you are giving me something (a structure) while I was expecting a string" (you will get familiar with that error. well or hopefully not). So in a nutshell you need to give ft_read_header a string, probably the name of the file you have your data exported to (extension included). A common error is calling ft_read_header like ft_read_header(cfg) because ft_databrowser or ft_preprocessing can open external files if you feed them with cfg.dataset - who is a string. In your case, this is happening because you are trying to read the header of a matlab variable - a structure of eeg data imported in fieldtrip format. So if what I say makes sense you will see this is not a fieldtrip problem indeed. So call something like ft_read_header('mydata.edf'). Last advice highlight ft_read_header and press F1. Ánimo and good luck with your data explorations 2014-10-15 3:39 GMT+02:00 Arti Abhishek : > Apologies for the previous email. I hit send before finished typing > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > cfg =[]; > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > data_clean = ft_rejectvisual(cfg, dat); > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > This is returning the following error > > Undefined function 'eq' for input arguments of type 'struct'. > > Error in filetype_check_uri (line 62) > sep = find(filename==':'); > > Error in fetch_url (line 33) > if filetype_check_uri(filename, 'sftp') > > Error in ft_read_header (line 105) > filename = fetch_url(filename); > > Any help would be much appreciated. > > Regards, > > Arti > > On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek > wrote: > >> Dear list, >> >> I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I >> have EEG data preprocessed and saved as .mat files. Now I want to further >> process the data. I used the following script >> >> Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', >> 's10', 's11', 's12'... >> >> 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; >> >> Triggers = [101 111 121]; >> >> Conditions = {'4Ch', '8Ch', '16Ch'}; >> >> for i=1:length(Subjects) >> >> for j=1:length (Conditions) >> >> >> >> cfg =[]; >> >> >> FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); >> >> >> >> DataFIC = load (FileName); >> >> hdr = ft_read_header (DataFIC); >> >> >> dat = ft_read_data(DataFIC, 'header', 'hdr'); >> >> cfg.method = 'summary'; >> >> cfg.channels = 'all'; >> >> >> >> data_clean = ft_rejectvisual(cfg, dat); >> >> >> save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') >> >> end; >> >> end; >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Tue Oct 21 03:41:01 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 21 Oct 2014 12:11:01 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Dear Eelke, Thank you for help regarding cluster-based permutation analysis of two or more conditions. I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. for k = 1:Nmt, % states for i = 1%:Ng, % groups for j = 1:Ns, % subjects % load files p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); % convert to eeglab to get channel locations EEG(j) = eeg2eeglab( p(j)); EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); % preprocessing in fieldtrip d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); % specify length of time to use in config time = EEG(j).xmax-EEG(j).xmin; % setup configuration for freqanalysis cfg = []; % clear cfg cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = 1:0.05:time; % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles cfg.keeptrials = 'yes'; % do freqanalysis freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) Any help would be appreciated. Kind regards, Dylan On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > and > > the two experimental designs (between- and within-UO), the tutorial > covers > > statistics on data in two conditions in a between-trials, in a > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > first > > averaging over all trials belonging to each of the experimental > conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Tue Oct 21 07:14:24 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Tue, 21 Oct 2014 10:44:24 +0530 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sir, As directed, I tried to connect via ftp client filezilla to connect to the host ftp but it was unable to make a connection displaying a error , screenshot of which is included as under [image: Inline image 1] Sir can you please suggest as to why this error occured Thanks and regard On Mon, Oct 20, 2014 at 6:34 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Sandhya and others > > Please find below a short section forwarded from our local ICT staff. They > are presently working together with the university ICT staff to get it > resolved. The suggestion below might provide a work around. > > best regards, > Robert > > > Begin forwarded message: > > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now > allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of > setting > the transfer mode to "active". As an example you could use filezilla and > force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active > > > > > > > On 17 Oct 2014, at 17:26, batala sandhya > wrote: > > hello, > > I am unable to connect to the ftp server to download the toolbox and > example data. As an alternate I have downloaded the master zip file of the > toolbox provided in the website . Therefore I am in need of the example > data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.JPG Type: image/jpeg Size: 82981 bytes Desc: not available URL: From Laura.Rueda at faber.kuleuven.be Tue Oct 21 10:17:42 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Tue, 21 Oct 2014 08:17:42 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Dear all and Max, Thank you for your comment. I think I wasn’t clear in my previous message I’ve added more explanation to the steps that I mentioned before: 1) Estimate sources with the common filter for Task and Rest separately: I create the headmodel from the invidual MRI, and create the grid from the individually warped template as described in the tutorial that you suggested. I use eLORETA. 2) Find sources (let’s call them ‘Task_vs_Rest’)that are significantly different between these two conditions (ft_sourcestatistics with dependent T): I run a cluster-based permutation on the sources after unwarping the positions to the positions of the template for group analysis. 3) Use the position of these sources (Task_vs_Rest) as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions): I get the index of the sources Task_vs_Rest and use this index for selecting the x,y,z coordinates (grid.pos) of the individually warped template. These x,y,z coordinates are my ROIs for ft_sourceanalysis. 4) Find sources (let’s call them ‘C1vsC2vsC3’) that account for the main effect between conditions (ft_sourcestatistics with dependent F). My question: I get stuck in step 4. The problem is that if I use the position of the sources Task_vs_Rest, as a way to select ROIs, I don’t have a regular grid anymore for steps 3 and 4. When using ft_sourcestatistics to find C1vsC2vsC3 (in step 4), cfg.dim needs to be specified. If I do not specify it (because I don’t have a regular grid with 3 dimensions as expected in step 4), I get the error shown in my previous message. The goal with these steps is to first obtain meaningful sources from the contrast Task (including C1, C2 and C3) vs Rest to use them for the contrast C1 vs C2 vs C3. Please let me know if these steps make any sense, and whether and/or how I could work around this error. Best regards, Laura Rueda Delgado KU Leuven - Department of Kinesiology Movement Control and Neuroplasticity Research Group Building De Nayer (GDN) Tervuursevest 101 bus 1501 3001 Leuven Belgium From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Max Cantor Sent: maandag 20 oktober 2014 18:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] Specific sources and ft_sourcestatistics I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor > wrote: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado > wrote: Dear all, I’m working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don’t have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue Oct 21 11:39:14 2014 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 21 Oct 2014 11:39:14 +0200 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <5322FFE6.7000902@donders.ru.nl> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> <5322FFE6.7000902@donders.ru.nl> Message-ID: <2BED38A7-3028-45B0-BCC4-78FC047F66C5@gmail.com> Hi Phyllis, I have a similar situation - ft_databrowser after appending - and I solved the problem of not seeing events at the right times by manually rebuilding them. For artefact rejection I found it important to know when in the trial eg. blinks occurred. There is the (undocumented?) cfg.event input option, which I used in the following way % ARTIFICIALLY REBUILD EVENTS for t = 1:length(data.trial), % get the distance between each event and the start of the trial samples(t,1) = trl(t,2)-trl(t,1); %int1 samples(t,2) = trl(t,5)-trl(t,1); %int2 samples(t,3) = trl(t,8)-trl(t,1); %resp samples(t,4) = trl(t,10)-trl(t,1); %fb % add the length of this trial samples(t,:) = samples(t,:) + (12*600*t-1); end samples = reshape(samples', 1, numel(samples)); % create events structure to feed into databrowser for i = 1:length(samples), e(i).type = 'x'; e(i).sample = samples(i); e(i).value = []; e(i).offset = 0; e(i).duration = 1; end cfg.event = e; cfg = ft_databrowser(cfg, data); in which the trl matrix I use has samples of events at column 2, 5, 8, and 10, and the first column has the start of the trial in samples. Also, each trial takes 12 seconds at sampling rate 600 Hz. For trials of unequal length, you need to do a bit better bookkeeping on the assumption that fieldtrip treats epoched data as continuous data from the same recording. Hope this helps! Cheers, Anne --- Anne E. Urai, MSc PhD student | Institute for Neuro- and Pathophysiology | University Medical Center Hamburg-Eppendorf | Hamburg, Germany | anneurai.wordpress.com On 14 Mar 2014, at 14:11, Jörn M. Horschig wrote: > Heyho, > > yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) > Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. > If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! > > Best, > Jörn > > > On 3/14/2014 1:52 PM, Phyllis Mania wrote: >> >> Dear Eelke, >> >> Calling ‘rmfield’ helped, thank you! >> >> Cheers, >> >> Phyllis >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 21 14:32:02 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 21 Oct 2014 14:32:02 +0200 Subject: [FieldTrip] Units for clusterplots Message-ID: Dear all, I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 21 15:05:59 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 21 Oct 2014 15:05:59 +0200 Subject: [FieldTrip] Units for clusterplots In-Reply-To: References: Message-ID: <23FF97F7-1C48-4E1E-A8AB-1EAC06C873A2@uni-konstanz.de> Dear Hweeling, it depends on the configuration you’d specify by cfg.parameter. I assume you didn’t specify anything so that in this case ft_clusterplot defaults to parameter ’stat’ with unit t-values. best tzvetan > Dear all, > I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? > Thanks. > Cheers, > Hweeling > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 21 15:57:43 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 13:57:43 +0000 Subject: [FieldTrip] no coil pos for planar combined data Message-ID: Hi all, I am having problems using ft_sourceanalysis with planar gradiometer data. I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow Using planar gradiometer data is mentioned in the tutorial, although not in detail. My problem: The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. I get the error: Reference to non-existent field 'avg'. I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. Any suggestions? If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. Is that possible? Thanks in advance! (and thank you to all previous very helpful responses on this list). Kaelasha Tyler PhD Candidate Brain and Psychological Science Research Centre Swinburne University of Technology Melbourne Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 21 17:05:07 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 21 Oct 2014 17:05:07 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > From ktyler at swin.edu.au Tue Oct 21 18:58:57 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 16:58:57 +0000 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: , Message-ID: Hi Eelke, Partly I was just following the tutorials suggestion. I am using a Neuromag system. Up until now I have been working primarily with the magnetometers. I was interested in what difference I would find with data from the planar gradiometers. I had understood that planar gradiometer sensor pairs measure planar magnetic fields perpendicular to each other, at a similar point near the scalp. That being the case, I would have thought that using original planar gradiometer data in source analysis without combining it would produce in nonsensical results. Wouldn't source data at one grid point would then be incongruously trying to represent two different sets of information? Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Wednesday, 22 October 2014 2:05 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] no coil pos for planar combined data Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From joramvandriel at gmail.com Tue Oct 21 21:25:55 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Tue, 21 Oct 2014 21:25:55 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, I believe (but I might be wrong), that you can use all three sensor types for Neuromag data (so the uncombined gradiometers *and* the magnetometers) with lcmv beamforming. That is, the weights (filters) of each voxel are computed based on covariance between sensors. Even if the different sensor types catch different aspects of the magnetic field, they probably covary as a function of, e.g., a stimulus, a cognitive process, or any underlying brain process. So in that sense, the more data, the better the source estimate, so why not use all 306 sensors? At least this worked for me and gave very sensible results. Maybe other fieldtrip users who use Neuromag data for beamforming can comment on this? - Joram On Tue, Oct 21, 2014 at 6:58 PM, Kaelasha Tyler wrote: > Hi Eelke, > > Partly I was just following the tutorials suggestion. > I am using a Neuromag system. Up until now I have been working primarily > with the magnetometers. > I was interested in what difference I would find with data from the planar > gradiometers. > > I had understood that planar gradiometer sensor pairs measure planar > magnetic fields perpendicular to each other, at a similar point near the > scalp. That being the case, I would have thought that using original planar > gradiometer data in source analysis without combining it would produce in > nonsensical results. Wouldn't source data at one grid point would then be > incongruously trying to represent two different sets of information? > > Kaelasha > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] > Sent: Wednesday, 22 October 2014 2:05 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] no coil pos for planar combined data > > Hi Kaelasha, > > Why do you want to do source analysis on combined planar gradiometer > data? In general, I would say this does not make sense. Instead, I > would use the original (axial or planar, depending on your system) > gradiometer data. > > Best, > Eelke > > On 21 October 2014 15:57, Kaelasha Tyler wrote: > > Hi all, > > > > I am having problems using ft_sourceanalysis with planar gradiometer > data. > > > > I am following a tutorial for beamforming with lcmv method (which I > believe is a work in progress) found here: > > > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > > Using planar gradiometer data is mentioned in the tutorial, although not > in detail. > > > > My problem: > > The .avg field produced by time locking, is lost when combining planar > gradiometers using 'ft_combineplanar'. > > In this case, I am unable to to use 'ft_sourceanalysis' on combined > planar gradiometer data. > > I get the error: Reference to non-existent field 'avg'. > > > > I reasoned that I may be able to keep the .avg filed if I combine the > planar gradiometer data at the outset, prior to timelocking. But in this > case, the gradiometer positions in data.grad does not include 'coilpos'. > Eg, no data.grad.coilpos. > > When calling 'ft_sourceanalysis' in this case, I get the error: > Reference to non-existent field 'coilpos'. > > > > Any suggestions? > > > > If the .grad.coilpos was retained when I combined the planar gradiometer > data at the outset, (after preprocessesing and prior to timelokcing) then I > would be able to use ft_sourceanalysis on planar gradiometer combined data > successfully. > > Is that possible? > > > > Thanks in advance! (and thank you to all previous very helpful responses > on this list). > > > > Kaelasha Tyler > > > > PhD Candidate > > Brain and Psychological Science Research Centre > > Swinburne University of Technology > > Melbourne > > Australia > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Wed Oct 22 10:51:58 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Wed, 22 Oct 2014 08:51:58 +0000 Subject: [FieldTrip] =?windows-1252?q?Weird_repetition_trails=85=2E_=28=2E?= =?windows-1252?q?cnt_files=29?= Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB50EE@UWMBX01.uw.lu.se> Dear fieldtripers, I am having problems for fieldtrip to read the .cnt neuroscan files. I noticed that, when I am plotting my trials (using ft_databrower), I get trials that are exactly the same. The data in each sample of that trial, for each channel, looks exactly the same! I don’t really know the reason for this and I have tried and checked different things: 1. My trl matrix is properly defined. It could be that the same sample numbers were used for extracting different trial numbers, but that is not the case. 2. Using curry to visualize the data showed that there is nothing wrong while converting my .dat into a .cnt file. 3. I notice that fieldtrip is using the loadcnt function from eeglab. For this reason I used eeglab to read the data. When I plot the trials using eeglab I don’t find these weird trials repetitions. 4. The trials that are repeated do not seem to be real (when I look into those trials repetitions using both with curry and eeglab the trials are completely different from what fieldtrip give me). Besides those weird repetitions or the other trials seems to match. 5. I do not get more trials then what I am asking for. My trl matrix has 312 rows and I get 312 trials. So those repeated trials are replacing some relevant information… 6. The data in each sample of those trials are the same, but the triggers are different. If I would continue with data analysis exactly the same trial would be latter classified as belonging to different experimental conditions. 7. Importantly while I am extracting the trials from the data using ft_preprocessing I get a warning message saying “events imported with a time shift might be innacurate”. 8. I am using the most recent version of fieldtrip (fieldtrip-20141021) Do you have any idea of what can be going on? I have been using fieldtrip before (.bdf files) and I never had this problem… Also, a colleague of mine is having the same exactly problem… Thank you very much in advance! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 22 12:09:44 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 22 Oct 2014 12:09:44 +0200 (CEST) Subject: [FieldTrip] source plot with cfg.method = 'ortho' slows down computer Message-ID: <1407267660.3560510.1413972584299.JavaMail.root@bcbl.eu> Dear all, I was wondering if anyone has experienced as similar problem when using ft_sourceplot. My cfg structure looks like this: cfg = []; cfg.funparameter = 'statmask'; cfg.method = 'ortho'; cfg.interactive = 'yes'; ft_sourceplot(cfg,Stats); The graphic takes a really long time (>30 sec) to discplay and when I reposition the cursor it takes a really long time to update the figure (>30 sec). I suspect the problem to be related to changes in the function as I haven't experienced these difficulties in the past. Could it be that there may be some graphical rendering issues responsible here? Hoping that someone can provide me with any hints, as data-visualization is being really sluggish and frustrating right now. Best, Fred --------------------------------------------------------------------------- From r.oostenveld at donders.ru.nl Wed Oct 22 15:24:03 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 22 Oct 2014 15:24:03 +0200 Subject: [FieldTrip] FTP fully working again References: <1413977946.863096.220074797.33689.14@otrs.dccn.nl> Message-ID: <29D3A1A1-69C3-4A4F-9A00-E348A8EEA064@donders.ru.nl> Dear all, Following the troubled network upgrade, there have been about two weeks in with our FTP service was not fully accessible. I just received notice that it has been restored and that all FTP clients should again work. best regards, Robert Begin forwarded message: > The DCCN ftp-server is now running like expected. Our network department changed the firewall rulesets so it's no longer necessary to change ftp-clients to active transfer mode. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Thu Oct 23 16:02:39 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Thu, 23 Oct 2014 14:02:39 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB5205@UWMBX01.uw.lu.se> Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here: https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 24 13:04:40 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 24 Oct 2014 11:04:40 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ines.bramao at psy.lu.se Fri Oct 24 13:47:10 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Fri, 24 Oct 2014 11:47:10 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files In-Reply-To: References: Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CBC7CF@UWMBX01.uw.lu.se> Dear Jan-Mathijs, Thank you very very much for looking into this issue! I will create the account at the bugzilla.fcdonders in order to follow up this. Please tell me if I can help in some other way (for example, provinding you more data). Best wishes, Inês ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Lam, N.H.L. (Nietzsche) [n.lam at fcdonders.ru.nl] Sent: 24 October 2014 13:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From fab.rotondi at gmail.com Fri Oct 24 16:58:26 2014 From: fab.rotondi at gmail.com (fabio rotondi) Date: Fri, 24 Oct 2014 16:58:26 +0200 Subject: [FieldTrip] LCMV time series reconstruction under multiple conditions (cov matrix problem) Message-ID: Dear Fieldtrip community, my name's Fabio and I'm currently investigating on MEG/EEG connectivity in source space. I'm dealing with a theoretical concern, related to the estimation of virtual electrodes' time series for resting state EEG data (128 channels, 512 Hz sampling frequency) under 3 conditions. For each subject, the recording protocol consists of three consecutive steps: 1 minute of resting with eyes closed (EC), 1 minute resting EC with auditory stimulation n.1, 1 minute resting EC with auditory stimulation n.2. The final aim is to estimate functional connectivity changes in source space under these conditions. My question regards the computation of the covariance matrix: in order to do this I identified 2 possible ways to proceed: 1. compute covariance matrix giving the whole 3-minute signal to ft_timelockanalysis, and then use this matrix to invert separately each of the three conditions; 2. compute a covariance matrix separately for each of the three conditions (thus on 60 seconds) and then invert each condition by using its respective covariance matrix. As far as I know, solution n.1 is in literature the most used. I think it is the solution named as "common filters", which assumes that there are the same signal generators differently active in the three different conditions. This assumption could not be valid in principle for my experiment, but I was wondering if computing three different covariance matrices could introduce any other bias. Thank you so much for your help, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Sun Oct 26 09:34:11 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Message-ID: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Oct 26 10:32:58 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 26 Oct 2014 10:32:58 +0100 Subject: [FieldTrip] topoplot - no match between data and layout In-Reply-To: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> References: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Message-ID: Hello,If the number of channels of your data and layout are not the same, there will be error. The alphabetical case is very important, like sometime your data label may be FCZ while the layout is FCz, you need to check that. Meanwhile, to avoid any error, the best option is to design your own layout base on your data as explained in detail in this tutorial http://fieldtrip.fcdonders.nl/tutorial/layoutGood luck! Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" From: e.caspar at ucl.ac.uk To: fieldtrip at science.ru.nl Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 28 09:15:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 28 Oct 2014 09:15:12 +0100 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From dylan.delosangeles at gmail.com Tue Oct 28 13:21:32 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 28 Oct 2014 22:51:32 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak wrote: > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one > unit-of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles > > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of two > or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up with > a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes > x 3 frequencies x 2049 time points, rather than one struct with a 4D > powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config > > time = EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis > > cfg = []; % clear cfg > > cfg.output = 'pow'; > > cfg.channel = 'EEG'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 0.5:3; % delta > > cfg.toi = 1:0.05:time; % length of each state > > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); > > end > > end > > end > > > > My second problem is loading in the second group of 12 subjects and what > that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous email, > that I should be using indepsamplesF for more than two conditions (I have > 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 > 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 > 7 7 8 8 9 9 10 10 11 11 (11 > conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two groups > > of observations, and not to the same group of observations measured in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) cell > > arrays, corresponding to the conditions, you can input them into the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > time-frequency > >> data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > trials) and > >> the two experimental designs (between- and within-UO), the tutorial > covers > >> statistics on data in two conditions in a between-trials, in a > within-trials > >> and in a within-subjects design. However, I am wondering if there is any > >> information about the fourth type of experiment design: > between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both groups are > >> measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > (multiple > >> subjects in multiple experimental conditions), such that my design is > >> multiple groups in multiple experimental conditions. Is it a case of > first > >> averaging over all trials belonging to each of the experimental > conditions > >> for each subject (as instructed in tutorial), and then averaging over > all > >> subjects in each group? > >> > >> Configuration code for setting up the design currently looks like this; > >> grp = 2; > >> subj = 11; > >> design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when doing > these > >> statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 19:16:19 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 14:16:19 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions Message-ID: Hi, So this is not a specific method-based question, but something more general. I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. *So boiling it down**, my questions are:* 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? 2. If it cannot be used this way, what situations is it meant for? -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 20:05:33 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 15:05:33 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. Hopefully someone else has something to add, or if I'm missing any stuff. Best Rodrigo On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > Hi, > > So this is not a specific method-based question, but something more > general. > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert > (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do > this in a more efficient and fieldtrip-compatible way. It seems I can use > this setting to get the analytic signal, phase, power, and other things, > but since this is on raw/epoched data, there is no obvious way I can think > of to apply a time or frequency series as in the other TFRs. It seems I > could either write a fieldtrip function from scratch, which I'm not > prepared to do, or write a function to reformat fieldtrip data to work > using the Cohen function, and then output it back into a fieldtrip > function, which would be fine but I'm more interested to know if the > ft_preproc_hilbert function can do what I want more efficiently. > > *So boiling it down**, my questions are:* > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 20:48:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 15:48:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From orionblue8 at gmail.com Tue Oct 28 20:54:14 2014 From: orionblue8 at gmail.com (Orion) Date: Tue, 28 Oct 2014 15:54:14 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, Can you clarify what you mean by a Hilbert time-frequency analysis? Performing hilbert on a signal will give several different outputs, like the envelope and phase, and if you want, the instantaneous frequency. But I don't understand the meaning of Hilbert time-frequency. There are ways of calculating hilbert that don't use fft, but as fars as I'm aware, the hilbert.m that calls fft.m provides a quick way to the desired outputs. Orion On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 21:42:37 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 16:42:37 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hm, let me see if I can articulate this properly (I may be a bit rusty with this, so this is as much a review for me as it is an attempt to explain it to anyone else). The Hilbert Transform itself provides the analytic signal, as Sr (the real part, or cosine) and Si (the imaginary part, or sine, which is 90 degrees from the Sr). This can be used to determine things like, as you mentioned, phase, envelope, instantaneous frequency, and power. If a TFR (or at least a power spectrum from a TFR) is the power at sensor x frequency x time, the data structure output from ft_preprocessing is itself not able to give us a TFR; we have to do an FFT or wavelet analysis to get the necessary data matrix, but you can also use Hilbert. I know, from a computational standpoint, how to go from point A to point B here for both wavelet and hilbert, but I'm struggling to articulate it in real words, which means I probably need to do some rereading. However, the point is that you can use Hilbert to get a nearly identical, albeit computationally quite different, time frequency representation as you can with wavelet analysis. I have some code to do both wavelet and hilbert on a sample EEGlab dataset. The sample data comes from the Cohen book, and even though I wrote the code myself, it is based on example code Cohen provides with the book, so unfortunately I'm not sure if it's ethical to share it, but that would hopefully clarify what I mean. That being said, I should be able to articulate it better myself. If anybody thinks they can explain what I'm talking about better I would greatly appreciate it, otherwise I might have to come back to you after I've done some rereading. On Tue, Oct 28, 2014 at 3:54 PM, Orion wrote: > Hi Max, > > Can you clarify what you mean by a Hilbert time-frequency analysis? > Performing hilbert on a signal will give several different outputs, like > the envelope and phase, and if you want, the instantaneous frequency. But > I don't understand the meaning of Hilbert time-frequency. > > There are ways of calculating hilbert that don't use fft, but as fars as > I'm aware, the hilbert.m that calls fft.m provides a quick way to the > desired outputs. > > Orion > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 21:50:36 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 16:50:36 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. Best On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Oct 29 08:26:29 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 29 Oct 2014 08:26:29 +0100 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: Dear all, The following paper by Andreas Bruns might offer some highly relevant background: Bruns (2004) J Neurosci Meth Fourier-, Hilbert- and wavelet-based signal analysis: are they really different approaches? http://www.sciencedirect.com/science/article/pii/S0165027004001098 Best, Eelke On 28 October 2014 21:50, Rodrigo Montefusco wrote: > To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. > > Best > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor > wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco > wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor > wrote: > Hi, > > So this is not a specific method-based question, but something more general. > > I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. > > So boiling it down, my questions are: > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From mcantor at umich.edu Wed Oct 29 14:40:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Wed, 29 Oct 2014 09:40:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: I will definitely need to read this, thank you! I am familiar with some of the differences between Wavelets and Hilbert, such as Wavelet filter kernel always being Gaussian whereas Hilbert can be varied, and Wavelets being somewhat more computationally efficient, but I was also under the impression that they are not fundamentally different. This discussion is actually something I've been having with a small group here at University of Michigan so this article may help clarify more details for us. On Wed, Oct 29, 2014 at 3:26 AM, Eelke Spaak wrote: > Dear all, > > The following paper by Andreas Bruns might offer some highly relevant > background: > > Bruns (2004) J Neurosci Meth > Fourier-, Hilbert- and wavelet-based signal analysis: are they really > different approaches? > http://www.sciencedirect.com/science/article/pii/S0165027004001098 > > Best, > Eelke > > On 28 October 2014 21:50, Rodrigo Montefusco > wrote: > > To where I understand, yes. Just remember that is amplitude and not > power (you probably knew that). I should remark that the filter part is > tricky and critical. > > > > Best > > > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor mcantor at umich.edu>> wrote: > > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > > Hi Max, > > > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > > > Hopefully someone else has something to add, or if I'm missing any stuff. > > > > Best > > > > Rodrigo > > > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor mcantor at umich.edu>> wrote: > > Hi, > > > > So this is not a specific method-based question, but something more > general. > > > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > > > However, I was wondering if it would be possible to use > ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in > ft_preprocessing) to do this in a more efficient and fieldtrip-compatible > way. It seems I can use this setting to get the analytic signal, phase, > power, and other things, but since this is on raw/epoched data, there is no > obvious way I can think of to apply a time or frequency series as in the > other TFRs. It seems I could either write a fieldtrip function from > scratch, which I'm not prepared to do, or write a function to reformat > fieldtrip data to work using the Cohen function, and then output it back > into a fieldtrip function, which would be fine but I'm more interested to > know if the ft_preproc_hilbert function can do what I want more efficiently. > > > > So boiling it down, my questions are: > > > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > > > 2. If it cannot be used this way, what situations is it meant for? > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexander_Nakhnikian at hms.harvard.edu Wed Oct 29 18:19:51 2014 From: Alexander_Nakhnikian at hms.harvard.edu (Nakhnikian, Alexander) Date: Wed, 29 Oct 2014 13:19:51 -0400 Subject: [FieldTrip] Cross-Spectral Input to ft_eloreta Message-ID: <574C31932EBF144DB111B356E91DEC2D014A3BE40CC7@ITCCRMAIL01.MED.HARVARD.EDU> Hello, I'm trying to perform source analysis on an EEG data set using ft_eloreta. I've set up the analysis using the dipole and volume conduction models included in fieldtrip. I want to perform the analysis in frequency space, which means I need to enter a cross-spectral matrix for the variable Cf. The cross-spectral matrix returned by ft_freqanalysis doesn't work. ft_eloreta runs into trouble on line 163 "csd = dip.filter{i}*Cf*dip.filter{i}' " where Cf is the cross-spectral density matrix returned by ft_freqanalysis. This matrix has many rows and its number of columns is equal to the number of frequencies analyzed. The row number is (numChannels*(numChannels-1))^2/2, so it's assigning a row index to each pair-wise combination of channels, ignoring complex conjugate pairs and autospectra. The problem is that dip.filter{i} has dimensionality 3 x numChannels, which means Cf must be a numChannels x numChannels matrix to make the linear algebra work out. Is there a program in fieldtrip that returns a square cross-spectral density matrix for the frequencies of interest? Are there methods papers by Pascual-Marqui or others that deal with how to construct the cross-spectral matrix? I am new both to fieldtrip and to eLORETA so any advice would be greatly appreciated. Thanks in advance, Alexander Nakhnikian From joseangel.pineda at ctb.upm.es Thu Oct 30 16:44:34 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:44:34 +0100 Subject: [FieldTrip] Fwd: In-Reply-To: References: Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Thu Oct 30 16:46:23 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:46:23 +0100 Subject: [FieldTrip] Senior Researcher position in Madrid, Spain Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Thu Oct 30 19:10:35 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Thu, 30 Oct 2014 19:10:35 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Fieldtripers! I have data collected with Neuroscan 32 channels quickcap (1020 standard). There is no template layout for it so I tried to create it myself and had to use Robert Oostenveld's help to succeed (please, see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). So now I have a nice layout. I have checked it with cfg = []; cfg.layout = 'quickcap32.lay' ft_layoutplot(cfg) And I have created a .mat file out of it with layout = ft_prepare_layout(cfg) save quickcap32.mat layout And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): templates_dir = 'D:/My Documents/MATLAB/template/layout/' load([templates_dir 'quickcap32.mat']); cfg = []; cfg.layout = lay; ... I get this *Undefined function or variable 'lay'* message. What am I doing wrong? Any tips will be GREATLY appreciated! Kind regards, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 30 19:37:31 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 30 Oct 2014 14:37:31 -0400 Subject: [FieldTrip] Undefined function or variable 'lay' In-Reply-To: References: Message-ID: Yanina, It looks like your layout variable is called "layout", but your cfg.layout is looking for a variable called "lay". The variable "lay" variable doesn't exist, but I bet "layout" does :-) Best, Raquel On Thu, Oct 30, 2014 at 2:10 PM, Yanina Prystauka wrote: > Dear Fieldtripers! > > I have data collected with Neuroscan 32 channels quickcap (1020 > standard). There is no template layout for it so I tried to create it > myself and had to use Robert Oostenveld's help to succeed (please, see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). > > So now I have a nice layout. I have checked it with > > cfg = []; > cfg.layout = 'quickcap32.lay' > ft_layoutplot(cfg) > > And I have created a .mat file out of it with > > layout = ft_prepare_layout(cfg) > > save quickcap32.mat layout > > And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): > > templates_dir = 'D:/My Documents/MATLAB/template/layout/' > > load([templates_dir 'quickcap32.mat']); > > cfg = []; > > cfg.layout = lay; > > ... I get this *Undefined function or variable 'lay'* message. > > What am I doing wrong? Any tips will be GREATLY appreciated! > > Kind regards, > > Yanina > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Fri Oct 31 13:19:18 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 12:19:18 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Oct 31 13:29:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 31 Oct 2014 13:29:30 +0100 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> References: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> Message-ID: Dear Emma, I've not read your full post, but can say this about the latter part: fieldnames() should be a builtin MATLAB command. Most likely your version of MATLAB is too old; could you try using a more recent version? Typically we try to support versions up to 5 years old for use with FieldTrip. Hope that helps, Best, Eelke On 31 October 2014 13:19, Emma Holmes wrote: > Dear all, > > I am trying to perform spatio-temporal cluster statistics to the sources of > an EEG dataset, which I localised using the SPM8 toolbox. > For each participant (averaged across trials), I have a .nii image > containing the source reconstruction for each of two conditions at multiple > different time points. Each nifti file contains a matrix of 91 x 109 x 91, > which corresponds to the source estimates at each voxel. > My aim is to identify sources of activity that span large clusters of voxels > and/or time points, similar to what I have done previously with the scalp > data. > > I understand that the function 'ft_sourcestatistics' should be able to > achieve this with the data output from the function 'ft_sourcegrandaverage'. > However, I am having difficulty structuring the data from the nifti files in > a format that can be successfully input to 'ft_sourcegrandaverage'. > > The data that I am trying to input to 'ft_sourcegrandaverage' contains a > cell array of structures--one for each participant. > As far as I understand from the documentation, each structure should contain > a 'pos' field, which specifies the [x y z] co-ordinates for each position in > the matrix (in my case, a matrix of size 91*109*91 x 3). > I have also included a 'time' field, containing a vector of the time points > to which each .nii image corresponds and a 'dim' field containing the vector > [91 109 91]. > > Could you please let me know whether or not this is correct and in which > field(s) I should subsequently add the source reconstruction estimates at > each time point. > So far, I have tried including an 'avg' field with the data at each time > point (91 x 109 x 91 x ntps). > However, when I do so, I get the following error: > > ??? Undefined function or method 'fieldnames' for input arguments of type > 'double'. > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > Error in ==> ft_checkdata at 578 > param = setdiff(parameterselection('all', data), exclude); > > Error in ==> ft_sourcegrandaverage at 81 > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, > 'feedback', 'no', > 'inside', 'logical', 'sourcerepresentation', 'new'); > > I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 > (although I have also tried other fieldtrip versions). > > Any help would be greatly appreciated. > > Best wishes, > Emma > From eh776 at york.ac.uk Fri Oct 31 14:45:04 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 13:45:04 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear Eelke, Thanks for your comment--a relevant suggestion. However, the fieldnames() command is present in my version of MATLAB when I type "help fieldnames". Therefore, I suspect my problem arises not because the function is unavailable, but because the input to the function is incorrect. The documentation states that the input to fieldnames() should be a structure. However, if data.avg should be a structure, this seems to conflict with other fieldtrip data types involving data.avg. I suspect that I should not input the source matrix to the data.avg field. However, I am unsure into which field it should go... Is there anyone who could help me? Best, Emma On 31 October 2014 13:29, Eelke Spaak wrote: > Dear Emma, > > I've not read your full post, but can say this about the latter part: > fieldnames() should be a builtin MATLAB command. Most likely your > version of MATLAB is too old; could you try using a more recent > version? Typically we try to support versions up to 5 years old for > use with FieldTrip. > > Hope that helps, > Best, > Eelke On 31 October 2014 13:19, Emma Holmes > wrote: >* Dear all, *>>* I am trying to perform spatio-temporal cluster statistics to the sources of *>* an EEG dataset, which I localised using the SPM8 toolbox. *>* For each participant (averaged across trials), I have a .nii image *>* containing the source reconstruction for each of two conditions at multiple *>* different time points. Each nifti file contains a matrix of 91 x 109 x 91, *>* which corresponds to the source estimates at each voxel. *>* My aim is to identify sources of activity that span large clusters of voxels *>* and/or time points, similar to what I have done previously with the scalp *>* data. *>>* I understand that the function 'ft_sourcestatistics' should be able to *>* achieve this with the data output from the function 'ft_sourcegrandaverage'. *>* However, I am having difficulty structuring the data from the nifti files in *>* a format that can be successfully input to 'ft_sourcegrandaverage'. *>>* The data that I am trying to input to 'ft_sourcegrandaverage' contains a *>* cell array of structures--one for each participant. *>* As far as I understand from the documentation, each structure should contain *>* a 'pos' field, which specifies the [x y z] co-ordinates for each position in *>* the matrix (in my case, a matrix of size 91*109*91 x 3). *>* I have also included a 'time' field, containing a vector of the time points *>* to which each .nii image corresponds and a 'dim' field containing the vector *>* [91 109 91]. *>>* Could you please let me know whether or not this is correct and in which *>* field(s) I should subsequently add the source reconstruction estimates at *>* each time point. *>* So far, I have tried including an 'avg' field with the data at each time *>* point (91 x 109 x 91 x ntps). *>* However, when I do so, I get the following error: *>>* ??? Undefined function or method 'fieldnames' for input arguments of type *>* 'double'. *>>* Error in ==> parameterselection at 47 *>* tmp = fieldnames(data.avg); *>>* Error in ==> ft_checkdata at 578 *>* param = setdiff(parameterselection('all', data), exclude); *>>* Error in ==> ft_sourcegrandaverage at 81 *>* varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, *>* 'feedback', 'no', *>* 'inside', 'logical', 'sourcerepresentation', 'new'); *>>* I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 *>* (although I have also tried other fieldtrip versions). *>>* Any help would be greatly appreciated. *>>* Best wishes, *>* Emma* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Fri Oct 31 16:28:59 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Fri, 31 Oct 2014 16:28:59 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Raquel, Thanks a lot for paying attention to my e-mail! I have messed up with the variables and didn't even notice, thanks for pointing that out! Good luck, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Fri Oct 31 16:47:38 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Fri, 31 Oct 2014 16:47:38 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions Message-ID: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 31 16:56:16 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 31 Oct 2014 16:56:16 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_testsbut instead of a 2-by-2 factorial design, I am using a 2-by-11 factorialdesign. As such, I am not sure how this translates when making differencedata structures. I hope I am not missing something obvious.Thanks again,DylanOn Tuesday, 28 October 2014, Eelke Spaak wrote:Dear Dylan,You don't want (or need) a single struct with a subj X chan X freq Xtime powspctrm. Instead, it is often convenient to collect eachindividual subject's struct in a *cell* array (rather than a structarray). See, for example, here:http://www.mathworks.nl/help/matlab/cell-arrays.html and here:http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/.At the statistics step you should pass in multiple structs, each onecorresponding to one unit-of-observa tion, to ft_freqstatistics. Thiscan be done like so:stat = ft_freqstatistics(cfg, struct11, struct12,struct13,...struct21, struct22, ...);or, using the cell arrays, like so:stat = ft_freqstatistics(cfg, groupA{:}, groupB{:});Make sure that each column in your design matrix describes oneunit-of-observation, in the order in which the structs are passed intoft_freqstatistics.Best,EelkeOn 21 October 2014 03:41, Dylan DeLosAngeles > wrote:> Dear Eelke,>> Thank you for help regarding cluster-based permutation analysis of two ormore conditions.>> I am using time-frequency data (not time-lock structures). My firstproblem seems to be getting my 12 subjects into the 4D powspectrum.>> My code below loads 12 subjects from the first group, but I end up with a1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x3 frequencies x 2049 time points, rather than one struct with a 4D powspctrmwith 12 subjects as rows x electrodes x freqs x time points.>> for k = 1:Nmt, % states> for i = 1%:Ng, % groups> for j = 1:Ns, % subjects>> % load files> p(j) = eeg3.eeg.load(fullfile(fpath,fname2));>> % convert to eeglab to get channel locations> EEG(j) = eeg2eeglab( p(j));> EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile);>> % preprocessing in fieldtrip> d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing');>> % specify length of time to use in config> time = EEG(j).xmax-EEG(j).xmin;>> % setup configuration for freqanalysis> cfg = []; % clear cfg> cfg.output = 'pow';> cfg.channel = 'EEG';> cfg.method = 'mtmconvol';> cfg.taper = 'hanning';> cfg.foi = 0.5:3; % delta> cfg.toi = 1:0.05:time; % length of each state> cfg.t_ftimwin = 7./cfg.foi; % 7 cycles> cfg .keeptrials = 'yes';>> % do freqanalysis> freqdata(j) = ft_freqanalysis( cfg, d(j));> end> end> end>> My second problem is loading in the second group of 12 subjects and whatthat will look like when I run ft_freqstatistics.>> Lastly, I just want to confirm what you said in your previous email, thatI should be using indepsamplesF for more than two conditions (I have 11),and therefore my design should look like this;> 1 2 1 2 1 2 1 2 1 2 1 2 12 1 2 1 2 1 2 1 2 (two groups)> 1 1 2 2 3 3 4 4 5 5 6 6 77 8 8 9 9 10 10 11 11 (11 conditions)>> Any help would be appreciated.>> Kind regards,> Dylan>>>>> On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote:> Hello Dylan,>> You can analyse a between-subje cts design exactly as you would a> between-trials design (at least as far as the statistics step is> concerned), in both cases the two conditions correspond to two groups> of observations, and not to the same group of observations measured in> two separate conditions (which would be a within-UO design). In> FieldTrip, you would typically compute averages per subject, then use> an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic> (not depsamples). indepsamplesT only requires one row in the design> matrix, indicating the condition.>> Note that if you have e.g. timelock structures in two (or more) cell> arrays, corresponding to the conditions, you can input them into the> statistics function as follows:>> stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:});>> without having to call ft_timelockgrandaverage. In fact, the above is> the preferred way to do statistics now. (The same holds for> ft_freqstatistics.)>> Hope that helps,> Best,> Eelke>> On 24 September 2014 0 2:32, Dylan DeLosAngeles> >> wrote:>> Hello,>>>> So far, the tutorial on "Cluster-based permutation tests ontime-frequency>> data" has been very helpful.>>>> Out of the four combinations from the two UO-types (subjects and trials)and>> the two experimental designs (between- and within-UO), the tutorialcovers>> statistics on data in two conditions in a between-trials, in awithin-trials>> and in a within-subjects design. However, I am wondering if there is any>> information about the fourth type of experiment design: between-subjects.>>>> I have data for 2 groups with 12 subjects in each group. Both groups are>> measured during 11 conditions.>> Can I approach this in a similar fashion to within-subjects design(multiple>> subjects in multiple experimental conditions), such that my design is>> multiple groups in multiple experimental conditions. Is it a case offirst>> averaging over all trial s belonging to each of the experimentalconditions>> for each subject (as instructed in tutorial), and then averaging over all>> subjects in each group?>>>> Configuration code for setting up the design currently looks like this;>> grp = 2;>> subj = 11;>> design = zeros(2, subj*grp);>>>> for i = 1:grp>> design(1,i:2:end) = i;>> end>>>> idx = 1;>> for i = 1:subj>> design(2,idx:idx+1) = i;>> idx = idx+2;>> end>>>> Is there anything else I need to take into consideration when doing these>> statistics?>>>> Thank you,>> Dr Dylan DeLosAngeles>> Research Fellow>> Brain Signal Laboratory>> Flinders University>>>> _______________________________________________>> fieldtrip mailing list>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip> _______________________________________________> fieldtrip mailing list> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>_______________________________________________fieldtrip mailing listfieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 31 17:02:09 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 31 Oct 2014 16:02:09 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> References: , <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> Message-ID: Hi Emma, In this part: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); it says that the function 'fieldnames' doesn't know how to deal with data that is of the type double. This is because fieldnames expects your data to be in the format of a struct. I'm guessing there was just an error in your implementation because from your message you understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones for each participant. Furthermore, you need to put your source estimates in data.pow.avg. Based on your description, you might try something like this (but it's not guaranteed to work because I'm not entirely sure about the details of your data) data.pos = [902629x3 double] data.dim = [91 109 91] data.time = [1 x Z double] % vector of time points data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency x time points, depending on your data). As a side note, the size of your data will be quite taxing on computational memory so you might also want to consider using a lower spatial resolution. Finally, in the future, when describing your data, it would be best to show the structure of your data as shown in matlab (as done above), because this makes it easier for everyone else to see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community Best, Nietzsche From: Emma Holmes > Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Date: October 31, 2014 at 1:19:18 PM GMT+1 To: > Reply-To: FieldTrip discussion list > Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattmizumi at gmail.com Wed Oct 1 05:00:26 2014 From: mattmizumi at gmail.com (Matthijs van der Meer) Date: Tue, 30 Sep 2014 23:00:26 -0400 Subject: [FieldTrip] single-trial power correlation: why not? Message-ID: <542B6E4A.3090409@gmail.com> *Short version of question:* What can I do to get ft_connectivityanalysis to compute a power correlation for a single trial? Or is this a stupid question based on a misunderstanding of what this function is designed to do? Conceptually, there doesn't seem to be a problem with this, because if I have two signals I can compute the instantaneous power of each as a function of time for a given frequency, and correlate them. However, when calling ft_connectivityanalysis on the output of ft_freqanalysis with only one trial, an error is thrown. *Long version of question:* My data looks like this: hdr: [1x1 struct] label: {'X' 'Y'} fsample: 2000 trial: {1x351 cell} time: {1x351 cell} sampleinfo: [351x2 double] cfg: [1x1 struct] Now I run a frequency analysis on one trial: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.foi = 40:1:100; cfg.trials = 1; cfg.taper = 'hanning'; cfg.polyremoval = 1; cfg.channelcmb = {'X','Y'}; F = ft_freqanalysis(cfg,data_trl); Then I would like to do cfg = []; cfg.method = 'powcorr'; powcorr = ft_connectivityanalysis(cfg, F); But this gives this unhelpful error: Error using fixdimord (line 159) unexpected dimord "rpttapn_freq" Nosing around in ft_connectivityanalysis() suggests that the following line data = ft_selectdata(data, 'avgoverrpt', 'yes'); assumes that we want to average over repetitions (trials), which has unexpected results when there is only one trial. Skipping this line enables ft_connectivityanalysis() to run without errors, but the resulting power correlation has only NaNs. Any suggestions? I know I can do the whole thing manually with filtering and Hilbert transforms and such, or perhaps workaround by creating fake trials, but it would be useful to do this in ft neatly. From jm.horschig at donders.ru.nl Wed Oct 1 16:03:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 01 Oct 2014 16:03:38 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <542C09BA.4020501@donders.ru.nl> Hi Ana, from the first call with eventtype = '?', the output says > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' This means that there is one event type in our data, namely 'trigger', and the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. FieldTrip works that way that it passes on the cfg.trialdef structure to the trialfun that is specified. In your particular case, trialfun_bit2dec does not seem to have a very user-friendly error message, but the error message means that whatever eventtype and eventvalues you asked for, they are not present in your data. When looking at what you define, you can probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. However, checking back the output that you created with '?', there is no event type 'STATUS' in your data. Therefore, everything works fine with your trialfun. If you try specifying the trialdef properly, everything should work fine. A general advise when using an own trial fun and getting an error message: Try your code without specifying cfg.trialfun first. Then FieldTrip will use the standard trialfun, which should work if all your cfg-settings are fine. If the standard trialfun runs without errors, then your trialfun should do so too. If your trialfun, however, then crashes, the error is most likely in the trialfun that you used, and not in the cfg-settings. In your case, however, I am fairly certain that the cfg-settings you specified were causing your problem. I hope this helps. Best, Jörn On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > For a more simple check, when I try to read the events without the > trialfun ( so it uses ft_trialfun_general by default) I get the > original event values: > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > > Warning: no trialfun was specified, using ft_trialfun_general > > In ft_definetrial at 135 > evaluating trialfunction 'ft_trialfun_general' > reading the events from '27CW1.RAW' > the following events were found in the datafile > event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' > no trials have been defined yet, see FT_DEFINETRIAL for further help > found 750 events > created 0 trials > the call to "ft_definetrial" took 4 seconds > > Then I try to use the trialfun, I get the same error > > >> cfg = []; > >> cfg.dataset = '27CW1.RAW'; > >> cfg.trialfun = 'trialfun_bit2dec'; > >> cfg.trialdef.eventtype = '?'; > >> cfg=ft_definetrial(cfg); > evaluating trialfunction 'trialfun_bit2dec' > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > So there is something the trialfun_bit2dec does that events cannot be > read anymore. > > > On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > wrote: > > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to > index an element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And > compare those with any of the ones falling under the switch case > statement? One way to do this, is to put a debug marker (red dot) > at the 'end' of the first for-loop (judging from the wiki). Then > check the value of event(i).value, and click the continue button > to move on to the next. An alternative way is to put a debug > marker after event = ft_read_event and to instantly check all > values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini > >: > > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini > > wrote: > > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = > 'saveonerror' and matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read > them with the raw data, they seem to be there, with the > DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk > > wrote: > > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]." > > that none of the triggers were found in your event > data. You might wanna check why this is happening, by > debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini > >: > > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I > followed your advice and I changed definetrial to > ft_definetrial and I confirm the function was > added to my paths. After doing this, the error I > get is: > > Attempted to access trl(:,1); index out of bounds > because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I > think I added what I think are useless lines but I > was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun > definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus > triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my > analysis because I would like to use only > Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > > wrote: > > Hi again Ana Laura, > > One other thing that I thought of was to make > sure that the function "trialfun_bit2dec" is > added to your paths in matlab, so that > ft_definetrial can find this function. > > By updating your fieldtrip to the most recent > version "trialfun_bit2dec" is *not* included. > So you'll need to store that as a separate .m > file in a location that can be accessed by the > paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > > > To: "FieldTrip discussion list" > > > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a > trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this > is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use > an old version of > > Fieldtrip for my scripts because I wrote > them long ago and this > > trialfun uses the new format (with > 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, > Nietzsche < > > n.lam at fcdonders.ru.nl > > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which > trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing > under "do the > > trial definition for the fully incongruent > (FIC) condition). > > > > Please try adding this: "cfg.trialfun = > 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see > below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% > trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error > message, it seemed that the > > problem was in the function > trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called > this function. I was > > wondering if the code you provide > corresponded to the code that > > created your error message? I'm guessing you > ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not > via definetrial). In which > > case, it was looking for > cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the > relevant information in > > the cfg (which is in the code you showed > us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < > diezmartini at gmail.com > > > > > To: "FieldTrip discussion list" < > fieldtrip at science.ru.nl > > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I > want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, > cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not > writing it in the correct part > > > of > > > my script. This is my trial definition > part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, > '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, > '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, > '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Nietzsche H.L. Lam, MSc > > PhD Candidate > > > > Max Planck Institute for Psycholinguistics > > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > > > Donders Institute for Brain, Cognition and > Behaviour, > > Centre for Cognitive Neuroimaging, > > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > > > n.lam at fcdonders.ru.nl > > > +31-24-3668219 > > > > > > neurobiologyoflanguage.com > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and > Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From sreenivasan.r.nadar at gmail.com Thu Oct 2 03:08:41 2014 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 1 Oct 2014 21:08:41 -0400 Subject: [FieldTrip] Preprocessing for Elekta Message-ID: Hello Robert, Is there any standard preprocessing script available for the Elekta MEG (306 sensors) system from your group? Thanks Regards, Sreenivasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Oct 2 08:53:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 2 Oct 2014 08:53:18 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: Hi Sreenivasan, Just four days ago, Stephen posted the following to the list in response to an almost identical question: http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html Eelke On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. wrote: > Hello Robert, > > Is there any standard preprocessing script available for the Elekta MEG (306 > sensors) system from your group? > > Thanks > > Regards, > Sreenivasan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Thu Oct 2 10:34:49 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 2 Oct 2014 10:34:49 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: References: Message-ID: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Hi Sreenivasan, in addition to Eelke’s response you can also have a look here: http://fieldtrip.fcdonders.nl/getting_started/neuromag Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. best tzvetan > Hi Sreenivasan, > > Just four days ago, Stephen posted the following to the list in > response to an almost identical question: > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html > > Eelke > > On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. > wrote: >> Hello Robert, >> >> Is there any standard preprocessing script available for the Elekta MEG (306 >> sensors) system from your group? >> >> Thanks >> >> Regards, >> Sreenivasan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From spa268 at nyu.edu Thu Oct 2 12:37:47 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 2 Oct 2014 14:37:47 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eric, Thank you very much, this is what I had in mind! Best, Steve > > > Message: 1 > Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) > From: "Eric Maris" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Steve, > > > > Have a look here: > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests > > > > Best, > > > > Eric Maris > > > > From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] > Sent: woensdag 24 september 2014 11:18 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject > design > > > > Hi Eelke, > > > > Thanks for this information. I just wanted to jump in and ask: what about > for interactions in a mixed 2x2 design? For example, say I expect a > difference between conditions A and B for group 1, but not group 2. Would > the correct way to do this be to > > > > 1) make difference waves (A-B) for each participant, then > > 2) do a between-UO test on the difference waves using indepsamplesT? > > > > In the past I have always tested within-UO interactions using basically this > method (based on > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html ), > but I was under the impression that this is not OK for mixed designs (from > this post: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) > > > > Thanks, > > Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Thu Oct 2 14:24:39 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Thu, 2 Oct 2014 12:24:39 +0000 Subject: [FieldTrip] buffer.mexw64 not found Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.gwilliams at nyu.edu Thu Oct 2 16:02:12 2014 From: laura.gwilliams at nyu.edu (Laura Elizabeth Gwilliams) Date: Thu, 2 Oct 2014 18:02:12 +0400 Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system Message-ID: Dear Fieldtrippers, I am trying to run a time-frequency analysis, but I am having difficulty plotting the TFRs on the sensor arrays using ft_multiplotTFR. The reason for this is that I cannot find an appropriate *.lay file for my sensor array to use in the cfg.layout argument. I am using data from a Yokogawa MEG system with 208 channels. But when looking at the layout files available within fieldtrip, the "yokogawa440.lay" does not seem to have the correct number of sensors for my data. Do you know how I can either get my hands on the correct layout file, or create my own? I have looked at the tutorials for help (i.e., http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout) but this does not seem to solve my problem. It appears that I should be able to extract sensor information directly from my data to create my own .lay file, but there are no instructions on how to go about this. Any advice you can offer would be very much appreciated. Regards, Laura. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Thu Oct 2 16:23:11 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Thu, 2 Oct 2014 16:23:11 +0200 (CEST) Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system In-Reply-To: Message-ID: <1400667131.1960820.1412259791755.JavaMail.root@indus.zimbra.ru.nl> Hi Laura, Please take a look at this tutorial on creating a layout: http://fieldtrip.fcdonders.nl/tutorial/layout Best, Nietzsche ----- Original Message ----- > From: "Laura Elizabeth Gwilliams" > To: fieldtrip at science.ru.nl > Sent: Thursday, 2 October, 2014 4:02:12 PM > Subject: [FieldTrip] Channel layout file for 208 channel Yokogawa MEG system > Dear Fieldtrippers, > > > I am trying to run a time-frequency analysis, but I am having > difficulty plotting the TFRs on the sensor arrays using > ft_multiplotTFR. The reason for this is that I cannot find an > appropriate *.lay file for my sensor array to use in the cfg.layout > argument. > > > I am using data from a Yokogawa MEG system with 208 channels. But when > looking at the layout files available within fieldtrip, the > "yokogawa440.lay" does not seem to have the correct number of sensors > for my data. > > > Do you know how I can either get my hands on the correct layout file, > or create my own? I have looked at the tutorials for help (i.e., > http://fieldtrip.fcdonders.nl/reference/ft_prepare_layout ) but this > does not seem to solve my problem. It appears that I should be able to > extract sensor information directly from my data to create my own .lay > file, but there are no instructions on how to go about this. > > Any advice you can offer would be very much appreciated. > > > Regards, > Laura. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From r.oostenveld at donders.ru.nl Thu Oct 2 19:20:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 19:20:11 +0200 Subject: [FieldTrip] Fwd: Postdoc position, Stockholm, Sweden References: <71FFC072A22A7E448CD56F40BD593D677900EC95@KIMSX04.user.ki.se> Message-ID: <033EDCEA-66B1-464B-90C7-FC37BE3CA011@donders.ru.nl> Begin forwarded message: From: Daniel Lundqvist Subject: Postdoc position, Stockholm, Sweden English Postdoctoral Research Fellow in Magnetoencephalography (MEG) Karolinska Institutet, The Department of Clinical Neuroscience The Department of Clinical Neuroscience (CNS) conducts research and education in the field of neuroscience from the molecular level to the society level. The clinical research and education is conducted in collaboration with other research groups from the Karolinska Institutet, with other universities as well as the Stockholm County Council. Please visit our website for more information: ki.se/en/cns NatMEG – the National Facility for Magnetoencephalography (MEG) As of September 2013, Karolinska Institutet hosts a superbly equipped MEG lab. The lab, NatMEG, is a national facility, open for researchers from all across Sweden. The fact that NatMEG is a national facility is reflected by the wide array of projects currently ongoing/under initiation at NatMEG, covering areas such as next-generation SQUIDS, computational modelling, epilepsy work-ups, and cognitive neuroscience in the areas of memory, language, attention, perception, pain, music, decision making, emotion, autism, schizophrenia, Parkinson’s and Alzheimer’s disease, and more. The position as postdoctoral research fellow at NatMEG NatMEG currently have one post doc and three guest professors to support and initiate research at the lab. We are new expanding our team with another postdoc researcher. The 2 year position gives the researcher an unusual mix of inspiring interaction with researchers from a wide range of research areas and a freedom to pursuit one’s own qualified research questions. Please visit www.natmeg.se for more information. Duties The duties as a postdoc will consist of: Research and development of methods and analysis within MEG and EEG at the national infrastructure for magnetoencephalography (NatMEG), entailing some general operation. Scientific support to users at NatMEG, regarding methods, experimental design and analysis. The postdoc’s own qualified research within MEG, and/or simultaneous MEG & EEG. Entry requirements A person is eligible for a position as postdoctoral research fellow if he or she has obtained a PhD no more than seven years before the last date of employment as postdoc. It is highly valued if a candidate: Has strong skills and expertise in MEG analysis (preferably in FieldTrip and/or MNE). Has extensive MEG hands-on experience (preferably on an Elekta Triux or Vectorview system), with setting up experiments including peripheral stimulators. Has extensive hands-on experience from data collection, including system tuning, screening and subject preparations. Is independent, professional, and service minded, and enjoys interacting with researchers and research subjects. Has experience with psychophysiology measurements. Has experience with eye tracking measurements. Has a research interest within the cognitive neuroscience domain. Masters academic English It is also valued if a candidate: Has experience with MEG (and/or EEG) measurements on children, and on clinical populations such as Autism, Schizophrenia, Alzheimer's and Parkinson's disease, Has medical or psychology training Application process An employment application must contain the following documents in English or Swedish: 1. A complete curriculum vitae, including date of the thesis defence, title of the thesis, previous academic positions, academic title, current position, academic distinctions, and committee work 2. A clear description of how entry requirements are met 3. A complete list of publications 4. A summary of current work (no more than one page) 5. Verifications for crediting of illness, military service, work for labour unions or student organisations, parental leave or similar circumstances 6. Verification from the thesis defence committee or the equivalent (only if the thesis defence is scheduled within three months after the application deadline) The application is to be submitted in the MyNetwork recruitment system. Qualified candidates will initially be interviewed over Skype, and will also be asked to make a presentation of her/his research and research plans over Skype. The final evaluation of candidates may involve a lab visit and a formal interview at NatMEG and Karolinska Institutet. Karolinska Institutet is one of the world´s leading medical universities. Its mission is to contribute to the improvement of human health through research and education. Karolinska Institutet accounts for over 40 per cent of the medical academic research conducted in Sweden and offers the country´s broadest range of education in medicine and health sciences. Since 1901 the Nobel Assembly at Karolinska Institutet has selected the Nobel laureates in Physiology or Medicine. Pursuant to the regulations of the Swedish National Archives, applications are kept on file for two years after the appointment has gained legal force. The regulations do not apply to attachments that have been printed or otherwise published. Karolinska Institutet strives to provide a workplace that has approximately the same number of women and men, is free of discrimination and offers equal opportunity to everyone. For temp agencies and recruiters, and to salespersons: We politely, yet firmly, decline direct contact with temp agencies and recruiters, as well as those selling additional job announcements. Type of employment: Temporary position longer than 6 months Working hours: Full time Working hours: 100% City: Stockholm County: Stockholms län Country: Sweden Reference number: 2-3004/2014 Contact: 1. Daniel Lundqvist, Head of Unit, +46 8-524 832 62 2. Elin Johansson, HR Officer, +46 8-524 830 44 Union representative: 1. Arsalan Amir, SACO, 08 - 517 733 37, arsalan.amir at ki.se 2. Christina Hammarstedt, OFR, christina.hammarstedt at ki.se 3. Gunnar Stenberg, SEKO, 08-524 880 75 Published: 01.Oct.2014 Last application date: 21.Oct.2014 Return to job vacancies Application process Read more about the application process at http://ki.mynetworkglobal.com/en/what:job/jobID:43573/. Applications are to be submitted in the recruitment system MyNetwork. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 8101 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 260 bytes Desc: not available URL: From russgport at gmail.com Thu Oct 2 20:10:58 2014 From: russgport at gmail.com (Russell G Port) Date: Thu, 2 Oct 2014 14:10:58 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data In-Reply-To: References: Message-ID: Dear All, Sorry for this repetitive email. I realize one I have asked this question before, I couldn't find the email before now, so I was not sure if it were the exact same question. Please ignore this email discussion. for those who were wondering here is the previous answer This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). Again thank is due to Dr. Schurger, and my apologizes On Tue, Sep 30, 2014 at 10:08 AM, Russell G Port wrote: > Hi All, > > I have a question, which I hope someone can help with. Currently I read in > my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins > for the length of the data. After proper removal of all jump and muscle > artifact, I apply ICA to the resample data (now 300Hz before it was > 1200Hz). This is just like fieldtrip's website suggests. Then I verify > which components I want to remove via topoplots and coherence in the time > domain with the ECG channels. So I now have the list of components that I > think are artifact and want removed. Can these components be applied for > rejection onto the same dataset, but differently parsed into epochs, now > trials being centered 1 second bins around a trigger? I am trying to see if > this works, because I hope if I include more data in the ICA analysis (all > data in the dataset) I will get a better components since there are more > trials to train the data on, rather than if I based trials around the > trigger. I guess what I want to know is if I can get better estimates of my > artifacts via using a larger dataset, and then apply then to the same > dataset just differently epoched? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Oct 2 21:53:16 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 2 Oct 2014 21:53:16 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Dear Anne, dear all, I did try to create a customized trialfunction serving my needs. This is what I came up with: function [trl, event] = response_trialfun(cfg); % read the header information and the events from the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); % search for "trigger" events value = [event(find(strcmp('ceck', {event.value}))).value]'; sample = [event(find(strcmp('ceck', {event.value}))).sample]'; % search for "trigger" events value2 = [event(find(strcmp('resp', {event.value}))).value]'; sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; % determine the number of samples before and after the trigger pretrig = -round(cfg.trialdef.prestim * hdr.Fs); posttrig = round(cfg.trialdef.poststim * hdr.Fs); % look for the combination of a trigger "7" followed by a trigger "64" % for each trigger except the last one trl = []; trlbegin = sample + pretrig trlend = sample + posttrig offset = pretrig RT = sample2 - sample newtrl = [trlbegin trlend RT]; trl = [trl; newtrl]; end In fact it seems to work, the trials look good and the RT is computed correctly. Only that after the preprocessing (with ft_preprocessing: %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] mov_data = ft_preprocessing(cfg); % ) there is no mov_data.trialinfo created. I thought that the information in trl above would be saved there. Without those I am not able to do the redefinition as planned (like Anne proposed: offset = (mov_data.trialinfo(:,3)); prestim = 0.75; poststim = 0.75; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); mov_data_small = ft_redefinetrial(cfg, mov_data); % then shift the time axis cfg = []; cfg.offset = -offset; mov_data_small = ft_redefinetrial(cfg, move_data_small); How come the information is not stored? Somebody an idea? Thanks a million Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 2 23:54:26 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 2 Oct 2014 23:54:26 +0200 Subject: [FieldTrip] Preprocessing for Elekta In-Reply-To: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> References: <97BDC192-0B30-49D6-B39D-9383C64AC099@uni-konstanz.de> Message-ID: <76680AE0-A354-4E90-ABC7-38AA915C9B03@donders.ru.nl> Hi Sreenivasan To follow up on the email from Stephen: Right at this moment we are running the workshop at the NatMEG in Stockholm. During this week we finished a number of dedicated tutorials that are based on data from the Elekta/Neuromag system. Besides MEG data, the tutorials also deal with simultaneously recorded EEG data. You can find them here http://fieldtrip.fcdonders.nl/tutorial/natmeg The accompanying tutorial data is not yet completely available from the ftp server, but will be made available in one of the upcoming weeks. Furthermore, it might be that the tutorial pages might move around on the wiki (and hence the URL might change) to fit them better in the existing content. Note that you should not take these or any other tutorials as “standard” scripts, nor as a recommendation of best practice. They serve as examples to teach how certain analyses work, but are still specific to one particular dataset in one particular experimental paradigm. In general the tutorials show how you *can* do the analysis, but not how you *should* do it. vänliga hälsningar, Robert On 02 Oct 2014, at 10:34, Tzvetan Popov wrote: > > Hi Sreenivasan, > in addition to Eelke’s response you can also have a look here: > > http://fieldtrip.fcdonders.nl/getting_started/neuromag > > Once you can read your data in Matlab you can use the “standard" scripts provided in the tutorial section. > best > tzvetan > > >> Hi Sreenivasan, >> >> Just four days ago, Stephen posted the following to the list in >> response to an almost identical question: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008504.html >> >> Eelke >> >> On 2 October 2014 03:08, Sreenivasan R. Nadar, Ph.D. >> wrote: >>> Hello Robert, >>> >>> Is there any standard preprocessing script available for the Elekta MEG (306 >>> sensors) system from your group? >>> >>> Thanks >>> >>> Regards, >>> Sreenivasan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From boris.burle at univ-amu.fr Fri Oct 3 07:19:19 2014 From: boris.burle at univ-amu.fr (Boris BURLE) Date: Fri, 03 Oct 2014 07:19:19 +0200 Subject: [FieldTrip] Post-doc position Message-ID: <542E31D7.4070301@univ-amu.fr> Dear FieldTrip Users, The "Laboratoire de Neurosciences Cognitives" (Aix-Marseille Université, CNRS, Marseille, FR) is opening a post-doctoral position (EEG/MEG) to work on an ERC project aiming at deciphering pro-active and reactive cognitive control, within the team "Attention, Chronometry and Cortical Dynamics". Each position is offered for 12 months (first instance, potentially renewable). Applicants must have a PhD on Cognitive Neuroscience/Experimental Psychology (or related disciplines) and have a good knoedge on EEG and/or MEG processing. Knowledge on spatial analysis (CSD for EEG, inverse solution for EEG and MEG) is certainly a plus. Although not required, programming skills in high level scientific languages (Python, Matlab etc...) will be (highly) appreciated. The hosting group is equipped with several EEG systems (64 and 128 electrodes) and has access to a 248 magnetometers MEG system (4D Neuroimaging magnes 3600), coupled with an EEG system. When applying please indicate [post-doc EEG/MEG] in the subject of your mail. Salary will be adjusted based on experience, and will follow CNRS regulation (between 2000 and 2900€ net). The "Laboratoire de Neurosciences Cognitives" is embedded in a very active and large Brain Research community (the second largest in France), ranging from cellular physiology to social neurosciences. The hosting group has strong connections with the local Brain research community, and numerous international collaborations, that will benefit to the retained candidates. French speaking is not a requirement. Position starts as soon as possible, and will be opened until it is filled. Besides, Marseille is a very nice city in south of France, on the Mediterranean Sea, with a warm climate. It is also at about 1h30 from the Alps mountains, allowing easy access to hiking and winter sports. CV and motivation letters, along with informal enquiries, are to be sent to Boris BURLE (email: boris.burle at univ-amu.fr), with the appropriate subject heading (see above). All the best, B. Burle From m.goeldi at psychologie.uzh.ch Fri Oct 3 11:02:02 2014 From: m.goeldi at psychologie.uzh.ch (m.goeldi at psychologie.uzh.ch) Date: Fri, 3 Oct 2014 11:02:02 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming Message-ID: Hi fieldtrippers I am trying to do source localization for my EEG data with beamforming, but my results seem to indicate something has gone wrong. The subjects were exposed to a flickering screen of 14Hz so I expect atleast some activity in the visual cortex. The topoplot of a frequency analysis showed a 15Hz peak in the parietal area. The Problem: I always get extreme activity in a few voxels, usually around the fringes of my volume, several orders of magnitude larger than the rest. See attached figure 1. If I adjust the colorscale of my plot drastically i only get activity at the fringes of the brain/along the skull. See figure 2. This seems like a systematic error but at this point I am not sure where my error is. I am suspecting the forward/inverse model, the frequency analysis or my preprocessing pipeline. (So basically everything) I have created my source model using .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in fieldtrip and I have also tried to create the headmodel myself using .\fieldtrip-20140225\template\headmodel\standard_mri.mat. The results are slightly different as in where the extreme activities are, but qualitatively they are the same. A plot of the head and source model with the electrodes is attached in figure3. Source, head and electrodes seem to math up fine. The Questions: Is there something obviously wrong with my head/source model? Is there something wrong with how i calculate the cross spectral density matrix? And is there a way to visualize the output of ft_freqanalysis to do a sanity-check? Since there is no time dimension the ft plotting options don't work. Is there something wrong with my preprocessing pipeline? (Artifact rejection was done before using VisionAnalyzer2) Thanks in advance for your thoughts and inputs Cheers Maurice PS: Before submitting this I updated to the newest version of ft (20141002) to see if it was a version issue. It turns out that all the template files I had been using from my previous install (20140225) have vanished sometime inbetween. Is there a reason for this? Btw. I ran it with the new version and the old template files and the result is the same. Some Code: %% Preprocessing: cfg = [];                                           % empty configuration cfg.dataset                 = '..\Data\9 20131105 0928_Segmentation 3.dat';       % dataset  cfg.trialdef.eventtype      = 'Comment'; cfg.trialdef.prestim        = 0.3; cfg.trialdef.poststim       = 2; cfg.trialdef.eventvalue     = {'14HZ'}; cfg = ft_definetrial(cfg); % baseline correction cfg.demean = 'yes'; cfg.baselinewindow = [-0.3 0]; % rereference to avg over all cfg.reref = 'yes'; cfg.refchannel = 'all'; data = ft_preprocessing(cfg); % shifts and scales all channles of the the input data % to a mean of zero and a standard deviation of one. cfg = []; data = ft_channelnormalise(cfg,data); % load the manually realigned electrodes load('.\Data\electrodes_aligned.mat'); % Time window of interest cfg = [];                                           cfg.toilim = [0 2];                       dataPost = ft_redefinetrial(cfg, data); %% Calculating the cross spectral density matrix cfg            = []; cfg.method     = 'mtmfft'; cfg.taper = 'dpss'; cfg.output     = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq  = 2; cfg.foi        = 15; freqPost      = ft_freqanalysis(cfg, dataPost); %% The forward model and lead field matrix % load mri load('C:\Program Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') % make segments cfg          = []; segmentedmri = ft_volumesegment(cfg, mri); segmentedmri.transform = mri.transform; segmentedmri.anatomy   = mri.anatomy; %load template sourcemodel template = load('C:\Program Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); % compute source model cfg                = []; cfg.grid.warpmni   = 'yes'; cfg.grid.template  = template.sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri            = mri; sourcemodel        = ft_prepare_sourcemodel(cfg); % make headmodel cfg        = []; cfg.method = 'openmeeg'; hdm        = ft_prepare_headmodel(cfg, segmentedmri); vol = ft_convert_units(hdm, 'cm'); % lead field cfg                 = []; cfg.grid            = sourcemodel; cfg.elec            = elec; cfg.vol             = vol; cfg.channel = 'all'; cfg.normalize = 'yes';       % normalize instead of contrasting to noise estimate [grid] = ft_prepare_leadfield(cfg,freqPost); %% Source Analysis cfg              = []; cfg.elec         = elec; cfg.method       = 'dics'; cfg.frequency    = freqPost.freq;  cfg.grid         = grid; cfg.vol          = vol; cfg.keeptrials        = 'yes'; cfg.dics.lambda       = '10%'; cfg.dics.keepfilter   = 'yes'; cfg.dics.fixedori     = 'yes'; cfg.dics.realfilter   = 'yes'; sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); cfg              = []; cfg.voxelcoord   = 'no'; cfg.parameter    = 'avg.pow'; cfg.interpmethod = 'nearest'; sourcePostInt_nocon  = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); % plot cfg              = []; cfg.method       = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; % cfg.funcolorlim   = [0.0 0.08]; % cfg.opacitylim    = [0.0 0.2]; cfg.opacitymap    = 'rampup'; ft_sourceplot(cfg,sourcePostInt_nocon); --- University of Zürich Maurice Göldi Department of Psychology Biopsychology Binzmühlestr. 14 / Box 5 CH - 8050 Z�rich Tel. +41 (0)44 635 74 55 www.psychologie.uzh.ch maurice.goeldi at uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Oct 3 11:25:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 03 Oct 2014 11:25:24 +0200 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA> Message-ID: <542E6B84.2000106@donders.ru.nl> Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Fri Oct 3 11:27:15 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 3 Oct 2014 11:27:15 +0200 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: Hi Maurice, Having not read your post fully, the first thing that comes to mind is: are the units all in agreement for the geometric objects? I see you explicitly convert the headmodel to cm. You can apply the same function also to your source model, leadfield (probably redundant but can't hurt), and sensor definition. Does that help? Best, Eelke On 3 October 2014 11:02, wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, but > my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect atleast > some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the fringes of > my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at the > fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where my > error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities are, > but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact rejection > was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft (20141002) > to see if it was a version issue. > It turns out that all the template files I had been using from my previous > install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the result > is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation 3.dat'; > % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matt.craddock at uni-leipzig.de Fri Oct 3 12:11:29 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Fri, 03 Oct 2014 11:11:29 +0100 Subject: [FieldTrip] Getting unrealistic results or artifacts using beamforming In-Reply-To: References: Message-ID: <542E7651.1040105@uni-leipzig.de> Hi Maurice, I think the problem is here: > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate Although the tutorial page says normalizing is an alternative to contrasting the noise estimate (http://fieldtrip.fcdonders.nl/tutorial/beamformer), it isn't - perhaps it should be, I don't know, but it doesn't make any difference currently as far as I can tell. Perhaps it does with MEG data. You'll get much more sensible results if you contrast against a noise estimate or another condition. So for example, try adding cfg.dics.projectnoise = 'yes'; when doing the source analysis step and looking at the NAI. You might also want to make sure the leadfield is generated using an alphabetical channel order if the channels in your data are not alphabetically ordered - see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 Cheers, Matt On 03/10/2014 10:02, m.goeldi at psychologie.uzh.ch wrote: > Hi fieldtrippers > > I am trying to do source localization for my EEG data with beamforming, > but my results seem to indicate something has gone wrong. > The subjects were exposed to a flickering screen of 14Hz so I expect > atleast some activity in the visual cortex. > The topoplot of a frequency analysis showed a 15Hz peak in the parietal > area. > > > The Problem: > I always get extreme activity in a few voxels, usually around the > fringes of my volume, several orders of magnitude larger than the rest. > See attached figure 1. > If I adjust the colorscale of my plot drastically i only get activity at > the fringes of the brain/along the skull. > See figure 2. > > This seems like a systematic error but at this point I am not sure where > my error is. > I am suspecting the forward/inverse model, the frequency analysis or my > preprocessing pipeline. (So basically everything) > > I have created my source model using > .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in > fieldtrip > and I have also tried to create the headmodel myself using > .\fieldtrip-20140225\template\headmodel\standard_mri.mat. > The results are slightly different as in where the extreme activities > are, but qualitatively they are the same. > A plot of the head and source model with the electrodes is attached in > figure3. Source, head and electrodes seem to math up fine. > > > The Questions: > Is there something obviously wrong with my head/source model? > > Is there something wrong with how i calculate the cross spectral density > matrix? > And is there a way to visualize the output of ft_freqanalysis to do a > sanity-check? > Since there is no time dimension the ft plotting options don't work. > > Is there something wrong with my preprocessing pipeline? (Artifact > rejection was done before using VisionAnalyzer2) > > > Thanks in advance for your thoughts and inputs > > Cheers > Maurice > > PS: Before submitting this I updated to the newest version of ft > (20141002) to see if it was a version issue. > It turns out that all the template files I had been using from my > previous install (20140225) have vanished sometime inbetween. > Is there a reason for this? > Btw. I ran it with the new version and the old template files and the > result is the same. > > > > Some Code: > > %% Preprocessing: > cfg = []; % empty configuration > cfg.dataset = '..\Data\9 20131105 0928_Segmentation > 3.dat'; % dataset > cfg.trialdef.eventtype = 'Comment'; > cfg.trialdef.prestim = 0.3; > cfg.trialdef.poststim = 2; > cfg.trialdef.eventvalue = {'14HZ'}; > > cfg = ft_definetrial(cfg); > > % baseline correction > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.3 0]; > > % rereference to avg over all > cfg.reref = 'yes'; > cfg.refchannel = 'all'; > > data = ft_preprocessing(cfg); > > % shifts and scales all channles of the the input data > % to a mean of zero and a standard deviation of one. > cfg = []; > data = ft_channelnormalise(cfg,data); > > % load the manually realigned electrodes > load('.\Data\electrodes_aligned.mat'); > > % Time window of interest > cfg = []; > cfg.toilim = [0 2]; > dataPost = ft_redefinetrial(cfg, data); > > > %% Calculating the cross spectral density matrix > cfg = []; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.output = 'powandcsd'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 15; > freqPost = ft_freqanalysis(cfg, dataPost); > > > %% The forward model and lead field matrix > % load mri > load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat') > > % make segments > cfg = []; > segmentedmri = ft_volumesegment(cfg, mri); > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > > %load template sourcemodel > template = load('C:\Program > Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); > > % compute source model > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > sourcemodel = ft_prepare_sourcemodel(cfg); > > % make headmodel > cfg = []; > cfg.method = 'openmeeg'; > hdm = ft_prepare_headmodel(cfg, segmentedmri); > vol = ft_convert_units(hdm, 'cm'); > > % lead field > cfg = []; > cfg.grid = sourcemodel; > cfg.elec = elec; > cfg.vol = vol; > cfg.channel = 'all'; > cfg.normalize = 'yes'; % normalize instead of contrasting to noise > estimate > [grid] = ft_prepare_leadfield(cfg,freqPost); > > > %% Source Analysis > cfg = []; > cfg.elec = elec; > cfg.method = 'dics'; > cfg.frequency = freqPost.freq; > cfg.grid = grid; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '10%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > sourcePost_nocon = ft_sourceanalysis(cfg, freqPost); > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > sourcePostInt_nocon = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri); > > % plot > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > % cfg.funcolorlim = [0.0 0.08]; > % cfg.opacitylim = [0.0 0.2]; > cfg.opacitymap = 'rampup'; > ft_sourceplot(cfg,sourcePostInt_nocon); > > > > --- > University of Zürich > Maurice Göldi > Department of Psychology > Biopsychology > Binzmühlestr. 14 / Box 5 > CH - 8050 Zürich > > Tel. +41 (0)44 635 74 55 > www.psychologie.uzh.ch > maurice.goeldi at uzh.ch > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Dr. Matt Craddock From diezmartini at gmail.com Sun Oct 5 22:34:35 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 5 Oct 2014 10:34:35 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <542C09BA.4020501@donders.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> <542C09BA.4020501@donders.ru.nl> Message-ID: Hi Jorn and all, As I said before, everything works ok when I use ft_trialfun_general instead of this trialfun. However, it is crucial for me to transform the event values with that trialfun. And now I use 'trigger' instead of 'STATUS' but it doesn't change much. Any other idea? THANK YOU! This is my script again: % CONGRUENT TRIALS DEFINITION cfg = [ ] ; cfg.dataset = 'location'; event = ft_read_event('location'); cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialfun = 'trialfun_bit2dec'; [cfg] = ft_definetrial(cfg); On Wed, Oct 1, 2014 at 4:03 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Ana, > > from the first call with eventtype = '?', the output says > >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> > > This means that there is one event type in our data, namely 'trigger', and > the only trigger values in your data are 'DIN1', 'DIN2', 'DIN4' and 'DIN8'. > FieldTrip works that way that it passes on the cfg.trialdef structure to > the trialfun that is specified. In your particular case, trialfun_bit2dec > does not seem to have a very user-friendly error message, but the error > message means that whatever eventtype and eventvalues you asked for, they > are not present in your data. When looking at what you define, you can > probably easily spot that you ask for cfg.trialdef.eventtype = 'STATUS'. > However, checking back the output that you created with '?', there is no > event type 'STATUS' in your data. Therefore, everything works fine with > your trialfun. If you try specifying the trialdef properly, everything > should work fine. > > A general advise when using an own trial fun and getting an error message: > Try your code without specifying cfg.trialfun first. Then FieldTrip will > use the standard trialfun, which should work if all your cfg-settings are > fine. If the standard trialfun runs without errors, then your trialfun > should do so too. If your trialfun, however, then crashes, the error is > most likely in the trialfun that you used, and not in the cfg-settings. In > your case, however, I am fairly certain that the cfg-settings you specified > were causing your problem. > > I hope this helps. > Best, > Jörn > > > > > On 9/30/2014 10:27 PM, Ana Laura Diez Martini wrote: > >> For a more simple check, when I try to read the events without the >> trialfun ( so it uses ft_trialfun_general by default) I get the original >> event values: >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> >> Warning: no trialfun was specified, using ft_trialfun_general >> > In ft_definetrial at 135 >> evaluating trialfunction 'ft_trialfun_general' >> reading the events from '27CW1.RAW' >> the following events were found in the datafile >> event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' >> no trials have been defined yet, see FT_DEFINETRIAL for further help >> found 750 events >> created 0 trials >> the call to "ft_definetrial" took 4 seconds >> >> Then I try to use the trialfun, I get the same error >> >> >> cfg = []; >> >> cfg.dataset = '27CW1.RAW'; >> >> cfg.trialfun = 'trialfun_bit2dec'; >> >> cfg.trialdef.eventtype = '?'; >> >> cfg=ft_definetrial(cfg); >> evaluating trialfunction 'trialfun_bit2dec' >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> So there is something the trialfun_bit2dec does that events cannot be >> read anymore. >> >> >> On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk > a.stolk8 at gmail.com>> wrote: >> >> Hi Ana Laura, >> >> Your 'trl' is empty, which it shouldn't be. So anytime you try to >> index an element in it, it will throw an error. >> >> Can you check what 'event.values' you find in your dataset? And >> compare those with any of the ones falling under the switch case >> statement? One way to do this, is to put a debug marker (red dot) >> at the 'end' of the first for-loop (judging from the wiki). Then >> check the value of event(i).value, and click the continue button >> to move on to the next. An alternative way is to put a debug >> marker after event = ft_read_event and to instantly check all >> values of event with "[event(:).value]". >> >> Goodluck, >> Arjen >> >> 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini >> >: >> >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini >> > wrote: >> >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = >> 'saveonerror' and matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read >> them with the raw data, they seem to be there, with the >> DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk >> > wrote: >> >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]." >> >> that none of the triggers were found in your event >> data. You might wanna check why this is happening, by >> debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >> >> >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I >> followed your advice and I changed definetrial to >> ft_definetrial and I confirm the function was >> added to my paths. After doing this, the error I >> get is: >> >> Attempted to access trl(:,1); index out of bounds >> because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I >> think I added what I think are useless lines but I >> was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun >> definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus >> triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my >> analysis because I would like to use only >> Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> > > wrote: >> >> Hi again Ana Laura, >> >> One other thing that I thought of was to make >> sure that the function "trialfun_bit2dec" is >> added to your paths in matlab, so that >> ft_definetrial can find this function. >> >> By updating your fieldtrip to the most recent >> version "trialfun_bit2dec" is *not* included. >> So you'll need to store that as a separate .m >> file in a location that can be accessed by the >> paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > > >> > To: "FieldTrip discussion list" >> > > >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a >> trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this >> is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use >> an old version of >> > Fieldtrip for my scripts because I wrote >> them long ago and this >> > trialfun uses the new format (with >> 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, >> Nietzsche < >> > n.lam at fcdonders.ru.nl >> > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which >> trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > >> http://fieldtrip.fcdonders.nl/ >> tutorial/preprocessing >> under "do the >> > trial definition for the fully incongruent >> (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = >> 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see >> below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% >> trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error >> message, it seemed that the >> > problem was in the function >> trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called >> this function. I was >> > wondering if the code you provide >> corresponded to the code that >> > created your error message? I'm guessing you >> ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not >> via definetrial). In which >> > case, it was looking for >> cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the >> relevant information in >> > the cfg (which is in the code you showed >> us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < >> diezmartini at gmail.com >> > >> > > To: "FieldTrip discussion list" < >> fieldtrip at science.ru.nl >> > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I >> want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/ >> faq/how_can_i_transform_trigger_values_from_bits_to_ >> decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, >> cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not >> writing it in the correct part >> > > of >> > > my script. This is my trial definition >> part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, >> '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, >> '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, >> '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > >> _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> >> > > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > -- >> > Nietzsche H.L. Lam, MSc >> > PhD Candidate >> > >> > Max Planck Institute for Psycholinguistics >> > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> > >> > Donders Institute for Brain, Cognition and >> Behaviour, >> > Centre for Cognitive Neuroimaging, >> > Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> > >> > n.lam at fcdonders.ru.nl >> >> > +31-24-3668219 >> > >> > >> > neurobiologyoflanguage.com >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> >> > >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> -- >> Nietzsche H.L. Lam, MSc >> PhD Candidate >> >> Max Planck Institute for Psycholinguistics >> Wundtlaan 1, 6525 XD Nijmegen, The Netherlands >> >> Donders Institute for Brain, Cognition and >> Behaviour, >> Centre for Cognitive Neuroimaging, >> Kapittelweg 29, 6525EN Nijmegen, The Netherlands >> >> n.lam at fcdonders.ru.nl >> >> +31-24-3668219 >> >> >> neurobiologyoflanguage.com >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/ >> mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 09:16:45 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 09:16:45 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Message-ID: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Oct 6 11:46:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 6 Oct 2014 11:46:55 +0200 (CEST) Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser In-Reply-To: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> References: <01de01cfe135$7c11eea0$7435cbe0$@vanpelt@fcdonders.ru.nl> Message-ID: <021c01cfe14a$76c18fe0$6444afa0$@vanpelt@fcdonders.ru.nl> For everyone's information, I have found a solution based on a post some 4 years ago related to ft_resampledata (http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003095.ht ml). To make the ICA and artifact data align, the trl-field of the ICA-data needs to be 'resampled', as well as the artifact-samples: % i. Downsample data resamplefs = 150; cfg = []; cfg.resamplefs = resamplefs; cfg.detrend = 'no'; data150 = ft_resampledata(cfg, data); % 'Downsample' trial information to make trial start/end samplenrs correspond to artifact samplenrs data150.cfg.previous.trl(:,1:3) = round(data150.cfg.previous.trl(:,1:3) * (1/fs) * resamplefs); % ii. run ICA on downsampled data cfg = []; cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB cfg.channel = 'MEG'; cfg.runica.maxsteps = 120; eval(['comp150',num2str(n),'= ft_componentanalysis(cfg, data150);']); % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=ceil(art_eog_all*(resamplefs/fs)); % 'resample' artifact data cfg.artfctdef.muscle.artifact=ceil(art_muscle_all*(resamplefs/fs)); % 'resample' artifact data % visual inspection ft_databrowser(cfg, comp150',num2str(n),'); % 'Upsample' trial information again to original data150.cfg.previous.trl(:,1:3) = data.cfg.trl(:,1:3); Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Stan van Pelt Sent: maandag 6 oktober 2014 9:17 To: 'FieldTrip discussion list' Subject: [FieldTrip] simultaneous artifact and ICA viewing in ft_databrowser Dear fellow FieldTrippers, For proper artifact removal, I would like to compare the (temporal) correspondence between the ICA components of my (CTF MEG275) data and the artifacts that I semi-automatically identified beforehand (eye blinks, saccades, muscle tension). ft_databrowser in principle allows me to show this, but I run into some problems that I think have to do with data resampling. The code I use is: % iii. plot the components for visual inspection and select bad components cfg = []; cfg.component = [1:10]; % components to be plotted cfg.layout = 'CTF275.lay'; % specify the layout file that should be used for plotting % add preveiously manually defined eog and muscle artifacts, to compare with components load artifact_eog_all load artifact_muscle_all cfg.artfctdef.eog.artifact=art_eog_all; cfg.artfctdef.muscle.artifact=art_muscle_all; % visual inspection ft_databrowser(cfg, comp150); The problem I have is that the artifacts are not shown at the right moments in time during the experiment. The data that are ICA-ed are resampled from 1200->150Hz, but I do not know how I can 'resample' the artifact definitions, since they are defined in samples, not in time. If I manually resample (by dividing the values by a factor 8), they are still not displayed at the correct moments in time. I have the impression that convert_event (fieltrip/private) could be of use here, but I cannot figure it out correctly. Best, Stan -- Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Radboud University Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.bock at mcgill.ca Mon Oct 6 15:17:04 2014 From: elizabeth.bock at mcgill.ca (Elizabeth Anne Bock, Ms) Date: Mon, 6 Oct 2014 13:17:04 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <542E6B84.2000106@donders.ru.nl> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> Message-ID: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... >> compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: > I am trying to use the realtime buffer on windows 7 running Matlab > 2014a and I get the following error: > Invalid MEX-file > 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': > The > specified module could not be found. > > It works fine on my other windows 7 workstation running Matlab 2012b. > Please advise. > Beth > > ------------------------------------------------------------------------------------------ > > Elizabeth Bock / MEG System Engineer > > McConnell Brain Imaging Centre / Montreal Neurological Institute > > McGill University / 3801 University St. / Montreal, QC H3A 2B4 > > > MEG Lab: 514.398.6056 > > Mobile: 514.718.6342 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From giulia.rizza at tiscali.it Mon Oct 6 17:47:50 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Mon, 06 Oct 2014 17:47:50 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS Message-ID: <78737852a684659ce9b485523d53b552@tiscali.it> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed, as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Thank you so much for any help Giulia Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at fcdonders.ru.nl Mon Oct 6 17:56:36 2014 From: robert.oostenveld at fcdonders.ru.nl (Oostenveld, R. (Robert)) Date: Mon, 6 Oct 2014 15:56:36 +0000 Subject: [FieldTrip] buffer.mexw64 not found In-Reply-To: <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> References: <86D86365C4E767468A79EB52DFBFB46F37AA325F@EXMBX2010-7.campus.MCGILL.CA>, <542E6B84.2000106@donders.ru.nl> <86D86365C4E767468A79EB52DFBFB46F37AA3A29@EXMBX2010-7.campus.MCGILL.CA> Message-ID: Hi Beth, The buffer.mexw64 file is present in the fieldtrip release. I suspect your initial problem is that a DLL is not being found, i.e. MATLAB loads the mex file as a dynamic link library (dll), and in that process there are some other dlls that also have to be loaded. You could diagnose this further with http://www.dependencywalker.com and the solution might be as simple as getting the correct MSVC dll (which is installed by default on some Windows versions, but not on others). Recompiling the buffer mex file on windows (esp 64) bit is not trivial, but you can find some hints onhttp://fieldtrip.fcdonders.nl/development/realtime/reference_implementation#compiling_the_code best Robert On 06 Oct 2014, at 15:17, Elizabeth Anne Bock, Ms > wrote: Thanks, Jorn. I am now trying to compile the buffer in Matlab 2014a and I get the following error. It seems that some of the include files listed do not exist... compile('vc') Compiling library functions in util.c ... Building with 'Microsoft Windows SDK 7.1 (C)'. Error using mex util.c c:\users\mcgill\documents\matlab\fieldtrip-20140929\realtime\src\buffer\src\platform_includes.h(26) : fatal error C1083: Cannot open include file: 'win32/gettimeofday.h': No such file or directory Error in compile (line 138) eval(cmd); ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jörn M. Horschig" [jm.horschig at donders.ru.nl] Sent: Friday, October 03, 2014 5:25 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] buffer.mexw64 not found Hi Beth, are ou sure the buffer.mexw64 is located in your path? You can check by typing "which buffer" in the matlab command window. If so, then you can try to re-mex the file yourself (or redownload Fieldtrip, maybe the file was just corrupted in your copy?). Mexing the file in a matlab 64bit environment is a bit cumbersome, as you need to install some external compiler. For more information, please see here: http://fieldtrip.fcdonders.nl/development/guidelines/code#windows_64_bit and here: http://www.mathworks.com/support/compilers/R2014b/index.html;jsessionid=55154776089981772f81c3d47c7f?nocookie=true After downloading and installer the compiler, you need to locate the buffer.c file (probably in the fieldtrip/src directory) and then type "mex buffer.c" in the matlab command window. Hope you can take it from here ;) Best, Jörn On 10/2/2014 2:24 PM, Elizabeth Anne Bock, Ms wrote: I am trying to use the realtime buffer on windows 7 running Matlab 2014a and I get the following error: Invalid MEX-file 'C:\Users\McGill\Documents\MATLAB\fieldtrip-20140929\realtime\src\buffer\matlab\buffer.mexw64': The specified module could not be found. It works fine on my other windows 7 workstation running Matlab 2012b. Please advise. Beth ------------------------------------------------------------------------------------------ Elizabeth Bock / MEG System Engineer McConnell Brain Imaging Centre / Montreal Neurological Institute McGill University / 3801 University St. / Montreal, QC H3A 2B4 MEG Lab: 514.398.6056 Mobile: 514.718.6342 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From cas243 at georgetown.edu Mon Oct 6 20:19:11 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Mon, 6 Oct 2014 14:19:11 -0400 Subject: [FieldTrip] grand average with dimord chan_chan_freq_time Message-ID: Dear FieldTrip Community, What's the best strategy for generating grand averages when data have dimord chan_chan_freq_time (output of ft_connectivityanalysis for method granger)? It appears that chan_chan_freq_time is an unsupported dimord in ft_freqgrandaverage. Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Oct 7 15:42:53 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Tue, 07 Oct 2014 15:42:53 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions Message-ID: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Dear fieldtripers, I would like to compare to conditions of an auditory oddball paradigm (target tones and standard tones). For the identification of the electrodes which show the biggest P300, I would like to use cluster based permutation test, i.e. I want to use ft_timelockstatistics, to identify the clusters with a significant difference between the target and the standardtones. Important: I don't want to do a group statistic, but I want to compare these two conditions within each subject, to identify interesting clusters for each subject separately. I wrote the script following the tutorials on the fieldtrip homepage. I already wrote a code but it does not work: %% for i = 3:10 % subject number mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' cd(mypfad) cd Kontrollen; List = dir cd (List(i).name); for j = 1:4 %session number cd (mypfad); cd Kontrollen; List = dir cd (List(i).name); eval(['cd M' num2str(j)]); load cleandata_tlt; %preprocessed timelocked data standardclean_tlt and targetclean_tlt cfg = [] cfg.neighbourdist = .09; cfg.layout= ulmegilay; cfg.method = 'distance'; Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) cfg = [] cfg.method = 'montecarlo' ; %significance probability cfg.statistic = 'ft_statfun_depsamplesT' cfg.correctm = 'cluster' cfg.clusteralpha = 0.05 %alpha level of the sample specific test statistic that will % be used for thresholding cfg.clusterstatistic = 'maxsum' cfg.minnbchan = 4 cfg.latency = [0.25 0.8] cfg.neighbours = Neighbours cfg.tail = 0 cfg.clustertail = 0 cfg.alpha = 0.025 cfg.numrandomization = 1000 design = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)]) cfg.design = design cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]' cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial,1)] tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, standardclean_tlt ) cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; cd Kontrollen; List2 = dir cd (List2(i).name); eval(['cd M' num2str(j)]); save statnew tlt_statsnew end end This is what gets displayed while running the script: selected 245 channels selected 139 time bins selected 1 frequency bins using "ft_statistics_montecarlo" for the statistical testing using "ft_statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 189 total number of variables = 1 number of independent variables = 189 number of unit variables = 189 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach Then, this error occurs: Error using resampledesign (line 168) A within-units shuffling requires a at least one unit variable and at least one independent variable Error in ft_statistics_montecarlo (line 241) resample = resampledesign(cfg, design); Error in statistics_wrapper (line 310) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_timelockstatistics (line 113) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I have no clue where I made a mistake. I have unit variables and independent variables (189 if I understand it correctly). Is there anything I am missing? Any additional information or is the design matrix wrong? I really appreciate your help. Best regards, Barbara Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Tue Oct 7 15:55:36 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Tue, 7 Oct 2014 09:55:36 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions In-Reply-To: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> References: <20141007154253.1acx2qfvso4k4so4@imap.uni-ulm.de> Message-ID: Dear Barbara, Just three thoughts: 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension of the design matrix that contains the independent and unit variables? Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the design matrix). 2) I think the design matrix itself might be off, right now it just seems to have dimensions of 1 x (# targets+standards). It should have a second dimension which counts the # of trials, something like: design(1,:) = [ones(size(targetclean_tlt.trial,1),1); 2*ones(size(standardclean_tlt.trial,1),1)]'; design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial ,1)]) 3) Since this is a design where each trial is an observation, I think you should be using indepsamplesT for cfg.statistic (the trials aren't paired and there aren't necessarily identical #'s of trials for each condition. What do you think? Respectfully, Clara On Tue, Oct 7, 2014 at 9:42 AM, wrote: > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, I > would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting clusters > for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific test > statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. > trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 7 21:07:37 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 7 Oct 2014 21:07:37 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: <78737852a684659ce9b485523d53b552@tiscali.it> References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Giulia, > Dear Fieldtrippers > I'm writing to ask you some help on data in a single subject study. > I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. > I'm not sure how to proceed What you are referring to is a “between trial experiment” which is described in this tutorial: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq One possible way to go is to compute the TFR’s with cfg.keeptrials = ‘yes’. Next you’d treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. Also please type “actvsblT” in the search bar and then click on “Search the FieldTrip mailing list”. There you’ll find some info about this. best tzvetan From giulia.rizza at tiscali.it Wed Oct 8 10:45:23 2014 From: giulia.rizza at tiscali.it (Giuly) Date: Wed, 08 Oct 2014 10:45:23 +0200 Subject: [FieldTrip] help for statistics on ERD/ERS In-Reply-To: References: <78737852a684659ce9b485523d53b552@tiscali.it> Message-ID: Hi Tzvetan Thank you so much for your reply I will try these functions keeping in mind your explanation Best regards Giulia Il 07.10.2014 21:07 Tzvetan Popov ha scritto: > Hi Giulia, > >> Dear Fieldtrippers I'm writing to ask you some help on data in a single subject study. I did a time frequency decomposition and I would like to do a statistic to state whether the average TFR has significant ERD/ERS or not. I'm not sure how to proceed > > What you are referring to is a "between trial experiment" which is described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] > One possible way to go is to compute the TFR's with cfg.keeptrials = 'yes'. Next you'd treat the baseline and the task interval as two conditions by separating them using ft_selectdata. After this you can compute the statistical comparison in a similar fashion as described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html [2] > >> , as a first step I compared the single trial baseline with the respective event, with a t-test for each condition and band of interest but I'm not really sure if this is enough and anyway if it is the correct way. > > Also please type "actvsblT" in the search bar and then click on "Search the FieldTrip mailing list". There you'll find some info about this. > > best > tzvetan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl [3] > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] Scopri istella, il nuovo motore per il web italiano. Istella garantisce risultati di qualità e la possibilità di condividere, in modo semplice e veloce, documenti, immagini, audio e video. Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Oct 8 13:31:46 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 08 Oct 2014 13:31:46 +0200 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: References: Message-ID: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Dear Clara, thank you for your comments. I ran it as an independent samples Test (it is true, that this is the correct way). I also changed the design matrix to cfg.design = [ones(1,size(targetclean_tlt.trial,1)) 2*ones(1,size(standardclean_tlt.trial,1))] It works and there are no more error messages. However, when it displays the progress of the calculation there is the field: total number of observations, total number of variables and number of independent variables. It recognizes correctly that there are 185 trials in total (both conditions together). But it only counts 1 variable and 1 independent variable. Shouldn't it recognize 2 variables as I have 2 conditions? Best regards, Barbara Zitat von fieldtrip-request at science.ru.nl: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Problem with ft_timelockstatistics, within subject comparison > of two conditions (barbara.schorr at uni-ulm.de) > 2. Re: Problem with ft_timelockstatistics, within subject > comparison of two conditions (Clara A. Scholl) > 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) > 4. Re: help for statistics on ERD/ERS (Giuly) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 07 Oct 2014 15:42:53 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear fieldtripers, > > I would like to compare to conditions of an auditory oddball paradigm > (target tones and standard tones). > For the identification of the electrodes which show the biggest P300, > I would like to use cluster based permutation test, i.e. I want to use > ft_timelockstatistics, to identify the clusters with a significant > difference between the target and the standardtones. > Important: I don't want to do a group statistic, but I want to compare > these two conditions within each subject, to identify interesting > clusters for each subject separately. > > > I wrote the script following the tutorials on the fieldtrip homepage. > > I already wrote a code but it does not work: > %% > > for i = 3:10 % subject number > mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' > cd(mypfad) > cd Kontrollen; > List = dir > cd (List(i).name); > for j = 1:4 %session number > cd (mypfad); > cd Kontrollen; > List = dir > cd (List(i).name); > eval(['cd M' num2str(j)]); > load cleandata_tlt; %preprocessed timelocked data > standardclean_tlt and targetclean_tlt > > cfg = [] > cfg.neighbourdist = .09; > cfg.layout= ulmegilay; > cfg.method = 'distance'; > > Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) > > cfg = [] > cfg.method = 'montecarlo' ; %significance probability > cfg.statistic = 'ft_statfun_depsamplesT' > cfg.correctm = 'cluster' > cfg.clusteralpha = 0.05 %alpha level of the sample specific > test statistic that will > % be used for thresholding > cfg.clusterstatistic = 'maxsum' > cfg.minnbchan = 4 > cfg.latency = [0.25 0.8] > cfg.neighbours = Neighbours > cfg.tail = 0 > cfg.clustertail = 0 > cfg.alpha = 0.025 > cfg.numrandomization = 1000 > > design = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design([1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)]) > > > cfg.design = design > cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]' > cfg.uvar = [1:size(targetclean_tlt.trial) > 1:size(standardclean_tlt.trial,1)] > > tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, > standardclean_tlt ) > > cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; > cd Kontrollen; > List2 = dir > cd (List2(i).name); > eval(['cd M' num2str(j)]); > save statnew tlt_statsnew > > end > end > > > This is what gets displayed while running the script: > > selected 245 channels > selected 139 time bins > selected 1 frequency bins > using "ft_statistics_montecarlo" for the statistical testing > using "ft_statfun_depsamplesT" for the single-sample statistics > constructing randomized design > total number of measurements = 189 > total number of variables = 1 > number of independent variables = 189 > number of unit variables = 189 > number of within-cell variables = 0 > number of control variables = 0 > using a permutation resampling approach > > Then, this error occurs: > > Error using resampledesign (line 168) > A within-units shuffling requires a at least one unit variable and at least > one independent variable > > Error in ft_statistics_montecarlo (line 241) > resample = resampledesign(cfg, design); > > Error in statistics_wrapper (line 310) > [stat, cfg] = statmethod(cfg, dat, design); > > Error in ft_timelockstatistics (line 113) > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > I have no clue where I made a mistake. I have unit variables and > independent variables (189 if I understand it correctly). > Is there anything I am missing? Any additional information or is the > design matrix wrong? > > > I really appreciate your help. > > Best regards, > Barbara > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > Message: 2 > Date: Tue, 7 Oct 2014 09:55:36 -0400 > From: "Clara A. Scholl" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within > subject comparison of two conditions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Barbara, > > Just three thoughts: > > 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension > of the design matrix that contains the independent and unit variables? > Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the > design matrix). > > 2) I think the design matrix itself might be off, right now it just seems > to have dimensions of 1 x (# targets+standards). It should have a second > dimension which counts the # of trials, something like: > > design(1,:) = [ones(size(targetclean_tlt.trial,1),1); > 2*ones(size(standardclean_tlt.trial,1),1)]'; > design(2,:)= ([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt.trial > ,1)]) > > 3) Since this is a design where each trial is an observation, I think you > should be using indepsamplesT for cfg.statistic (the trials aren't paired > and there aren't necessarily identical #'s of trials for each condition. > > What do you think? > Respectfully, > Clara > > > On Tue, Oct 7, 2014 at 9:42 AM, wrote: > >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, I >> would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting clusters >> for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >> statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >> trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 7 Oct 2014 21:07:37 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Hi Giulia, > > >> Dear Fieldtrippers >> I'm writing to ask you some help on data in a single subject study. >> I did a time frequency decomposition and I would like to do a >> statistic to state whether the average TFR has significant ERD/ERS >> or not. >> I'm not sure how to proceed > What you are referring to is a ?between trial experiment? which is > described in this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > One possible way to go is to compute the TFR?s with cfg.keeptrials = > ?yes?. Next you?d treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you > can compute the statistical comparison in a similar fashion as > described in the tutorial. > Keep in mind that you have to cut the data into equal lengths. > Please have a look at this post : > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> , as a first step I compared the single trial baseline with the >> respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it >> is the correct way. > Also please type ?actvsblT? in the search bar and then click on > ?Search the FieldTrip mailing list?. There you?ll find some info > about this. > > best > tzvetan > > > > > ------------------------------ > > Message: 4 > Date: Wed, 08 Oct 2014 10:45:23 +0200 > From: Giuly > To: FieldTrip discussion list > Subject: Re: [FieldTrip] help for statistics on ERD/ERS > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Tzvetan > Thank you so much for your reply > I will try these > functions keeping in mind your explanation > Best regards > Giulia > > Il > 07.10.2014 21:07 Tzvetan Popov ha scritto: > >> Hi Giulia, >> >>> Dear > Fieldtrippers I'm writing to ask you some help on data in a single > subject study. I did a time frequency decomposition and I would like to > do a statistic to state whether the average TFR has significant ERD/ERS > or not. I'm not sure how to proceed >> >> What you are referring to is a > "between trial experiment" which is described in this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> > One possible way to go is to compute the TFR's with cfg.keeptrials = > 'yes'. Next you'd treat the baseline and the task interval as two > conditions by separating them using ft_selectdata. After this you can > compute the statistical comparison in a similar fashion as described in > the tutorial. >> Keep in mind that you have to cut the data into equal > lengths. Please have a look at this post : >> > http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html > [2] >> >>> , as a first step I compared the single trial baseline with > the respective event, with a t-test for each condition and band of > interest but I'm not really sure if this is enough and anyway if it is > the correct way. >> >> Also please type "actvsblT" in the search bar and > then click on "Search the FieldTrip mailing list". There you'll find > some info about this. >> >> best >> tzvetan >> >> > _______________________________________________ >> fieldtrip mailing > list >> fieldtrip at donders.ru.nl [3] >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] > > > > > Scopri istella, il nuovo motore per il web italiano. > Istella garantisce risultati di qualit? e la possibilit? di > condividere, in modo semplice e veloce, documenti, immagini, audio e > video. > Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Oct 8 17:21:12 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 8 Oct 2014 11:21:12 -0400 Subject: [FieldTrip] Problem with ft_timelockstatistics, within subject comparison of two conditions (Clara A. Scholl) In-Reply-To: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> References: <20141008133146.964jqcxmo0c004sk@imap.uni-ulm.de> Message-ID: Dear Barbara, I think you are right, the clustering output should report total number of variables=2 (and the total # of measurements = 185 trials, number of independent variables=1, and number of unit variables=1). I think your design matrix should have two rows, rather than 1. For example, if you had 5 trials total (2 of 1 trial type, 3 of the other trial type), you'd specify the design matrix: 1 2 3 1 2 1 1 1 2 2 Where cfg.uvar=1 and cfg.ivar=2. Row two is what you are specifying for design currently. Row 1 counts the observations of each trials (1:numTrialType1 1:numTrialType2). Does that help? Respectfully, Clara On Wed, Oct 8, 2014 at 7:31 AM, wrote: > Dear Clara, > > thank you for your comments. > > I ran it as an independent samples Test (it is true, that this is the > correct way). > I also changed the design matrix to > cfg.design = [ones(1,size(targetclean_tlt.trial,1)) > 2*ones(1,size(standardclean_tlt.trial,1))] > > It works and there are no more error messages. However, when it displays > the progress of the calculation there is the field: total number of > observations, total number of variables and number of independent > variables. It recognizes correctly that there are 185 trials in total (both > conditions together). But it only counts 1 variable and 1 independent > variable. Shouldn't it recognize 2 variables as I have 2 conditions? > > Best regards, > Barbara > > > Zitat von fieldtrip-request at science.ru.nl: > > Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Problem with ft_timelockstatistics, within subject comparison >> of two conditions (barbara.schorr at uni-ulm.de) >> 2. Re: Problem with ft_timelockstatistics, within subject >> comparison of two conditions (Clara A. Scholl) >> 3. Re: help for statistics on ERD/ERS (Tzvetan Popov) >> 4. Re: help for statistics on ERD/ERS (Giuly) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 07 Oct 2014 15:42:53 +0200 >> From: barbara.schorr at uni-ulm.de >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: <20141007154253.1acx2qfvso4k4so4 at imap.uni-ulm.de> >> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; >> format="flowed" >> >> Dear fieldtripers, >> >> I would like to compare to conditions of an auditory oddball paradigm >> (target tones and standard tones). >> For the identification of the electrodes which show the biggest P300, >> I would like to use cluster based permutation test, i.e. I want to use >> ft_timelockstatistics, to identify the clusters with a significant >> difference between the target and the standardtones. >> Important: I don't want to do a group statistic, but I want to compare >> these two conditions within each subject, to identify interesting >> clusters for each subject separately. >> >> >> I wrote the script following the tutorials on the fieldtrip homepage. >> >> I already wrote a code but it does not work: >> %% >> >> for i = 3:10 % subject number >> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >> cd(mypfad) >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> for j = 1:4 %session number >> cd (mypfad); >> cd Kontrollen; >> List = dir >> cd (List(i).name); >> eval(['cd M' num2str(j)]); >> load cleandata_tlt; %preprocessed timelocked data >> standardclean_tlt and targetclean_tlt >> >> cfg = [] >> cfg.neighbourdist = .09; >> cfg.layout= ulmegilay; >> cfg.method = 'distance'; >> >> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >> >> cfg = [] >> cfg.method = 'montecarlo' ; %significance probability >> cfg.statistic = 'ft_statfun_depsamplesT' >> cfg.correctm = 'cluster' >> cfg.clusteralpha = 0.05 %alpha level of the sample specific >> test statistic that will >> % be used for thresholding >> cfg.clusterstatistic = 'maxsum' >> cfg.minnbchan = 4 >> cfg.latency = [0.25 0.8] >> cfg.neighbours = Neighbours >> cfg.tail = 0 >> cfg.clustertail = 0 >> cfg.alpha = 0.025 >> cfg.numrandomization = 1000 >> >> design = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)]) >> >> >> cfg.design = design >> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]' >> cfg.uvar = [1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial,1)] >> >> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >> standardclean_tlt ) >> >> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >> cd Kontrollen; >> List2 = dir >> cd (List2(i).name); >> eval(['cd M' num2str(j)]); >> save statnew tlt_statsnew >> >> end >> end >> >> >> This is what gets displayed while running the script: >> >> selected 245 channels >> selected 139 time bins >> selected 1 frequency bins >> using "ft_statistics_montecarlo" for the statistical testing >> using "ft_statfun_depsamplesT" for the single-sample statistics >> constructing randomized design >> total number of measurements = 189 >> total number of variables = 1 >> number of independent variables = 189 >> number of unit variables = 189 >> number of within-cell variables = 0 >> number of control variables = 0 >> using a permutation resampling approach >> >> Then, this error occurs: >> >> Error using resampledesign (line 168) >> A within-units shuffling requires a at least one unit variable and at >> least >> one independent variable >> >> Error in ft_statistics_montecarlo (line 241) >> resample = resampledesign(cfg, design); >> >> Error in statistics_wrapper (line 310) >> [stat, cfg] = statmethod(cfg, dat, design); >> >> Error in ft_timelockstatistics (line 113) >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> I have no clue where I made a mistake. I have unit variables and >> independent variables (189 if I understand it correctly). >> Is there anything I am missing? Any additional information or is the >> design matrix wrong? >> >> >> I really appreciate your help. >> >> Best regards, >> Barbara >> >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 7 Oct 2014 09:55:36 -0400 >> From: "Clara A. Scholl" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Problem with ft_timelockstatistics, within >> subject comparison of two conditions >> Message-ID: >> > gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> Dear Barbara, >> >> Just three thoughts: >> >> 1) Should cfg.ivar and cfg.uvar both be single values, i.e. the dimension >> of the design matrix that contains the independent and unit variables? >> Then you'd have cfg.ivar=1 and cfg.uvar=2 (or vise versa, depending on the >> design matrix). >> >> 2) I think the design matrix itself might be off, right now it just seems >> to have dimensions of 1 x (# targets+standards). It should have a second >> dimension which counts the # of trials, something like: >> >> design(1,:) = [ones(size(targetclean_tlt.trial,1),1); >> 2*ones(size(standardclean_tlt.trial,1),1)]'; >> design(2,:)= ([1:size(targetclean_tlt.trial) >> 1:size(standardclean_tlt.trial >> ,1)]) >> >> 3) Since this is a design where each trial is an observation, I think you >> should be using indepsamplesT for cfg.statistic (the trials aren't paired >> and there aren't necessarily identical #'s of trials for each condition. >> >> What do you think? >> Respectfully, >> Clara >> >> >> On Tue, Oct 7, 2014 at 9:42 AM, wrote: >> >> Dear fieldtripers, >>> >>> I would like to compare to conditions of an auditory oddball paradigm >>> (target tones and standard tones). >>> For the identification of the electrodes which show the biggest P300, I >>> would like to use cluster based permutation test, i.e. I want to use >>> ft_timelockstatistics, to identify the clusters with a significant >>> difference between the target and the standardtones. >>> Important: I don't want to do a group statistic, but I want to compare >>> these two conditions within each subject, to identify interesting >>> clusters >>> for each subject separately. >>> >>> >>> I wrote the script following the tutorials on the fieldtrip homepage. >>> >>> I already wrote a code but it does not work: >>> %% >>> >>> for i = 3:10 % subject number >>> mypfad = 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300' >>> cd(mypfad) >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> for j = 1:4 %session number >>> cd (mypfad); >>> cd Kontrollen; >>> List = dir >>> cd (List(i).name); >>> eval(['cd M' num2str(j)]); >>> load cleandata_tlt; %preprocessed timelocked data >>> standardclean_tlt and targetclean_tlt >>> >>> cfg = [] >>> cfg.neighbourdist = .09; >>> cfg.layout= ulmegilay; >>> cfg.method = 'distance'; >>> >>> Neighbours = ft_prepare_neighbours(cfg, standardclean_tlt) >>> >>> cfg = [] >>> cfg.method = 'montecarlo' ; %significance probability >>> cfg.statistic = 'ft_statfun_depsamplesT' >>> cfg.correctm = 'cluster' >>> cfg.clusteralpha = 0.05 %alpha level of the sample specific test >>> statistic that will >>> % be used for thresholding >>> cfg.clusterstatistic = 'maxsum' >>> cfg.minnbchan = 4 >>> cfg.latency = [0.25 0.8] >>> cfg.neighbours = Neighbours >>> cfg.tail = 0 >>> cfg.clustertail = 0 >>> cfg.alpha = 0.025 >>> cfg.numrandomization = 1000 >>> >>> design = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]'; >>> design([1:size(targetclean_tlt.trial) 1:size(standardclean_tlt. >>> trial,1)]) >>> >>> >>> cfg.design = design >>> cfg.ivar = [ones(size(targetclean_tlt.trial,1),1); >>> 2*ones(size(standardclean_tlt.trial,1),1)]' >>> cfg.uvar = [1:size(targetclean_tlt.trial) >>> 1:size(standardclean_tlt. >>> trial,1)] >>> >>> tlt_statsnew = ft_timelockstatistics(cfg, targetclean_tlt, >>> standardclean_tlt ) >>> >>> cd 'G:\BackUp07.07.14_DatenPrepr\Daten1\P300'; >>> cd Kontrollen; >>> List2 = dir >>> cd (List2(i).name); >>> eval(['cd M' num2str(j)]); >>> save statnew tlt_statsnew >>> >>> end >>> end >>> >>> >>> This is what gets displayed while running the script: >>> >>> selected 245 channels >>> selected 139 time bins >>> selected 1 frequency bins >>> using "ft_statistics_montecarlo" for the statistical testing >>> using "ft_statfun_depsamplesT" for the single-sample statistics >>> constructing randomized design >>> total number of measurements = 189 >>> total number of variables = 1 >>> number of independent variables = 189 >>> number of unit variables = 189 >>> number of within-cell variables = 0 >>> number of control variables = 0 >>> using a permutation resampling approach >>> >>> Then, this error occurs: >>> >>> Error using resampledesign (line 168) >>> A within-units shuffling requires a at least one unit variable and at >>> least >>> one independent variable >>> >>> Error in ft_statistics_montecarlo (line 241) >>> resample = resampledesign(cfg, design); >>> >>> Error in statistics_wrapper (line 310) >>> [stat, cfg] = statmethod(cfg, dat, design); >>> >>> Error in ft_timelockstatistics (line 113) >>> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >>> >>> I have no clue where I made a mistake. I have unit variables and >>> independent variables (189 if I understand it correctly). >>> Is there anything I am missing? Any additional information or is the >>> design matrix wrong? >>> >>> >>> I really appreciate your help. >>> >>> Best regards, >>> Barbara >>> >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141007/64be64b4/attachment-0001.html> >> >> ------------------------------ >> >> Message: 3 >> Date: Tue, 7 Oct 2014 21:07:37 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset=windows-1252 >> >> Hi Giulia, >> >> >> Dear Fieldtrippers >>> I'm writing to ask you some help on data in a single subject study. >>> I did a time frequency decomposition and I would like to do a statistic >>> to state whether the average TFR has significant ERD/ERS or not. >>> I'm not sure how to proceed >>> >> What you are referring to is a ?between trial experiment? which is >> described in this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> One possible way to go is to compute the TFR?s with cfg.keeptrials = >> ?yes?. Next you?d treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> Keep in mind that you have to cut the data into equal lengths. Please >> have a look at this post : >> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> >>> , as a first step I compared the single trial baseline with the >>> respective event, with a t-test for each condition and band of interest >>> but I'm not really sure if this is enough and anyway if it is the correct >>> way. >>> >> Also please type ?actvsblT? in the search bar and then click on ?Search >> the FieldTrip mailing list?. There you?ll find some info about this. >> >> best >> tzvetan >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 08 Oct 2014 10:45:23 +0200 >> From: Giuly >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] help for statistics on ERD/ERS >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Tzvetan >> Thank you so much for your reply >> I will try these >> functions keeping in mind your explanation >> Best regards >> Giulia >> >> Il >> 07.10.2014 21:07 Tzvetan Popov ha scritto: >> >> Hi Giulia, >>> >>> Dear >>>> >>> Fieldtrippers I'm writing to ask you some help on data in a single >> subject study. I did a time frequency decomposition and I would like to >> do a statistic to state whether the average TFR has significant ERD/ERS >> or not. I'm not sure how to proceed >> >>> >>> What you are referring to is a >>> >> "between trial experiment" which is described in this tutorial: >> >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq [1] >> >>> >>> One possible way to go is to compute the TFR's with cfg.keeptrials = >> 'yes'. Next you'd treat the baseline and the task interval as two >> conditions by separating them using ft_selectdata. After this you can >> compute the statistical comparison in a similar fashion as described in >> the tutorial. >> >>> Keep in mind that you have to cut the data into equal >>> >> lengths. Please have a look at this post : >> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2007-July/001303.html >> [2] >> >>> >>> , as a first step I compared the single trial baseline with >>>> >>> the respective event, with a t-test for each condition and band of >> interest but I'm not really sure if this is enough and anyway if it is >> the correct way. >> >>> >>> Also please type "actvsblT" in the search bar and >>> >> then click on "Search the FieldTrip mailing list". There you'll find >> some info about this. >> >>> >>> best >>> tzvetan >>> >>> >>> _______________________________________________ >> >>> fieldtrip mailing >>> >> list >> >>> fieldtrip at donders.ru.nl [3] >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip [4] >> >> >> >> >> Scopri istella, il nuovo motore per il web italiano. >> Istella garantisce risultati di qualit? e la possibilit? di condividere, >> in modo semplice e veloce, documenti, immagini, audio e video. >> Usa istella, vai su http://www.istella.it?wtk=amc138614816829636 >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > attachments/20141008/ff2ad283/attachment-0001.html> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 47, Issue 6 >> **************************************** >> >> > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 11:51:45 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 11:51:45 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size Message-ID: <54365AB1.8040507@uni-tuebingen.de> Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: surfaceplot before 7mb after 220mb.jpg Type: image/jpeg Size: 156292 bytes Desc: not available URL: From dao4free at gmail.com Thu Oct 9 12:19:19 2014 From: dao4free at gmail.com (Pavel Goldstein) Date: Thu, 9 Oct 2014 13:19:19 +0300 Subject: [FieldTrip] Dealing with artifacts in continuous EEG data before Granger Causality analysis Message-ID: Dear FieldTrip list, I'm planning to apply Granger Causality (GC) models to my continuous EEG data, but I'm not sure about the preprocessing steps. I have read an article about filtering EEG data before GC analysis, but still it is not clear for me how to deal with removing some data segments with strong artifacts. Right now I'm planning to clean the data (2-minutes trials) by removing the artifacts using visual detection (+filtering notch+detrending) followed by GC analysis using 2 sec. windows (actually the final length of the windows should be identified by VAR model) . Using such preprocessing approach I would receive continuous data with "gaps" therefore some 2-sec segments may consist of the mixed data before and after the removed part. Such situations seem to me not appropriate for GC analysis. As a possible solutions I thought about 1) removing these mixed segments or 2) Dividing raw data (before artifacts rejection) on 2-sec segments and to remove completely such segments that will contain an artifact. Do I miss something? I would appreciate your advice on this matter. Thanks, Pavel -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.tewoerd at fcdonders.ru.nl Thu Oct 9 13:46:57 2014 From: e.tewoerd at fcdonders.ru.nl (Erik te Woerd) Date: Thu, 9 Oct 2014 13:46:57 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" < jens.klinzing at uni-tuebingen.de>: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Oct 9 18:32:07 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 18:32:07 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: Message-ID: <5436B887.9090305@uni-tuebingen.de> Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite > large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen > cases in which the size went from 13 GB to 150 MB just by clearing the > cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" > >: > > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies > to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same > but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer > ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my > ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the > renderer. > > I am sure it is something very simple and I'm just too blind to > see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Oct 9 19:06:15 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 9 Oct 2014 17:06:15 +0000 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: <5436B887.9090305@uni-tuebingen.de> References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: Hi Jens, It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. Best, Arjen -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] Sent: Thursday, October 09, 2014 6:32 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size Hi Erik, wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). I still have a brain with a very dark color, though. Does anyone know how to get rid of that? Why would these things change without an obvious reason? Thanks for your help, Eric!! All the best, Jens Am 09.10.2014 13:46, schrieb Erik te Woerd: Hi Jens, The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: data.cfg.previous = []; This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) Best, Erik 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: Dear fieldtrip community, I encountered a weird problem. Lately, my source plots started to have huge file sizes when I save them as figures (.fig). This applies to both slice and surface plots. Surface plots used to have around 3-7 MB, now they have around 220 MB or even > 4 GB (ie. almost the size of the plotted data set). They also look slightly different now, with the surface being way darker than before. Slice plots look the same but are also larger than before. The problem seems to be in the plotting process itself (not the beamforming). When I plot older source localizations (which by the way have the same file size, fields, and basic properties as newer ones) the problem is still there. The code I am using for plotting did (to the best of my knowledge) not change at all: cfg = []; cfg.method = 'surface'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolormap = 'jet'; cfg.projmethod = 'nearest'; cfg.surfdownsample = 5; ft_sourceplot(cfg,data) I thought it may be a change in fieldtrip so I reverted my ft_sourceplot to an older version but that did not help. I also used an older Matlab version (currently I use 2013b but I also tried 2013a) and another computer (Windows and Unix). In all cases I used opengl as the renderer. I am sure it is something very simple and I'm just too blind to see it. Any suggestions? Thanks a lot for your help, Jens _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jens.klinzing at uni-tuebingen.de Thu Oct 9 19:44:18 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 09 Oct 2014 19:44:18 +0200 Subject: [FieldTrip] Sourceplots suddenly have huge file size In-Reply-To: References: , <5436B887.9090305@uni-tuebingen.de> Message-ID: <5436C972.1070709@uni-tuebingen.de> Hi Arjen, that's good news! Thanks for your help, Jens Am 09.10.2014 19:06, schrieb Stolk, A. (Arjen): > Hi Jens, > > It seems the grey values for the cortex/surface were changed during a previous code change. I've changed the grey values to match the old ones, so your plots should presumably look like you're used to with tomorrow's version of FT. > > Best, > Arjen > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > ________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of "Jens Klinzing, Universität Tübingen" [jens.klinzing at uni-tuebingen.de] > Sent: Thursday, October 09, 2014 6:32 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Sourceplots suddenly have huge file size > > Hi Erik, > wow, I really wouldn't have thought this could work ... but it did! It resulted in a reduction of the file size from 4.6 GB down to 9 MB (for the result of a statistical cluster permutation test). > > I still have a brain with a very dark color, though. Does anyone know how to get rid of that? > Why would these things change without an obvious reason? > > Thanks for your help, Eric!! > All the best, > Jens > > Am 09.10.2014 13:46, schrieb Erik te Woerd: > Hi Jens, > > The problem might be that the cfg.previous-structure is becoming quite large. Try to clear this before plotting the data, like: > data.cfg.previous = []; > > This is especially helpful when plotting grandaverage-data. (I've seen cases in which the size went from 13 GB to 150 MB just by clearing the cfg.previous) > > Best, > > Erik > > > > 2014-10-09 11:51 GMT+02:00 "Jens Klinzing, Universität Tübingen" >: > Dear fieldtrip community, > I encountered a weird problem. Lately, my source plots started to have > huge file sizes when I save them as figures (.fig). This applies to both > slice and surface plots. Surface plots used to have around 3-7 MB, now > they have around 220 MB or even > 4 GB (ie. almost the size of the > plotted data set). They also look slightly different now, with the > surface being way darker than before. Slice plots look the same but are > also larger than before. > > The problem seems to be in the plotting process itself (not the > beamforming). When I plot older source localizations (which by the way > have the same file size, fields, and basic properties as newer ones) the > problem is still there. > > The code I am using for plotting did (to the best of my knowledge) not > change at all: > cfg = []; > cfg.method = 'surface'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolormap = 'jet'; > cfg.projmethod = 'nearest'; > cfg.surfdownsample = 5; > ft_sourceplot(cfg,data) > > I thought it may be a change in fieldtrip so I reverted my ft_sourceplot > to an older version but that did not help. I also used an older Matlab > version (currently I use 2013b but I also tried 2013a) and another > computer (Windows and Unix). In all cases I used opengl as the renderer. > > I am sure it is something very simple and I'm just too blind to see it. > Any suggestions? > > Thanks a lot for your help, > Jens > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From N.Jain at tudelft.nl Fri Oct 10 14:10:30 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 10 Oct 2014 12:10:30 +0000 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DEE96@SRV384.tudelft.net> Hi Ricarda, I’m currently using .bdf files. EXG is for external signals like eye blinks or even EMG. You want to ideally remove the really bad channels from your signals first, then re-reference them to all electrodes (common average rereferencing). The really high vertical scale you’re seeing is due to digital trigger signals, I think. Just get rid of EXG, GSR etc electrodes, keep only the EEG electrodes. Then proceed with channel/trial rejection! Best of luck, Nishant Jain. TU Delft, Netherlands. From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel Bibi Sent: dinsdag 23 september 2014 16:34 To: FieldTrip discussion list Subject: Re: [FieldTrip] Reading in .bdf files Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann > wrote: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From zriouil.imane at gmail.com Sat Oct 11 03:58:49 2014 From: zriouil.imane at gmail.com (ZRIOUIL Imane) Date: Sat, 11 Oct 2014 01:58:49 +0000 Subject: [FieldTrip] Convert data .txt to .BDF? Message-ID: <4EA73B63-41EE-48E4-BA14-A9E7A89B3D61@gmail.com> Hello, Please, i want to convert my data with extension .txt to . BDF. Anyone have any idea Thank you From eelke.spaak at donders.ru.nl Sat Oct 11 11:40:05 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 11 Oct 2014 11:40:05 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Hi Katrin, The first *3* (not just 2) columns of the trl-matrix are special, they define the start and end sample of the trial, and the offset. Right now you are not storing the offset in the output of your trialfun. Instead, you put the RT in the third column. Since there are no columns 4 and above, no trialinfo is created (plus your time axes will likely be wrong as the RT is now interpreted as offset by FieldTrip). Change the relevant line to the following: newtrl = [trlbegin trlend offset RT]; and you should get a proper trialinfo. Best, Eelke On 2 October 2014 21:53, KatrinH Heimann wrote: > Dear Anne, dear all, > > I did try to create a customized trialfunction serving my needs. > This is what I came up with: > > function [trl, event] = response_trialfun(cfg); > > > > % read the header information and the events from the data > > hdr = ft_read_header(cfg.dataset); > > event = ft_read_event(cfg.dataset); > > > > > > % search for "trigger" events > > value = [event(find(strcmp('ceck', {event.value}))).value]'; > > sample = [event(find(strcmp('ceck', {event.value}))).sample]'; > > > > % search for "trigger" events > > value2 = [event(find(strcmp('resp', {event.value}))).value]'; > > sample2 = [event(find(strcmp('resp', {event.value}))).sample]'; > > > > % determine the number of samples before and after the trigger > > pretrig = -round(cfg.trialdef.prestim * hdr.Fs); > > posttrig = round(cfg.trialdef.poststim * hdr.Fs); > > > > % look for the combination of a trigger "7" followed by a trigger "64" > > % for each trigger except the last one > > trl = []; > > > > trlbegin = sample + pretrig > > trlend = sample + posttrig > > offset = pretrig > > RT = sample2 - sample > > newtrl = [trlbegin trlend RT]; > > trl = [trl; newtrl]; > > > > end > > > > In fact it seems to work, the trials look good and the RT is computed > correctly. Only that after the preprocessing (with ft_preprocessing: > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-0.1 0] > > > > mov_data = ft_preprocessing(cfg); > > % > > ) there is no mov_data.trialinfo created. I thought that the information in > trl above would be saved there. Without those I am not able to do the > redefinition as planned (like Anne proposed: > > > > > offset = (mov_data.trialinfo(:,3)); > > prestim = 0.75; > > poststim = 0.75; > > > > cfg = []; > > cfg.begsample = round(offset - prestim*data.fsample); > > cfg.endsample = round(offset + poststim*data.fsample); > > mov_data_small = ft_redefinetrial(cfg, mov_data); > > > > % then shift the time axis > > cfg = []; > > cfg.offset = -offset; > > mov_data_small = ft_redefinetrial(cfg, move_data_small); > > > > > How come the information is not stored? Somebody an idea? > > Thanks a million > > Katrin > > > 2014-09-28 18:35 GMT+02:00 Anne Urai : >> >> Dear Katrin, >> >> if you use a custom trialfun >> (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) >> you can code the time between stimulus onset and response in an additional >> column. That way, you can shift the time axis of the data by this amount on >> each trial. For example: >> >> % redefine trials >> offset = (data.trialinfo(:,RTcol)); >> prestim = 1; >> poststim = 2; >> >> >> >> cfg = []; >> cfg.begsample = round(offset - prestim*data.fsample); >> cfg.endsample = round(offset + poststim*data.fsample); >> data = ft_redefinetrial(cfg, data); >> >> >> >> % then shift the time axis >> cfg = []; >> cfg.offset = -offset; >> data = ft_redefinetrial(cfg, data); >> >> % timelock >> cfg = []; >> cfg.keeptrials = 'yes'; >> data = ft_timelockanalysis(cfg, data); >> >> That way, your new data structure will now be response locked. Note that >> the timelockanalysis is optional, and only works when you have trials that >> are all the same length. >> >> If you do not want to use a custom trialfun, you could also rerun the same >> analysis as you have for the stimulus-locked data, but then taking the >> response code as your eventvalue. >> >> Good luck, >> >> --- >> Anne E. Urai, MSc >> PhD student | Institut für Neurophysiologie und Pathophysiologie | >> Universitätsklinikum Hamburg-Eppendorf >> Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com >> >> >> >> >> >> On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: >> >> Dear all, >> I know I asked this already twice, but I did not get the right answer yet >> and just cannot figure it out myself. >> So, I did cut my data in quite large trials using ft_define trial and >> logging it to the beginning of a slide. >> >> cfg = []; >> cfg.dataset = name; >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger >> cfg.trialdef.prestim = 0.216; % in seconds >> cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) >> cfg = ft_definetrial(cfg); >> >> >> >> % cancel out training trials >> cfg.trl([1:4],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> %structure trial - plus delay reported by EGE = 18 ms = 9 samples >> cfg.trl(:,3)=cfg.trl(:,3)-17 >> >> >> >> >> >> >> Then I preprocessed these trials >> >> %% preprocess data >> cfg.channel = 'all'; >> cfg.preproc.detrend = 'yes'; >> cfg.preproc.demean = 'yes'; >> cfg.preproc.baselinewindow = [-0.1 0] >> % >> mov_data = ft_preprocessing(cfg); >> % >> save (strcat(sb,'mov_data') , 'mov_data') >> >> >> >> >> Now I wanna cut out smaller pieces that are centered around another >> trigger - the response of the subject. I did not use this trigger at the >> beginning as then defining a baselinewindow is impossible (as the response >> is always happening at a different time). >> >> I tried to just use ft_definetrial again, as I don't see a possibility to >> use ft_redefine trial: >> >> cfg = [] >> cfg.dataset= strcat(sb,'mov_data.mat') >> cfg.trialdef.eventtype = 'trigger'; >> cfg.trialdef.eventvalue = 'resp' >> cfg.trialdef.prestim = 0.75 >> cfg.trialdef.poststim = 0.75 >> >> >> >> mov_data_small = ft_definetrial(cfg) >> >> but I get the error message: >> >> Error using ft_read_header (line 1833) >> unsupported header format (matlab) >> >> Error in ft_trialfun_general (line 71) >> hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); >> >> Error in ft_definetrial (line 169) >> [trl, event] = feval(cfg.trialfun, cfg); >> >> >> >> >> I wonder if that is as the file produced by fieldtrip during the >> preprocessing is not one that is specified for ft_read_header - but how do I >> deal with this? >> >> Thanks a lot for your help >> >> Katrin >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mailtome.2113 at gmail.com Mon Oct 13 08:49:42 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 17:49:42 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Message-ID: Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Oct 13 11:41:20 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 13 Oct 2014 09:41:20 +0000 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Hi Arti, Try lowering the cfg.zlim values (%% Plot TFR). Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] Sent: Monday, 13 October 2014 5:49 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Scaling issues with EEG time frequency analysis Dear fieldtrip users, I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? Thanks Arti cfg =[]; cfg.dataset = 's01.cnt'; cfg.channel = {'all'}; cfg.layout = 'NuAmps.lay'; lay = ft_prepare_layout(cfg); % Event identification cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 101; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg.reref = 'yes'; cfg.implicitref = 'A1'; cfg.refchannel = {'A1' 'A2'}; cfg = ft_definetrial(cfg); % % Filtering % cfg.hpfilter = 'yes'; % cfg.hpfreq = 0.1; % cfg.hpfilttype = 'fir'; dataFIC = ft_preprocessing(cfg); %% Summary detection of bad trials cfg = []; cfg.method = 'summary'; cfg.layout = lay; % this allows for plotting cfg.channels = [1:34]; data_clean = ft_rejectvisual(cfg, dataFIC); % Calculate TFR for condition1 cfg = []; cfg.trials = find(data_clean.trialinfo==101); cfg.channel = 'EEG'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 2:2:48; cfg.toi = -0.5:0.05:1; s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); %% Plot TFR cfg = []; cfg.baseline = [-0.5 -0.1]; cfg.baselinetype = 'absolute'; cfg.zlim = [-500 500]; cfg.showlabels = 'yes'; cfg.layout = lay; figure ft_multiplotTFR(cfg, s01_TFRwave4ch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Mon Oct 13 12:37:45 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Mon, 13 Oct 2014 21:37:45 +1100 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? Thanks Arti On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > *Sent:* Monday, 13 October 2014 5:49 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency > analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I > have used the following script (I wrote the script from the examples on the > fieldtrip website), but I get the time frequency plots with huge values. > Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Oct 13 13:44:15 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 13 Oct 2014 13:44:15 +0200 Subject: [FieldTrip] Scaling issues with EEG time frequency analysis In-Reply-To: References: Message-ID: <99C51A43-5E39-4C9C-949D-D8F4EEF3C539@uni-konstanz.de> Dear Arti, the units on the tutorial are in Tesla^2. In your case they might end up being in V^2 if you first convert them to volts instead of bits, i.e. the reason why you end up with those high values. So, to your question, your are not doing anything wrong. best tzvetan > Thanks Peter. Perhaps I wasn't clear in the previous email. The time frequency values that I got are too high. I had to changes the Z axis limits to -500 to 500 instead of the [-3e-27 3e-27] values on the tutorial. Is there anything I am doing wrong? > Thanks > Arti > > On Mon, Oct 13, 2014 at 8:41 PM, Peter Goodin wrote: > Hi Arti, > > Try lowering the cfg.zlim values (%% Plot TFR). > > Peter > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 4, 607 St Kilda Road, > Melbourne 3004 > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Arti Abhishek [mailtome.2113 at gmail.com] > Sent: Monday, 13 October 2014 5:49 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Scaling issues with EEG time frequency analysis > > Dear fieldtrip users, > > I am a new fieldtrip user and I am having some problems with frequency analysis. My EEG data is recorded from Neuroscan NuAmps system (22 bit). I have used the following script (I wrote the script from the examples on the fieldtrip website), but I get the time frequency plots with huge values. Could anyone please suggest me what I am doing wrong? > > Thanks > Arti > cfg =[]; > > cfg.dataset = 's01.cnt'; > > cfg.channel = {'all'}; > > cfg.layout = 'NuAmps.lay'; > > lay = ft_prepare_layout(cfg); > > % Event identification > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 101; > > cfg.trialdef.prestim = 1; > > cfg.trialdef.poststim = 2; > > cfg.reref = 'yes'; > > cfg.implicitref = 'A1'; > > cfg.refchannel = {'A1' 'A2'}; > > cfg = ft_definetrial(cfg); > > % % Filtering > > % cfg.hpfilter = 'yes'; > > % cfg.hpfreq = 0.1; > > % cfg.hpfilttype = 'fir'; > > dataFIC = ft_preprocessing(cfg); > > %% Summary detection of bad trials > > cfg = []; > > cfg.method = 'summary'; > > cfg.layout = lay; % this allows for plotting > > cfg.channels = [1:34]; > > data_clean = ft_rejectvisual(cfg, dataFIC); > > % Calculate TFR for condition1 > > cfg = []; > > cfg.trials = find(data_clean.trialinfo==101); > > cfg.channel = 'EEG'; > > cfg.method = 'wavelet'; > > cfg.width = 7; > cfg.output = 'pow'; > > cfg.foi = 2:2:48; > > cfg.toi = -0.5:0.05:1; > > s01_TFRwave4ch = ft_freqanalysis(cfg, data_clean); > > %% Plot TFR > > cfg = []; > > cfg.baseline = [-0.5 -0.1]; > > cfg.baselinetype = 'absolute'; > > cfg.zlim = [-500 500]; > cfg.showlabels = 'yes'; > > cfg.layout = lay; > > figure > > ft_multiplotTFR(cfg, s01_TFRwave4ch) > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Oct 13 17:16:52 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 13 Oct 2014 15:16:52 +0000 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' Message-ID: Hi all, In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been hoping to end up with a source file with both averaged and individual trials in source space, much as can be done with time locking in sensor space. However, my resulting source file only ever has avg data, regardless of what I tweak. Does anyone know what I may be doing wrong, or how I could possibly use beamformer with lcmv method and keep individual trials at source space grid points? Thanks in advance! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:49:23 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:49:23 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: Dear Kaelasha, I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* Good luck, Joram On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler wrote: > Hi all, > > In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been > hoping to end up with a source file with both averaged and individual > trials in source space, much as can be done with time locking in sensor > space. > > However, my resulting source file only ever has avg data, regardless of > what I tweak. > > Does anyone know what I may be doing wrong, or how I could possibly use > beamformer with lcmv method and keep individual trials at source space grid > points? > > Thanks in advance! > > Kaelasha Tyler > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Mon Oct 13 17:51:21 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 13 Oct 2014 17:51:21 +0200 Subject: [FieldTrip] ft_sourceanalysis with keeptrials='yes' In-Reply-To: References: Message-ID: NB: cfg.keeptrials='yes'; is also handy, because this ensures the trial info matrix is left into the output structure, so you can do, e.g., correlations between the single-trial power and the RT of each trial, or some other trial-varying variable. - Joram On Mon, Oct 13, 2014 at 5:49 PM, Joram van Driel wrote: > Dear Kaelasha, > I bumped into this as well, and apparently you need *cfg.rawtrial='yes';* > Good luck, > Joram > > On Mon, Oct 13, 2014 at 5:16 PM, Kaelasha Tyler > wrote: > >> Hi all, >> >> In calling ft_sourceanalysis with cfg.keeptrials='yes', I have been >> hoping to end up with a source file with both averaged and individual >> trials in source space, much as can be done with time locking in sensor >> space. >> >> However, my resulting source file only ever has avg data, regardless of >> what I tweak. >> >> Does anyone know what I may be doing wrong, or how I could possibly use >> beamformer with lcmv method and keep individual trials at source space grid >> points? >> >> Thanks in advance! >> >> Kaelasha Tyler >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 03:12:04 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Mon, 13 Oct 2014 18:12:04 -0700 Subject: [FieldTrip] unable to download Message-ID: Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 14 08:03:11 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 14 Oct 2014 06:03:11 +0000 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Hi Brittany, For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. Silly silly mistake on my part. Might be of help to you? Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] Sent: Tuesday, 14 October 2014 12:12 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] unable to download Hello I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 14 09:27:01 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 14 Oct 2014 09:27:01 +0200 Subject: [FieldTrip] using clusterplot to plot percentage changes Message-ID: Dear all, I was wondering if it would be possible to plot percentage changes of power spectrum using ft_clusterplot function. As far as I understand, the zlim specified for the ft_clusterplot is the changes of the power spectrum, right? Does anyone know the unit of the zlim? My power spectrum was calculated using the mtmfft function. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Tue Oct 14 19:50:41 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Tue, 14 Oct 2014 10:50:41 -0700 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: Thanks Kaelasha, I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? Brittany On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to > download the FT zip file from the FT server. What I was supped to be doing > I was dragging and dropping the zip file onto my computer where the file > transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Brittany Alperin [balperin07 at gmail.com] > *Sent:* Tuesday, 14 October 2014 12:12 PM > *To:* fieldtrip at science.ru.nl > *Subject:* [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the > download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:36:05 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:36:05 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis Message-ID: Dear list, I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 15 03:39:36 2014 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 15 Oct 2014 12:39:36 +1100 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Apologies for the previous email. I hit send before finished typing I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I have EEG data preprocessed and saved as .mat files. Now I want to further process the data. I used the following script Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', 's10', 's11', 's12'... 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; Triggers = [101 111 121]; Conditions = {'4Ch', '8Ch', '16Ch'}; for i=1:length(Subjects) for j=1:length (Conditions) cfg =[]; FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); DataFIC = load (FileName); hdr = ft_read_header (DataFIC); dat = ft_read_data(DataFIC, 'header', 'hdr'); cfg.method = 'summary'; cfg.channels = 'all'; data_clean = ft_rejectvisual(cfg, dat); save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') end; end; This is returning the following error Undefined function 'eq' for input arguments of type 'struct'. Error in filetype_check_uri (line 62) sep = find(filename==':'); Error in fetch_url (line 33) if filetype_check_uri(filename, 'sftp') Error in ft_read_header (line 105) filename = fetch_url(filename); Any help would be much appreciated. Regards, Arti On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek wrote: > Dear list, > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > > > cfg =[]; > > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > > > data_clean = ft_rejectvisual(cfg, dat); > > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias.treder at gmail.com Wed Oct 15 20:56:17 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Wed, 15 Oct 2014 19:56:17 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 15 22:09:43 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <577666873.3492259.1413403783469.JavaMail.root@bcbl.eu> Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From matthias.treder at gmail.com Thu Oct 16 20:54:20 2014 From: matthias.treder at gmail.com (Matthias Treder) Date: Thu, 16 Oct 2014 19:54:20 +0100 Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias > Message: 1 > Date: Wed, 15 Oct 2014 19:56:17 +0100 > From: Matthias Treder > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: > < > CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hello FieldTrippers, > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and > the result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires either > a field .mom or the structure of the data has to be rpttap_chan_freq, but I > have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho > Message-ID: <577666873.3492259.1413403783469.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Hi Matthias, > > have you tried: > > cfg.keetrials = 'yes' in your cfg? > > Best, > Fred > > Fr?d?ric Roux > > ----- Original Message ----- > From: "Matthias Treder" > To: fieldtrip at science.ru.nl > Sent: Wednesday, October 15, 2014 8:56:17 PM > Subject: [FieldTrip] Connectivity analysis with powcorr_ortho > > > > > > > > Hello FieldTrippers, > > > I want to do a envelope-based connectivity analysis of resting state MEG > following the regime of Hipp. The respective method is implemented in > ft_connectivityanalysis as powcorr_ortho. > > > > Like in the Hipp paper, I am first doing a wavelet analysis on the sensor > level (10 Hz for me). > I eventually want to do source-space analysis - currently I stay in sensor > space, however. > I keep the complex Fourier coefficients (cfg.output = 'fourier') and the > result is: > > label: {204x1 cell} > dimord: 'rpttap_chan_freq_time' > freq: [10 20] > time: [1x57400 double] > fourierspctrm: [4-D double] > cumtapcnt: [1 1] > grad: [1x1 struct] > cfg: [1x1 struct] > > > Looking in ft_connectivityanalysis in line 697 the function requires > either a field .mom or the structure of the data has to be > rpttap_chan_freq, but I have sensor-level time-frequency data. > > Any idea how to fix my analysis? > > Thanks a lot ! > Matthias > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 47, Issue 13 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Oct 16 23:12:40 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 16 Oct 2014 23:12:40 +0200 Subject: [FieldTrip] unable to download In-Reply-To: References: Message-ID: <8B1D8545-3F9C-47D8-B3AC-E067B859D029@donders.ru.nl> Dear Brittany and others Multiple people have reported intermittent download problems over the last few days. Last weekend the network in our building was renewed and reconfigured, and I suspect that there are still some issues with the new network. I have notified our ICT department and hope that they will fix it. In case you want the fieldtrip source code, there are some alternatives mentioned on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. With git or svn it is much easier to keep your copy of the fieldtrip code up to date. On the github page there is also a zip file, which is always the latest version. In case you want to download the tutorial data, I have no work around and can only suggest that you keep on trying. sorry for the inconvenience, Robert On 14 Oct 2014, at 19:50, Brittany Alperin wrote: > Thanks Kaelasha, > > I've been able to successfully download fieldrtrip several times in the past. This time I get the e-mail with the link to the page with all of the downloads, but the webpage never loads. Has anyone tried to get to that webpage recently? > > Brittany > > > > On Mon, Oct 13, 2014 at 11:03 PM, Kaelasha Tyler wrote: > Hi Brittany, > > For what it's worth, I spent quite a few frustrated hours trying to download the FT zip file from the FT server. What I was supped to be doing I was dragging and dropping the zip file onto my computer where the file transfer happens automatically and easily. > > Silly silly mistake on my part. Might be of help to you? > > Kaelasha > > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Brittany Alperin [balperin07 at gmail.com] > Sent: Tuesday, 14 October 2014 12:12 PM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] unable to download > > Hello > > I've been trying to download fieldtrip and I'm unable to load the download page. Is anyone else having this problem? > > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 17 01:48:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 16 Oct 2014 16:48:00 -0700 Subject: [FieldTrip] source grand-average MNE Message-ID: <54405930.6040106@gmail.com> Hi all, I was wondering whether anyone has an insight into the problem I've been having when trying to run ft_sourcegrandaverage on the output from ft_sourceanalysis with cfg.method = 'mne'; I followed the procedure described in the tutorial "Source reconstruction of event-related fields using minimum-norm estimate" http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate and I'm working with MNI-warped grids. (I'm using version fieldtrip-20140801) With a call to ft_sourcegrandaverage over the subjects' data, I get the error a known error: "the input sources vary in the field pos". So what I did next was to set .pos and .dim for each subjects' source reconstruction to one same .pos and .dim from the template sourcemodel. In this case, the error I get is the following: Error using fixdimord (line 159) unexpected dimord "_ori_ori" Error in fixdimord (line 91) data = fixdimord(data); Error in ft_datatype_source (line 208) source = fixdimord(source); Error in ft_sourcegrandaverage (line 108) varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I haven't been able to download a more recent version of FT yet (server down?), so I apologise if my question would be solved by simply downloading a more recent FT version. Thanks a lot, Vitoria From f.roux at bcbl.eu Fri Oct 17 08:49:42 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Fri, 17 Oct 2014 08:49:42 +0200 (CEST) Subject: [FieldTrip] Connectivity analysis with powcorr_ortho In-Reply-To: Message-ID: <90389720.3507978.1413528582649.JavaMail.root@bcbl.eu> Hi Matthias, if you want the dimensions of your data to be rpttap_chan_freq instead of rpttap_chan_freq_time you can try this cfg: cfg = []; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.pad = 'maxperlen'; cfg.keeptapers = 'yes'; cfg.keeptrials = 'yes'; cfg.foi = 0:Fs/2; Here instead of computing a spectrogram with wavelets, you are computing a spectrum (no temporal information) using either a hanning taper, or any other taper of your choice. The output of this cfg should give you a data-structure with the dimensions that you are interested in. Best, Fred Frédéric Roux ----- Original Message ----- From: "Matthias Treder" To: fieldtrip at science.ru.nl Sent: Thursday, October 16, 2014 8:54:20 PM Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Yes I tried cfg.keeptrials = 'yes'. I should add that I just have one long trial (resting state). I chopped it into 10 seconds-trials with ft_definetrials and re-did the analysis but it didn't help either. As said below, looking into the code the dimensions should be rpttap_chan_freq but I have rpttap_chan_freq_time because I used wavelets (as in Hipp's paper). Any other ideas? Best, Matthias Message: 1 Date: Wed, 15 Oct 2014 19:56:17 +0100 From: Matthias Treder < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < CAAQEB5rODY2bTwOkQhPPKMeWQG68hozdOB4qiSn1pBP2W7LyHw at mail.gmail.com > Content-Type: text/plain; charset="utf-8" Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141015/e7a48133/attachment-0001.html > ------------------------------ Message: 2 Date: Wed, 15 Oct 2014 22:09:43 +0200 (CEST) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Connectivity analysis with powcorr_ortho Message-ID: < 577666873.3492259.1413403783469.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Hi Matthias, have you tried: cfg.keetrials = 'yes' in your cfg? Best, Fred Fr?d?ric Roux ----- Original Message ----- From: "Matthias Treder" < matthias.treder at gmail.com > To: fieldtrip at science.ru.nl Sent: Wednesday, October 15, 2014 8:56:17 PM Subject: [FieldTrip] Connectivity analysis with powcorr_ortho Hello FieldTrippers, I want to do a envelope-based connectivity analysis of resting state MEG following the regime of Hipp. The respective method is implemented in ft_connectivityanalysis as powcorr_ortho. Like in the Hipp paper, I am first doing a wavelet analysis on the sensor level (10 Hz for me). I eventually want to do source-space analysis - currently I stay in sensor space, however. I keep the complex Fourier coefficients (cfg.output = 'fourier') and the result is: label: {204x1 cell} dimord: 'rpttap_chan_freq_time' freq: [10 20] time: [1x57400 double] fourierspctrm: [4-D double] cumtapcnt: [1 1] grad: [1x1 struct] cfg: [1x1 struct] Looking in ft_connectivityanalysis in line 697 the function requires either a field .mom or the structure of the data has to be rpttap_chan_freq, but I have sensor-level time-frequency data. Any idea how to fix my analysis? Thanks a lot ! Matthias _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 47, Issue 13 ***************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From drbatalasandhya at gmail.com Fri Oct 17 16:37:04 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:07:04 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. as an alternate I have downloaded the zip file of the toolbox. Therefore I am in need of the example data . Can anyone please share the example data with me. thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From ms.fieldtrip at googlemail.com Fri Oct 17 17:09:04 2014 From: ms.fieldtrip at googlemail.com (Michael Meg) Date: Fri, 17 Oct 2014 17:09:04 +0200 Subject: [FieldTrip] Very short Morlet wavelets - non-zero mean correction missing ? Message-ID: Dear colleagues and friends, looking at the current Fieldtrip version (20141016), I could not find the "low-cycle correction" that you need for less than 5 cycles in Morlet wavelet analysis. On the other hand a gwidth (Gaussian width, I suppose) parameter defaults to 3 instead of five. Maybe it would be good to implement the correction by subtracting exp( (2*pi*freqoi(ifreqoi))2 / 2) from the complex exponential after its created? (The correction deals with the fact that the complex Morlet wavelet has a non-zero mean at the low cycle numbers. See for example: The Illustrated Wavelet Transform Handbook: Introductory Theory and Applications in Science, Egnineering, Medicine and Finance. Paul S Addison. page 35) Please disregard this email if this has been done in the meantime. Best, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Fri Oct 17 17:26:34 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Fri, 17 Oct 2014 20:56:34 +0530 Subject: [FieldTrip] example data Message-ID: hello, I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . Can anyone please share the example data with me. Thanking you Sandhya -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:04:37 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:04:37 +0200 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sandhya and others Please find below a short section forwarded from our local ICT staff. They are presently working together with the university ICT staff to get it resolved. The suggestion below might provide a work around. best regards, Robert Begin forwarded message: > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of setting > the transfer mode to "active". As an example you could use filezilla and force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active On 17 Oct 2014, at 17:26, batala sandhya wrote: > hello, > > I am unable to connect to the ftp server to download the toolbox and example data. As an alternate I have downloaded the master zip file of the toolbox provided in the website . Therefore I am in need of the example data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Mon Oct 20 15:31:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 20 Oct 2014 15:31:29 +0200 Subject: [FieldTrip] change in ft_rejectvisual regarding dataout.cfg.artifact Message-ID: <057A6C50-2437-447F-A8B4-2DA63F0B327F@donders.ru.nl> Dear all I recently made a change in ft_rejectvisual that some of you might want to be aware of. It has to do with keeping track of rejected data segments and the change was made in revision 9881, which you can see in detail at https://code.google.com/p/fieldtrip/source/detail?r=9881 It used to be that with dataout = ft_rejectvisual(cfg, datain); you would get dataout.cfg.artifact as a Nx2 matrix with the data segments that were marked as artifact. The new behaviour is that the Nx2 matrix is now to be found in either one of dataout.cfg.artfctdef.summary.artifact dataout.cfg.artfctdef.trial.artifact dataout.cfg.artfctdef.channel.artifact depening on whether cfg.method=summary/trial/channel. This makes ft_rejectvisual compatible with the other ft_artifact_xxx functions. So, you can now do cfg.keeptrial = ‘yes’ cfg.keepchannel = ‘yes’ dataout = ft_rejectvisual(cfg, datain); where dataout still contains all trials and channels, but subsequently you can use dataclean = ft_rejectartifact(dataout.cfg, datain) to remove them explicitly. This facilitates repeated passes of ft_rejectartifact for different channel types (EEG, planar gradiometers, magnetometers) and to store the manual work in between. best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From Laura.Rueda at faber.kuleuven.be Mon Oct 20 18:17:25 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Mon, 20 Oct 2014 16:17:25 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics Message-ID: Dear all, I'm working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don't have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don't have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:49:47 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:49:47 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < Laura.Rueda at faber.kuleuven.be> wrote: > Dear all, > > > > I’m working with EEG data and the individual MRIs. I have a doubt about a > step for defining ROIs. I have EEG data during a task with 3 conditions > (C1, C2, C3) and during rest. I would like to know what is the main effect > of the conditions in my source data. I was recommended to use the contrast > of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, > which then are used to restrict the source and statistical analysis between > the conditions. This is what I do: > > > > - Estimate sources with the common filter for Task and Rest > separately. > > - Find sources that are significantly different between these > two conditions (ft_sourcestatistics with dependent T). > > - Use the position of these sources as ROIs in ft_sourceanalysis > for C1, C2 and C3 separately (but using a common filter of these > conditions). > > - Find sources that account for the main effect between > conditions (ft_sourcestatistics with dependent F). > > > > Now the problem is that if I use the position of the sources in > ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a > problem when using ft_sourcestatistics as cfg.dim needs to be specified and > if I do not specify it (because I don’t have a regular grid with 3 > dimensions as expected), I get the following error: > > > > Error using reshape > > To RESHAPE the number of elements must not change. > > > > Error in clusterstat (line 185) > > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > > Error in ft_statistics_montecarlo (line 361) > > [stat, cfg] = clusterstat(cfg, statrand, statobs); > > > > Error in statistics_wrapper (line 308) > > [stat, cfg] = statmethod(cfg, dat, design); > > > > Error in ft_sourcestatistics (line 107) > > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > > > > So does anybody know a way to work around this? > > > > And what do you think of the logic of these steps? > > > > Thank you in advance for any help! > > > > > > Cheers, > > > > Laura Rueda Delgado > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Mon Oct 20 18:58:30 2014 From: mcantor at umich.edu (Max Cantor) Date: Mon, 20 Oct 2014 12:58:30 -0400 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor wrote: > Hi Laura, > > If I understand your problem correctly, what I think you need to do is > create a template grid using ft_source_model, then use ft_source_model to > create a grid using each subjects' mri with the template grid, and finally > change the .dim and .pos parameters of the source analysis output to unwarp > from the subject grid to the template grid. The following code might help, > although I think there is also a tutorial that talks about this: > > template = ft_read_mri(templatefile); > template.coordsys = 'spm'; > > % segment the template brain and construct a volume conduction model > (i.e. head model) > > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > > % construct the dipole grid in the template brain coordinates > > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > > % Subject mri > > mri = ft_read_mri(mrifile); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmented = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmented); > > % Prepare Source Model using template grid and subject mri > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; > cfg.mri = mri; > grid = ft_prepare_sourcemodel(cfg); > > % Unwarp Grid (For group analysis) > > src.dim = template_grid.dim; > src.pos = template_grid.pos; > > I hope this helps. > best, > > Max > > > > On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado < > Laura.Rueda at faber.kuleuven.be> wrote: > >> Dear all, >> >> >> >> I’m working with EEG data and the individual MRIs. I have a doubt about a >> step for defining ROIs. I have EEG data during a task with 3 conditions >> (C1, C2, C3) and during rest. I would like to know what is the main effect >> of the conditions in my source data. I was recommended to use the contrast >> of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, >> which then are used to restrict the source and statistical analysis between >> the conditions. This is what I do: >> >> >> >> - Estimate sources with the common filter for Task and Rest >> separately. >> >> - Find sources that are significantly different between these >> two conditions (ft_sourcestatistics with dependent T). >> >> - Use the position of these sources as ROIs in >> ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter >> of these conditions). >> >> - Find sources that account for the main effect between >> conditions (ft_sourcestatistics with dependent F). >> >> >> >> Now the problem is that if I use the position of the sources in >> ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a >> problem when using ft_sourcestatistics as cfg.dim needs to be specified and >> if I do not specify it (because I don’t have a regular grid with 3 >> dimensions as expected), I get the following error: >> >> >> >> Error using reshape >> >> To RESHAPE the number of elements must not change. >> >> >> >> Error in clusterstat (line 185) >> >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> >> Error in ft_statistics_montecarlo (line 361) >> >> [stat, cfg] = clusterstat(cfg, statrand, statobs); >> >> >> >> Error in statistics_wrapper (line 308) >> >> [stat, cfg] = statmethod(cfg, dat, design); >> >> >> >> Error in ft_sourcestatistics (line 107) >> >> [stat, cfg] = statistics_wrapper(cfg, varargin{:}); >> >> >> >> >> >> So does anybody know a way to work around this? >> >> >> >> And what do you think of the logic of these steps? >> >> >> >> Thank you in advance for any help! >> >> >> >> >> >> Cheers, >> >> >> >> Laura Rueda Delgado >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From assaf.harel at wright.edu Mon Oct 20 23:18:19 2014 From: assaf.harel at wright.edu (Harel, Assaf) Date: Mon, 20 Oct 2014 17:18:19 -0400 Subject: [FieldTrip] Post Doc Position in Human Neuroscience and Visual Cognition Message-ID: <46894172-662A-4C53-86A7-1CAF709EAF59@wright.edu> Human Neuroscience and Visual Cognition Lab Department of Psychology Wright State University A post-doc position is now available at the newly established Human Neuroscience and Visual Cognition Lab at the Department of Psychology, Wright State University. The lab is headed by Dr. Assaf Harel and investigates high-level vision and its neural substrates. We are particularly interested in how visual recognition occurs in real-world settings and adopt a neuroergonomic approach to study the applied aspects of high-level vision. For this purpose, we employ a diversity of cognitive neuroscience methods, including fMRI, EEG, psychophysics, and eye tracking. Research topics include, but are not limited to the following areas: visual expertise, object and scene recognition, categorization and perceptual learning. The position is fully funded for two years. The successful candidate will hold a PhD in Cognitive Neuroscience, Cognitive Psychology, Neurobiology, Computer Science, or any other related discipline by the start date of the position. Strong background and familiarity with fMRI or EEG research is required. Experience in computer programming, especially with Matlab is highly encouraged and will be considered a strong advantage. Applicants should send their CV, a short statement of their research interests and contact information for two references to Dr. Assaf Harel at: assaf.harel at wright.edu. The Department of Psychology is housed in the College of Science and Mathematics, offers a Ph.D. in Human Factors and Industrial/ Organizational Psychology, and has 3 undergraduate concentration areas: (1) Cognition and Perception, (2) Industrial/ Organizational, and (3) Behavioral Neuroscience. Wright State University was recently ranked among the “Best in the Midwest” universities by The Princeton Review, listed among 260 Best National Universities in the annual “America’s Best Colleges” rankings by U.S. News and World Report, and ranked fourth nationally among universities with limited numbers of doctoral programs in the Faculty Scholarly Productivity Index. Wright State University is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Tue Oct 21 00:20:21 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Tue, 21 Oct 2014 00:20:21 +0200 Subject: [FieldTrip] Opening preprocessed .mat files for further analysis In-Reply-To: References: Message-ID: Dear Arti, I suppose you already solved your problem. Just in case. What the matlab error is telling you is: "you are giving me something (a structure) while I was expecting a string" (you will get familiar with that error. well or hopefully not). So in a nutshell you need to give ft_read_header a string, probably the name of the file you have your data exported to (extension included). A common error is calling ft_read_header like ft_read_header(cfg) because ft_databrowser or ft_preprocessing can open external files if you feed them with cfg.dataset - who is a string. In your case, this is happening because you are trying to read the header of a matlab variable - a structure of eeg data imported in fieldtrip format. So if what I say makes sense you will see this is not a fieldtrip problem indeed. So call something like ft_read_header('mydata.edf'). Last advice highlight ft_read_header and press F1. Ánimo and good luck with your data explorations 2014-10-15 3:39 GMT+02:00 Arti Abhishek : > Apologies for the previous email. I hit send before finished typing > > I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I > have EEG data preprocessed and saved as .mat files. Now I want to further > process the data. I used the following script > > Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', > 's10', 's11', 's12'... > > 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; > > Triggers = [101 111 121]; > > Conditions = {'4Ch', '8Ch', '16Ch'}; > > for i=1:length(Subjects) > > for j=1:length (Conditions) > > cfg =[]; > > FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); > > DataFIC = load (FileName); > > hdr = ft_read_header (DataFIC); > > dat = ft_read_data(DataFIC, 'header', 'hdr'); > > cfg.method = 'summary'; > > cfg.channels = 'all'; > > data_clean = ft_rejectvisual(cfg, dat); > > save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') > > end; > > end; > > This is returning the following error > > Undefined function 'eq' for input arguments of type 'struct'. > > Error in filetype_check_uri (line 62) > sep = find(filename==':'); > > Error in fetch_url (line 33) > if filetype_check_uri(filename, 'sftp') > > Error in ft_read_header (line 105) > filename = fetch_url(filename); > > Any help would be much appreciated. > > Regards, > > Arti > > On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek > wrote: > >> Dear list, >> >> I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I >> have EEG data preprocessed and saved as .mat files. Now I want to further >> process the data. I used the following script >> >> Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09', >> 's10', 's11', 's12'... >> >> 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'}; >> >> Triggers = [101 111 121]; >> >> Conditions = {'4Ch', '8Ch', '16Ch'}; >> >> for i=1:length(Subjects) >> >> for j=1:length (Conditions) >> >> >> >> cfg =[]; >> >> >> FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat'); >> >> >> >> DataFIC = load (FileName); >> >> hdr = ft_read_header (DataFIC); >> >> >> dat = ft_read_data(DataFIC, 'header', 'hdr'); >> >> cfg.method = 'summary'; >> >> cfg.channels = 'all'; >> >> >> >> data_clean = ft_rejectvisual(cfg, dat); >> >> >> save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean') >> >> end; >> >> end; >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Tue Oct 21 03:41:01 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 21 Oct 2014 12:11:01 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Dear Eelke, Thank you for help regarding cluster-based permutation analysis of two or more conditions. I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. for k = 1:Nmt, % states for i = 1%:Ng, % groups for j = 1:Ns, % subjects % load files p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); % convert to eeglab to get channel locations EEG(j) = eeg2eeglab( p(j)); EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); % preprocessing in fieldtrip d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); % specify length of time to use in config time = EEG(j).xmax-EEG(j).xmin; % setup configuration for freqanalysis cfg = []; % clear cfg cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = 1:0.05:time; % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles cfg.keeptrials = 'yes'; % do freqanalysis freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) Any help would be appreciated. Kind regards, Dylan On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > and > > the two experimental designs (between- and within-UO), the tutorial > covers > > statistics on data in two conditions in a between-trials, in a > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > first > > averaging over all trials belonging to each of the experimental > conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drbatalasandhya at gmail.com Tue Oct 21 07:14:24 2014 From: drbatalasandhya at gmail.com (batala sandhya) Date: Tue, 21 Oct 2014 10:44:24 +0530 Subject: [FieldTrip] example data In-Reply-To: References: Message-ID: Dear Sir, As directed, I tried to connect via ftp client filezilla to connect to the host ftp but it was unable to make a connection displaying a error , screenshot of which is included as under [image: Inline image 1] Sir can you please suggest as to why this error occured Thanks and regard On Mon, Oct 20, 2014 at 6:34 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Dear Sandhya and others > > Please find below a short section forwarded from our local ICT staff. They > are presently working together with the university ICT staff to get it > resolved. The suggestion below might provide a work around. > > best regards, > Robert > > > Begin forwarded message: > > our ftp-server is not working as expected after the network > migration last Saturday, October 11th. Our network firewall managers now > allow > only active transfer mode. We have to discuss this new security policy with > the network department this afternoon. > > As a workaround for now, please use an ftp-client with capabilities of > setting > the transfer mode to "active". As an example you could use filezilla and > force > active mode with: > Edit, settings, FTP and set Tranfer Mode to Active > > > > > > > On 17 Oct 2014, at 17:26, batala sandhya > wrote: > > hello, > > I am unable to connect to the ftp server to download the toolbox and > example data. As an alternate I have downloaded the master zip file of the > toolbox provided in the website . Therefore I am in need of the example > data . > > Can anyone please share the example data with me. > > Thanking you > Sandhya > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture.JPG Type: image/jpeg Size: 82981 bytes Desc: not available URL: From Laura.Rueda at faber.kuleuven.be Tue Oct 21 10:17:42 2014 From: Laura.Rueda at faber.kuleuven.be (Laura Rueda Delgado) Date: Tue, 21 Oct 2014 08:17:42 +0000 Subject: [FieldTrip] Specific sources and ft_sourcestatistics In-Reply-To: References: Message-ID: Dear all and Max, Thank you for your comment. I think I wasn’t clear in my previous message I’ve added more explanation to the steps that I mentioned before: 1) Estimate sources with the common filter for Task and Rest separately: I create the headmodel from the invidual MRI, and create the grid from the individually warped template as described in the tutorial that you suggested. I use eLORETA. 2) Find sources (let’s call them ‘Task_vs_Rest’)that are significantly different between these two conditions (ft_sourcestatistics with dependent T): I run a cluster-based permutation on the sources after unwarping the positions to the positions of the template for group analysis. 3) Use the position of these sources (Task_vs_Rest) as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions): I get the index of the sources Task_vs_Rest and use this index for selecting the x,y,z coordinates (grid.pos) of the individually warped template. These x,y,z coordinates are my ROIs for ft_sourceanalysis. 4) Find sources (let’s call them ‘C1vsC2vsC3’) that account for the main effect between conditions (ft_sourcestatistics with dependent F). My question: I get stuck in step 4. The problem is that if I use the position of the sources Task_vs_Rest, as a way to select ROIs, I don’t have a regular grid anymore for steps 3 and 4. When using ft_sourcestatistics to find C1vsC2vsC3 (in step 4), cfg.dim needs to be specified. If I do not specify it (because I don’t have a regular grid with 3 dimensions as expected in step 4), I get the error shown in my previous message. The goal with these steps is to first obtain meaningful sources from the contrast Task (including C1, C2 and C3) vs Rest to use them for the contrast C1 vs C2 vs C3. Please let me know if these steps make any sense, and whether and/or how I could work around this error. Best regards, Laura Rueda Delgado KU Leuven - Department of Kinesiology Movement Control and Neuroplasticity Research Group Building De Nayer (GDN) Tervuursevest 101 bus 1501 3001 Leuven Belgium From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Max Cantor Sent: maandag 20 oktober 2014 18:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] Specific sources and ft_sourcestatistics I found the tutorial, http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid Hopefully that clarifies anything about the code. On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor > wrote: Hi Laura, If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this: template = ft_read_mri(templatefile); template.coordsys = 'spm'; % segment the template brain and construct a volume conduction model (i.e. head model) cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); % construct the dipole grid in the template brain coordinates cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); % Subject mri mri = ft_read_mri(mrifile); mri = ft_volumereslice([], mri); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmented = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmented); % Prepare Source Model using template grid and subject mri cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; cfg.mri = mri; grid = ft_prepare_sourcemodel(cfg); % Unwarp Grid (For group analysis) src.dim = template_grid.dim; src.pos = template_grid.pos; I hope this helps. best, Max On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado > wrote: Dear all, I’m working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do: - Estimate sources with the common filter for Task and Rest separately. - Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T). - Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions). - Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F). Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don’t have a regular grid with 3 dimensions as expected), I get the following error: Error using reshape To RESHAPE the number of elements must not change. Error in clusterstat (line 185) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ft_statistics_montecarlo (line 361) [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in statistics_wrapper (line 308) [stat, cfg] = statmethod(cfg, dat, design); Error in ft_sourcestatistics (line 107) [stat, cfg] = statistics_wrapper(cfg, varargin{:}); So does anybody know a way to work around this? And what do you think of the logic of these steps? Thank you in advance for any help! Cheers, Laura Rueda Delgado _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Tue Oct 21 11:39:14 2014 From: anne.urai at gmail.com (Anne Urai) Date: Tue, 21 Oct 2014 11:39:14 +0200 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <5322FFE6.7000902@donders.ru.nl> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> <5322FFE6.7000902@donders.ru.nl> Message-ID: <2BED38A7-3028-45B0-BCC4-78FC047F66C5@gmail.com> Hi Phyllis, I have a similar situation - ft_databrowser after appending - and I solved the problem of not seeing events at the right times by manually rebuilding them. For artefact rejection I found it important to know when in the trial eg. blinks occurred. There is the (undocumented?) cfg.event input option, which I used in the following way % ARTIFICIALLY REBUILD EVENTS for t = 1:length(data.trial), % get the distance between each event and the start of the trial samples(t,1) = trl(t,2)-trl(t,1); %int1 samples(t,2) = trl(t,5)-trl(t,1); %int2 samples(t,3) = trl(t,8)-trl(t,1); %resp samples(t,4) = trl(t,10)-trl(t,1); %fb % add the length of this trial samples(t,:) = samples(t,:) + (12*600*t-1); end samples = reshape(samples', 1, numel(samples)); % create events structure to feed into databrowser for i = 1:length(samples), e(i).type = 'x'; e(i).sample = samples(i); e(i).value = []; e(i).offset = 0; e(i).duration = 1; end cfg.event = e; cfg = ft_databrowser(cfg, data); in which the trl matrix I use has samples of events at column 2, 5, 8, and 10, and the first column has the start of the trial in samples. Also, each trial takes 12 seconds at sampling rate 600 Hz. For trials of unequal length, you need to do a bit better bookkeeping on the assumption that fieldtrip treats epoched data as continuous data from the same recording. Hope this helps! Cheers, Anne --- Anne E. Urai, MSc PhD student | Institute for Neuro- and Pathophysiology | University Medical Center Hamburg-Eppendorf | Hamburg, Germany | anneurai.wordpress.com On 14 Mar 2014, at 14:11, Jörn M. Horschig wrote: > Heyho, > > yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) > Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. > If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! > > Best, > Jörn > > > On 3/14/2014 1:52 PM, Phyllis Mania wrote: >> >> Dear Eelke, >> >> Calling ‘rmfield’ helped, thank you! >> >> Cheers, >> >> Phyllis >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Oct 21 14:32:02 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 21 Oct 2014 14:32:02 +0200 Subject: [FieldTrip] Units for clusterplots Message-ID: Dear all, I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Tue Oct 21 15:05:59 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 21 Oct 2014 15:05:59 +0200 Subject: [FieldTrip] Units for clusterplots In-Reply-To: References: Message-ID: <23FF97F7-1C48-4E1E-A8AB-1EAC06C873A2@uni-konstanz.de> Dear Hweeling, it depends on the configuration you’d specify by cfg.parameter. I assume you didn’t specify anything so that in this case ft_clusterplot defaults to parameter ’stat’ with unit t-values. best tzvetan > Dear all, > I've got a question regarding the units of the topographical map of the results of the nonparametric cluster based statistics. I've searched everywhere but i cannot find the information. Can anyone please tell me what is the units for the colourbar when i set cfg.zlim for the topographical map of the nonparametric cluster based statistics? > Thanks. > Cheers, > Hweeling > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Tue Oct 21 15:57:43 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 13:57:43 +0000 Subject: [FieldTrip] no coil pos for planar combined data Message-ID: Hi all, I am having problems using ft_sourceanalysis with planar gradiometer data. I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow Using planar gradiometer data is mentioned in the tutorial, although not in detail. My problem: The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. I get the error: Reference to non-existent field 'avg'. I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. Any suggestions? If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. Is that possible? Thanks in advance! (and thank you to all previous very helpful responses on this list). Kaelasha Tyler PhD Candidate Brain and Psychological Science Research Centre Swinburne University of Technology Melbourne Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 21 17:05:07 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 21 Oct 2014 17:05:07 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > From ktyler at swin.edu.au Tue Oct 21 18:58:57 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 21 Oct 2014 16:58:57 +0000 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: , Message-ID: Hi Eelke, Partly I was just following the tutorials suggestion. I am using a Neuromag system. Up until now I have been working primarily with the magnetometers. I was interested in what difference I would find with data from the planar gradiometers. I had understood that planar gradiometer sensor pairs measure planar magnetic fields perpendicular to each other, at a similar point near the scalp. That being the case, I would have thought that using original planar gradiometer data in source analysis without combining it would produce in nonsensical results. Wouldn't source data at one grid point would then be incongruously trying to represent two different sets of information? Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Wednesday, 22 October 2014 2:05 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] no coil pos for planar combined data Hi Kaelasha, Why do you want to do source analysis on combined planar gradiometer data? In general, I would say this does not make sense. Instead, I would use the original (axial or planar, depending on your system) gradiometer data. Best, Eelke On 21 October 2014 15:57, Kaelasha Tyler wrote: > Hi all, > > I am having problems using ft_sourceanalysis with planar gradiometer data. > > I am following a tutorial for beamforming with lcmv method (which I believe is a work in progress) found here: > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > Using planar gradiometer data is mentioned in the tutorial, although not in detail. > > My problem: > The .avg field produced by time locking, is lost when combining planar gradiometers using 'ft_combineplanar'. > In this case, I am unable to to use 'ft_sourceanalysis' on combined planar gradiometer data. > I get the error: Reference to non-existent field 'avg'. > > I reasoned that I may be able to keep the .avg filed if I combine the planar gradiometer data at the outset, prior to timelocking. But in this case, the gradiometer positions in data.grad does not include 'coilpos'. Eg, no data.grad.coilpos. > When calling 'ft_sourceanalysis' in this case, I get the error: Reference to non-existent field 'coilpos'. > > Any suggestions? > > If the .grad.coilpos was retained when I combined the planar gradiometer data at the outset, (after preprocessesing and prior to timelokcing) then I would be able to use ft_sourceanalysis on planar gradiometer combined data successfully. > Is that possible? > > Thanks in advance! (and thank you to all previous very helpful responses on this list). > > Kaelasha Tyler > > PhD Candidate > Brain and Psychological Science Research Centre > Swinburne University of Technology > Melbourne > Australia > > > > > > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From joramvandriel at gmail.com Tue Oct 21 21:25:55 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Tue, 21 Oct 2014 21:25:55 +0200 Subject: [FieldTrip] no coil pos for planar combined data In-Reply-To: References: Message-ID: Hi Kaelasha, I believe (but I might be wrong), that you can use all three sensor types for Neuromag data (so the uncombined gradiometers *and* the magnetometers) with lcmv beamforming. That is, the weights (filters) of each voxel are computed based on covariance between sensors. Even if the different sensor types catch different aspects of the magnetic field, they probably covary as a function of, e.g., a stimulus, a cognitive process, or any underlying brain process. So in that sense, the more data, the better the source estimate, so why not use all 306 sensors? At least this worked for me and gave very sensible results. Maybe other fieldtrip users who use Neuromag data for beamforming can comment on this? - Joram On Tue, Oct 21, 2014 at 6:58 PM, Kaelasha Tyler wrote: > Hi Eelke, > > Partly I was just following the tutorials suggestion. > I am using a Neuromag system. Up until now I have been working primarily > with the magnetometers. > I was interested in what difference I would find with data from the planar > gradiometers. > > I had understood that planar gradiometer sensor pairs measure planar > magnetic fields perpendicular to each other, at a similar point near the > scalp. That being the case, I would have thought that using original planar > gradiometer data in source analysis without combining it would produce in > nonsensical results. Wouldn't source data at one grid point would then be > incongruously trying to represent two different sets of information? > > Kaelasha > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] > on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] > Sent: Wednesday, 22 October 2014 2:05 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] no coil pos for planar combined data > > Hi Kaelasha, > > Why do you want to do source analysis on combined planar gradiometer > data? In general, I would say this does not make sense. Instead, I > would use the original (axial or planar, depending on your system) > gradiometer data. > > Best, > Eelke > > On 21 October 2014 15:57, Kaelasha Tyler wrote: > > Hi all, > > > > I am having problems using ft_sourceanalysis with planar gradiometer > data. > > > > I am following a tutorial for beamforming with lcmv method (which I > believe is a work in progress) found here: > > > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > > Using planar gradiometer data is mentioned in the tutorial, although not > in detail. > > > > My problem: > > The .avg field produced by time locking, is lost when combining planar > gradiometers using 'ft_combineplanar'. > > In this case, I am unable to to use 'ft_sourceanalysis' on combined > planar gradiometer data. > > I get the error: Reference to non-existent field 'avg'. > > > > I reasoned that I may be able to keep the .avg filed if I combine the > planar gradiometer data at the outset, prior to timelocking. But in this > case, the gradiometer positions in data.grad does not include 'coilpos'. > Eg, no data.grad.coilpos. > > When calling 'ft_sourceanalysis' in this case, I get the error: > Reference to non-existent field 'coilpos'. > > > > Any suggestions? > > > > If the .grad.coilpos was retained when I combined the planar gradiometer > data at the outset, (after preprocessesing and prior to timelokcing) then I > would be able to use ft_sourceanalysis on planar gradiometer combined data > successfully. > > Is that possible? > > > > Thanks in advance! (and thank you to all previous very helpful responses > on this list). > > > > Kaelasha Tyler > > > > PhD Candidate > > Brain and Psychological Science Research Centre > > Swinburne University of Technology > > Melbourne > > Australia > > > > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Wed Oct 22 10:51:58 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Wed, 22 Oct 2014 08:51:58 +0000 Subject: [FieldTrip] =?windows-1252?q?Weird_repetition_trails=85=2E_=28=2E?= =?windows-1252?q?cnt_files=29?= Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB50EE@UWMBX01.uw.lu.se> Dear fieldtripers, I am having problems for fieldtrip to read the .cnt neuroscan files. I noticed that, when I am plotting my trials (using ft_databrower), I get trials that are exactly the same. The data in each sample of that trial, for each channel, looks exactly the same! I don’t really know the reason for this and I have tried and checked different things: 1. My trl matrix is properly defined. It could be that the same sample numbers were used for extracting different trial numbers, but that is not the case. 2. Using curry to visualize the data showed that there is nothing wrong while converting my .dat into a .cnt file. 3. I notice that fieldtrip is using the loadcnt function from eeglab. For this reason I used eeglab to read the data. When I plot the trials using eeglab I don’t find these weird trials repetitions. 4. The trials that are repeated do not seem to be real (when I look into those trials repetitions using both with curry and eeglab the trials are completely different from what fieldtrip give me). Besides those weird repetitions or the other trials seems to match. 5. I do not get more trials then what I am asking for. My trl matrix has 312 rows and I get 312 trials. So those repeated trials are replacing some relevant information… 6. The data in each sample of those trials are the same, but the triggers are different. If I would continue with data analysis exactly the same trial would be latter classified as belonging to different experimental conditions. 7. Importantly while I am extracting the trials from the data using ft_preprocessing I get a warning message saying “events imported with a time shift might be innacurate”. 8. I am using the most recent version of fieldtrip (fieldtrip-20141021) Do you have any idea of what can be going on? I have been using fieldtrip before (.bdf files) and I never had this problem… Also, a colleague of mine is having the same exactly problem… Thank you very much in advance! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Wed Oct 22 12:09:44 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 22 Oct 2014 12:09:44 +0200 (CEST) Subject: [FieldTrip] source plot with cfg.method = 'ortho' slows down computer Message-ID: <1407267660.3560510.1413972584299.JavaMail.root@bcbl.eu> Dear all, I was wondering if anyone has experienced as similar problem when using ft_sourceplot. My cfg structure looks like this: cfg = []; cfg.funparameter = 'statmask'; cfg.method = 'ortho'; cfg.interactive = 'yes'; ft_sourceplot(cfg,Stats); The graphic takes a really long time (>30 sec) to discplay and when I reposition the cursor it takes a really long time to update the figure (>30 sec). I suspect the problem to be related to changes in the function as I haven't experienced these difficulties in the past. Could it be that there may be some graphical rendering issues responsible here? Hoping that someone can provide me with any hints, as data-visualization is being really sluggish and frustrating right now. Best, Fred --------------------------------------------------------------------------- From r.oostenveld at donders.ru.nl Wed Oct 22 15:24:03 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 22 Oct 2014 15:24:03 +0200 Subject: [FieldTrip] FTP fully working again References: <1413977946.863096.220074797.33689.14@otrs.dccn.nl> Message-ID: <29D3A1A1-69C3-4A4F-9A00-E348A8EEA064@donders.ru.nl> Dear all, Following the troubled network upgrade, there have been about two weeks in with our FTP service was not fully accessible. I just received notice that it has been restored and that all FTP clients should again work. best regards, Robert Begin forwarded message: > The DCCN ftp-server is now running like expected. Our network department changed the firewall rulesets so it's no longer necessary to change ftp-clients to active transfer mode. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ines.bramao at psy.lu.se Thu Oct 23 16:02:39 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Thu, 23 Oct 2014 14:02:39 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CB5205@UWMBX01.uw.lu.se> Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here: https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 24 13:04:40 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 24 Oct 2014 11:04:40 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Message-ID: Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ines.bramao at psy.lu.se Fri Oct 24 13:47:10 2014 From: ines.bramao at psy.lu.se (Ines Bramao) Date: Fri, 24 Oct 2014 11:47:10 +0000 Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files In-Reply-To: References: Message-ID: <22727360DFD3FA48A095EA1B9C6DF43413CBC7CF@UWMBX01.uw.lu.se> Dear Jan-Mathijs, Thank you very very much for looking into this issue! I will create the account at the bugzilla.fcdonders in order to follow up this. Please tell me if I can help in some other way (for example, provinding you more data). Best wishes, Inês ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Lam, N.H.L. (Nietzsche) [n.lam at fcdonders.ru.nl] Sent: 24 October 2014 13:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Problem using ft_preprocessing to segment .cnt files Hi Ines, I just tried to reproduce your issue, and I can confirm the ‘repetition’ issue. With some debugging I found out that occasionally the fseek on line 364 in loadcnt fails, which results in the file pointer not being adjusted to the correct location in the file. As a consequence a fixed chunk of data is read, which I assume results in the repetition of the segments. The cause of this fseek failure seems to lie in the fact that the ‘startpos’ variable on line 364 is non-integer. This is a bit strange, because this variable is created in line 339, by a multiplication of r.t1 with h.rate (and some other things), while r.t1 is created a few lines above by a division of r.sample1 (which is an integer sample number) with h.rate. I suspect there is something going wrong with the finite numerical precision that causes c=a/b followed by b*c not to yield exactly a. I am a bit intrigued by the fact that using eeglab for segmentation works for you, but it could be that loadcnt is used in a! slightly different way in there. For now I don’t know a solution yet, but I will file a bug on our bugzilla.fcdonders.nl website so that we can follow this up. I suggest that you create an account there so that you can be kept in the loop with respect to the resolution of this issue. Best wishes, Jan-Mathijs On Oct 23, 2014, at 4:02 PM, Ines Bramao > wrote: Hi all, When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files. I have been checking and trying different things: 1) My trl matrix seems to be properly defined; 2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments; 3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different! 4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same); 5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem. Here is the configuration that I am using to run ft_preprocessing cfg = dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt' dataformat: 'ns_cnt32' headerformat: 'ns_cnt32' eventformat: 'ns_cnt32' demean: 'yes' baselinewindow: [0 0.2000] reref: 'yes' refchannel: {'A1' 'A2'} implicitref: {'A1'} channel: {'all' '-A1' '-TP9' '-TP10' '-FT10' '-FT9' '-Trigger'} trl: [312x5 double] Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!! repeatedtrials =[]; for i = 1:length(PreProcArtifact_cue.trial) for j = 1:length(PreProcArtifact_cue.trial) if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j} if i ~= j repeatedtrials(1+end,:) = [i j]; end end end end I uploaded my original data file, my trl matrix and the output of the preprocessing here:https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0 Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case???? Thank you very very much! Inês Bramão _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From fab.rotondi at gmail.com Fri Oct 24 16:58:26 2014 From: fab.rotondi at gmail.com (fabio rotondi) Date: Fri, 24 Oct 2014 16:58:26 +0200 Subject: [FieldTrip] LCMV time series reconstruction under multiple conditions (cov matrix problem) Message-ID: Dear Fieldtrip community, my name's Fabio and I'm currently investigating on MEG/EEG connectivity in source space. I'm dealing with a theoretical concern, related to the estimation of virtual electrodes' time series for resting state EEG data (128 channels, 512 Hz sampling frequency) under 3 conditions. For each subject, the recording protocol consists of three consecutive steps: 1 minute of resting with eyes closed (EC), 1 minute resting EC with auditory stimulation n.1, 1 minute resting EC with auditory stimulation n.2. The final aim is to estimate functional connectivity changes in source space under these conditions. My question regards the computation of the covariance matrix: in order to do this I identified 2 possible ways to proceed: 1. compute covariance matrix giving the whole 3-minute signal to ft_timelockanalysis, and then use this matrix to invert separately each of the three conditions; 2. compute a covariance matrix separately for each of the three conditions (thus on 60 seconds) and then invert each condition by using its respective covariance matrix. As far as I know, solution n.1 is in literature the most used. I think it is the solution named as "common filters", which assumes that there are the same signal generators differently active in the three different conditions. This assumption could not be valid in principle for my experiment, but I was wondering if computing three different covariance matrices could introduce any other bias. Thank you so much for your help, Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Sun Oct 26 09:34:11 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Message-ID: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Oct 26 10:32:58 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 26 Oct 2014 10:32:58 +0100 Subject: [FieldTrip] topoplot - no match between data and layout In-Reply-To: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> References: <3A4A4EE7-68D6-48FE-85AA-5980F45BC2DC@live.ucl.ac.uk> Message-ID: Hello,If the number of channels of your data and layout are not the same, there will be error. The alphabetical case is very important, like sometime your data label may be FCZ while the layout is FCz, you need to check that. Meanwhile, to avoid any error, the best option is to design your own layout base on your data as explained in detail in this tutorial http://fieldtrip.fcdonders.nl/tutorial/layoutGood luck! Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" From: e.caspar at ucl.ac.uk To: fieldtrip at science.ru.nl Date: Sun, 26 Oct 2014 08:34:11 +0000 Subject: [FieldTrip] topoplot - no match between data and layout Dear Fieldtripers, I am trying to represent my data on a topoplotER. I have averaged all my data with the label "GAshortwm": GAshortwm = ft_timelockgrandaverage(cfg, avgs{:}); cfg = []; cfg.xlim = [-2 1]; cfg.zlim = [-10 10]; cfg.layout = 'biosemi64.lay'; ft_topoplotER(cfg,GAshortwm); colorbar; However, I have a recurrent mistake which is only present with this type of plot, not with other plots like single plot: Error using topoplot_common (line 561) labels in data and labels in layout do not match Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); I'm sure of the layout I'm using (biosemi 64), and I already checked that this layout is detected within my script. Consequently, I don't understand why there is no match between my data and the layout. I though it was because name of the labels are from 1 to 66 in data files, but it's probably not the reason because it works very well with single plot. Does anyone have an idea? Thank you! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Oct 28 09:15:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 28 Oct 2014 09:15:12 +0100 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From dylan.delosangeles at gmail.com Tue Oct 28 13:21:32 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Tue, 28 Oct 2014 22:51:32 +1030 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak wrote: > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one > unit-of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles > > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of two > or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up with > a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes > x 3 frequencies x 2049 time points, rather than one struct with a 4D > powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config > > time = EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis > > cfg = []; % clear cfg > > cfg.output = 'pow'; > > cfg.channel = 'EEG'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 0.5:3; % delta > > cfg.toi = 1:0.05:time; % length of each state > > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); > > end > > end > > end > > > > My second problem is loading in the second group of 12 subjects and what > that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous email, > that I should be using indepsamplesF for more than two conditions (I have > 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 > 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 > 7 7 8 8 9 9 10 10 11 11 (11 > conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two groups > > of observations, and not to the same group of observations measured in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) cell > > arrays, corresponding to the conditions, you can input them into the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > time-frequency > >> data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > trials) and > >> the two experimental designs (between- and within-UO), the tutorial > covers > >> statistics on data in two conditions in a between-trials, in a > within-trials > >> and in a within-subjects design. However, I am wondering if there is any > >> information about the fourth type of experiment design: > between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both groups are > >> measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > (multiple > >> subjects in multiple experimental conditions), such that my design is > >> multiple groups in multiple experimental conditions. Is it a case of > first > >> averaging over all trials belonging to each of the experimental > conditions > >> for each subject (as instructed in tutorial), and then averaging over > all > >> subjects in each group? > >> > >> Configuration code for setting up the design currently looks like this; > >> grp = 2; > >> subj = 11; > >> design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when doing > these > >> statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 19:16:19 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 14:16:19 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions Message-ID: Hi, So this is not a specific method-based question, but something more general. I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. *So boiling it down**, my questions are:* 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? 2. If it cannot be used this way, what situations is it meant for? -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 20:05:33 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 15:05:33 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. Hopefully someone else has something to add, or if I'm missing any stuff. Best Rodrigo On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > Hi, > > So this is not a specific method-based question, but something more > general. > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert > (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do > this in a more efficient and fieldtrip-compatible way. It seems I can use > this setting to get the analytic signal, phase, power, and other things, > but since this is on raw/epoched data, there is no obvious way I can think > of to apply a time or frequency series as in the other TFRs. It seems I > could either write a fieldtrip function from scratch, which I'm not > prepared to do, or write a function to reformat fieldtrip data to work > using the Cohen function, and then output it back into a fieldtrip > function, which would be fine but I'm more interested to know if the > ft_preproc_hilbert function can do what I want more efficiently. > > *So boiling it down**, my questions are:* > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 20:48:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 15:48:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From orionblue8 at gmail.com Tue Oct 28 20:54:14 2014 From: orionblue8 at gmail.com (Orion) Date: Tue, 28 Oct 2014 15:54:14 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hi Max, Can you clarify what you mean by a Hilbert time-frequency analysis? Performing hilbert on a signal will give several different outputs, like the envelope and phase, and if you want, the instantaneous frequency. But I don't understand the meaning of Hilbert time-frequency. There are ways of calculating hilbert that don't use fft, but as fars as I'm aware, the hilbert.m that calls fft.m provides a quick way to the desired outputs. Orion On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: > >> Hi, >> >> So this is not a specific method-based question, but something more >> general. >> >> I've been slowly reading through bits and pieces of Mike Cohen's >> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >> understanding of how things like Fourier Transform, Wavelets, and Hilbert >> work on a more fundamental level. >> >> Fieldtrip does not have a built in Hilbert time frequency analysis (that >> I'm aware of), but from having read through that chapter of Cohen's book >> I've been able to effectively create a hilbert analysis of my own. >> >> However, I was wondering if it would be possible to use >> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >> way. It seems I can use this setting to get the analytic signal, phase, >> power, and other things, but since this is on raw/epoched data, there is no >> obvious way I can think of to apply a time or frequency series as in the >> other TFRs. It seems I could either write a fieldtrip function from >> scratch, which I'm not prepared to do, or write a function to reformat >> fieldtrip data to work using the Cohen function, and then output it back >> into a fieldtrip function, which would be fine but I'm more interested to >> know if the ft_preproc_hilbert function can do what I want more efficiently. >> >> *So boiling it down**, my questions are:* >> >> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >> steps would one need to take? >> >> 2. If it cannot be used this way, what situations is it meant for? >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Tue Oct 28 21:42:37 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 28 Oct 2014 16:42:37 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: Hm, let me see if I can articulate this properly (I may be a bit rusty with this, so this is as much a review for me as it is an attempt to explain it to anyone else). The Hilbert Transform itself provides the analytic signal, as Sr (the real part, or cosine) and Si (the imaginary part, or sine, which is 90 degrees from the Sr). This can be used to determine things like, as you mentioned, phase, envelope, instantaneous frequency, and power. If a TFR (or at least a power spectrum from a TFR) is the power at sensor x frequency x time, the data structure output from ft_preprocessing is itself not able to give us a TFR; we have to do an FFT or wavelet analysis to get the necessary data matrix, but you can also use Hilbert. I know, from a computational standpoint, how to go from point A to point B here for both wavelet and hilbert, but I'm struggling to articulate it in real words, which means I probably need to do some rereading. However, the point is that you can use Hilbert to get a nearly identical, albeit computationally quite different, time frequency representation as you can with wavelet analysis. I have some code to do both wavelet and hilbert on a sample EEGlab dataset. The sample data comes from the Cohen book, and even though I wrote the code myself, it is based on example code Cohen provides with the book, so unfortunately I'm not sure if it's ethical to share it, but that would hopefully clarify what I mean. That being said, I should be able to articulate it better myself. If anybody thinks they can explain what I'm talking about better I would greatly appreciate it, otherwise I might have to come back to you after I've done some rereading. On Tue, Oct 28, 2014 at 3:54 PM, Orion wrote: > Hi Max, > > Can you clarify what you mean by a Hilbert time-frequency analysis? > Performing hilbert on a signal will give several different outputs, like > the envelope and phase, and if you want, the instantaneous frequency. But > I don't understand the meaning of Hilbert time-frequency. > > There are ways of calculating hilbert that don't use fft, but as fars as > I'm aware, the hilbert.m that calls fft.m provides a quick way to the > desired outputs. > > Orion > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Tue Oct 28 21:50:36 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 28 Oct 2014 16:50:36 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: Message-ID: To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. Best On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > >> Hi Max, >> >> to what I understand, the output of Hilbert will be the amplitude of the >> input signal (envelope). If you want to use that information, then the only >> step you should add before is a very good and sweet narrow band filter (as >> narrow as you want your frequency bins). Then, the filter design is the >> hard part, because you need a filter that is able to filter out other >> frequencies without introducing any kind of artifact. >> >> Hopefully someone else has something to add, or if I'm missing any stuff. >> >> Best >> >> Rodrigo >> >> On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor wrote: >> >>> Hi, >>> >>> So this is not a specific method-based question, but something more >>> general. >>> >>> I've been slowly reading through bits and pieces of Mike Cohen's >>> 'Analyzing Neural Time Series Data' book, in an attempt to gain a better >>> understanding of how things like Fourier Transform, Wavelets, and Hilbert >>> work on a more fundamental level. >>> >>> Fieldtrip does not have a built in Hilbert time frequency analysis (that >>> I'm aware of), but from having read through that chapter of Cohen's book >>> I've been able to effectively create a hilbert analysis of my own. >>> >>> However, I was wondering if it would be possible to use >>> ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in >>> ft_preprocessing) to do this in a more efficient and fieldtrip-compatible >>> way. It seems I can use this setting to get the analytic signal, phase, >>> power, and other things, but since this is on raw/epoched data, there is no >>> obvious way I can think of to apply a time or frequency series as in the >>> other TFRs. It seems I could either write a fieldtrip function from >>> scratch, which I'm not prepared to do, or write a function to reformat >>> fieldtrip data to work using the Cohen function, and then output it back >>> into a fieldtrip function, which would be fine but I'm more interested to >>> know if the ft_preproc_hilbert function can do what I want more efficiently. >>> >>> *So boiling it down**, my questions are:* >>> >>> 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert >>> called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc >>> steps would one need to take? >>> >>> 2. If it cannot be used this way, what situations is it meant for? >>> >>> -- >>> Max Cantor >>> Lab Manager >>> Computational Neurolinguistics Lab >>> University of Michigan >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Oct 29 08:26:29 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 29 Oct 2014 08:26:29 +0100 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: Dear all, The following paper by Andreas Bruns might offer some highly relevant background: Bruns (2004) J Neurosci Meth Fourier-, Hilbert- and wavelet-based signal analysis: are they really different approaches? http://www.sciencedirect.com/science/article/pii/S0165027004001098 Best, Eelke On 28 October 2014 21:50, Rodrigo Montefusco wrote: > To where I understand, yes. Just remember that is amplitude and not power (you probably knew that). I should remark that the filter part is tricky and critical. > > Best > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor > wrote: > Ah, so if I do a narrow BP filter around a single frequency, looped over however many frequencies I want, and then restructure the looped data into a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, I could effectively turn it into a TFR? > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco > wrote: > Hi Max, > > to what I understand, the output of Hilbert will be the amplitude of the input signal (envelope). If you want to use that information, then the only step you should add before is a very good and sweet narrow band filter (as narrow as you want your frequency bins). Then, the filter design is the hard part, because you need a filter that is able to filter out other frequencies without introducing any kind of artifact. > > Hopefully someone else has something to add, or if I'm missing any stuff. > > Best > > Rodrigo > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor > wrote: > Hi, > > So this is not a specific method-based question, but something more general. > > I've been slowly reading through bits and pieces of Mike Cohen's 'Analyzing Neural Time Series Data' book, in an attempt to gain a better understanding of how things like Fourier Transform, Wavelets, and Hilbert work on a more fundamental level. > > Fieldtrip does not have a built in Hilbert time frequency analysis (that I'm aware of), but from having read through that chapter of Cohen's book I've been able to effectively create a hilbert analysis of my own. > > However, I was wondering if it would be possible to use ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in ft_preprocessing) to do this in a more efficient and fieldtrip-compatible way. It seems I can use this setting to get the analytic signal, phase, power, and other things, but since this is on raw/epoched data, there is no obvious way I can think of to apply a time or frequency series as in the other TFRs. It seems I could either write a fieldtrip function from scratch, which I'm not prepared to do, or write a function to reformat fieldtrip data to work using the Cohen function, and then output it back into a fieldtrip function, which would be fine but I'm more interested to know if the ft_preproc_hilbert function can do what I want more efficiently. > > So boiling it down, my questions are: > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc steps would one need to take? > > 2. If it cannot be used this way, what situations is it meant for? > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From mcantor at umich.edu Wed Oct 29 14:40:03 2014 From: mcantor at umich.edu (Max Cantor) Date: Wed, 29 Oct 2014 09:40:03 -0400 Subject: [FieldTrip] ft_preproc_hilbert questions In-Reply-To: References: <6ccef4f5405c479bbaeb8d5ce8a357b9@EXPRD03.hosting.ru.nl> Message-ID: I will definitely need to read this, thank you! I am familiar with some of the differences between Wavelets and Hilbert, such as Wavelet filter kernel always being Gaussian whereas Hilbert can be varied, and Wavelets being somewhat more computationally efficient, but I was also under the impression that they are not fundamentally different. This discussion is actually something I've been having with a small group here at University of Michigan so this article may help clarify more details for us. On Wed, Oct 29, 2014 at 3:26 AM, Eelke Spaak wrote: > Dear all, > > The following paper by Andreas Bruns might offer some highly relevant > background: > > Bruns (2004) J Neurosci Meth > Fourier-, Hilbert- and wavelet-based signal analysis: are they really > different approaches? > http://www.sciencedirect.com/science/article/pii/S0165027004001098 > > Best, > Eelke > > On 28 October 2014 21:50, Rodrigo Montefusco > wrote: > > To where I understand, yes. Just remember that is amplitude and not > power (you probably knew that). I should remark that the filter part is > tricky and critical. > > > > Best > > > > On Tue, Oct 28, 2014 at 3:48 PM, Max Cantor mcantor at umich.edu>> wrote: > > Ah, so if I do a narrow BP filter around a single frequency, looped over > however many frequencies I want, and then restructure the looped data into > a dimensionally similar matrix as powspctrm in a fieldtrip-type structure, > I could effectively turn it into a TFR? > > > > On Tue, Oct 28, 2014 at 3:05 PM, Rodrigo Montefusco < > rmontefusco at med.uchile.cl> wrote: > > Hi Max, > > > > to what I understand, the output of Hilbert will be the amplitude of the > input signal (envelope). If you want to use that information, then the only > step you should add before is a very good and sweet narrow band filter (as > narrow as you want your frequency bins). Then, the filter design is the > hard part, because you need a filter that is able to filter out other > frequencies without introducing any kind of artifact. > > > > Hopefully someone else has something to add, or if I'm missing any stuff. > > > > Best > > > > Rodrigo > > > > On Tue, Oct 28, 2014 at 2:16 PM, Max Cantor mcantor at umich.edu>> wrote: > > Hi, > > > > So this is not a specific method-based question, but something more > general. > > > > I've been slowly reading through bits and pieces of Mike Cohen's > 'Analyzing Neural Time Series Data' book, in an attempt to gain a better > understanding of how things like Fourier Transform, Wavelets, and Hilbert > work on a more fundamental level. > > > > Fieldtrip does not have a built in Hilbert time frequency analysis (that > I'm aware of), but from having read through that chapter of Cohen's book > I've been able to effectively create a hilbert analysis of my own. > > > > However, I was wondering if it would be possible to use > ft_preproc_hilbert (setting cfg.hilbert = 'complex', 'real', etc. in > ft_preprocessing) to do this in a more efficient and fieldtrip-compatible > way. It seems I can use this setting to get the analytic signal, phase, > power, and other things, but since this is on raw/epoched data, there is no > obvious way I can think of to apply a time or frequency series as in the > other TFRs. It seems I could either write a fieldtrip function from > scratch, which I'm not prepared to do, or write a function to reformat > fieldtrip data to work using the Cohen function, and then output it back > into a fieldtrip function, which would be fine but I'm more interested to > know if the ft_preproc_hilbert function can do what I want more efficiently. > > > > So boiling it down, my questions are: > > > > 1. Can cfg.hilbert parameter for ft_preprocessing (or ft_preproc_hilbert > called directly) be used as an ad hoc hilbert TFR, and if so what ad hoc > steps would one need to take? > > > > 2. If it cannot be used this way, what situations is it meant for? > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexander_Nakhnikian at hms.harvard.edu Wed Oct 29 18:19:51 2014 From: Alexander_Nakhnikian at hms.harvard.edu (Nakhnikian, Alexander) Date: Wed, 29 Oct 2014 13:19:51 -0400 Subject: [FieldTrip] Cross-Spectral Input to ft_eloreta Message-ID: <574C31932EBF144DB111B356E91DEC2D014A3BE40CC7@ITCCRMAIL01.MED.HARVARD.EDU> Hello, I'm trying to perform source analysis on an EEG data set using ft_eloreta. I've set up the analysis using the dipole and volume conduction models included in fieldtrip. I want to perform the analysis in frequency space, which means I need to enter a cross-spectral matrix for the variable Cf. The cross-spectral matrix returned by ft_freqanalysis doesn't work. ft_eloreta runs into trouble on line 163 "csd = dip.filter{i}*Cf*dip.filter{i}' " where Cf is the cross-spectral density matrix returned by ft_freqanalysis. This matrix has many rows and its number of columns is equal to the number of frequencies analyzed. The row number is (numChannels*(numChannels-1))^2/2, so it's assigning a row index to each pair-wise combination of channels, ignoring complex conjugate pairs and autospectra. The problem is that dip.filter{i} has dimensionality 3 x numChannels, which means Cf must be a numChannels x numChannels matrix to make the linear algebra work out. Is there a program in fieldtrip that returns a square cross-spectral density matrix for the frequencies of interest? Are there methods papers by Pascual-Marqui or others that deal with how to construct the cross-spectral matrix? I am new both to fieldtrip and to eLORETA so any advice would be greatly appreciated. Thanks in advance, Alexander Nakhnikian From joseangel.pineda at ctb.upm.es Thu Oct 30 16:44:34 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:44:34 +0100 Subject: [FieldTrip] Fwd: In-Reply-To: References: Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseangel.pineda at ctb.upm.es Thu Oct 30 16:46:23 2014 From: joseangel.pineda at ctb.upm.es (=?UTF-8?Q?Jos=C3=A9_=C3=81ngel_Pineda?=) Date: Thu, 30 Oct 2014 16:46:23 +0100 Subject: [FieldTrip] Senior Researcher position in Madrid, Spain Message-ID: Notification of the “Isaac Peral” Program to contract one senior researcher associated with BBVA Foundation-UPM Industry-Academia chairs for scientific-technological research in Medical Imaging, within Marie Curie Action COFUND. This notice provides for a maximum of one position in the area of scientific-technological initiatives in Biotech indicated below, in accordance with the procedure established in the Regulatory Bases of 30 April 2009 for the ISAAC PERAL Program for Senior UPM Researchers (in the attached document). The candidate degree may be from any specialization in Engineering, Physics, Mathematics, Statistics, Biology, Biochemistry, etc. Location: The activities will be carried out in the Campus of International Excellence: Campus of Montegancedo at the CTB: Centre for Biomedical Technology (www.ctb.upm.es), in Madrid, Spain. Beneficiaries: 1. Have held a PhD for more than 10 years, effectively pursuing uninterrupted research activity during that time. 2. Have extensive research experience in the sphere of the profile of the contract announced, i.e. biomedical imaging. 3. Have pursued their research activity following the award of their PhD in relevant foreign Research Centers for at least six years or have studied the whole of the PhD and graduated in a foreign University or Research Centre and have pursued subsequent research activity in a relevant foreign research center for at least three years. 4. Have certified experience in the management of research groups in university institutions or relevant research centers. All the requirements demanded and the merits argued by candidates must have been fulfilled prior to the date of termination of the period for the submission of applications. Conditions of the position: 1. Gross remuneration shall not be less than 80000 € nor more than 90000 € per year. 2. Three year contracts for two young PhDs 3. Three positions for PhD studies (four years) 4. A 30000 € support for the Senior researcher during the first year of contract to facilitate the start of the research activities 5. A minimum of 100m2 space available in the Centre for Biomedical Technology N.B.: All the the details of the call can be consulted at the following link: *http://www.upm.es/sfs/Rectorado/Vicerrectorado%20de%20Investigacion/Servicio%20de%20Investigacion/Ayudas_y_Convocatorias/Convocatorias_Propias/Convocatoria-MedImaging-Eng.pdf * Interested candidates should send CV to the following email address francisco.delpozo at ctb.upm.es. [image: http://www.upm.es/sfs/Montegancedo/Noticias/imagenes/ctb.gif] Prof. Francisco del Pozo Director Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES Tfo: +34 913364632 (Tfo: +34 913364631) www.ctb.upm.es -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Thu Oct 30 19:10:35 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Thu, 30 Oct 2014 19:10:35 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Fieldtripers! I have data collected with Neuroscan 32 channels quickcap (1020 standard). There is no template layout for it so I tried to create it myself and had to use Robert Oostenveld's help to succeed (please, see http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). So now I have a nice layout. I have checked it with cfg = []; cfg.layout = 'quickcap32.lay' ft_layoutplot(cfg) And I have created a .mat file out of it with layout = ft_prepare_layout(cfg) save quickcap32.mat layout And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): templates_dir = 'D:/My Documents/MATLAB/template/layout/' load([templates_dir 'quickcap32.mat']); cfg = []; cfg.layout = lay; ... I get this *Undefined function or variable 'lay'* message. What am I doing wrong? Any tips will be GREATLY appreciated! Kind regards, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Thu Oct 30 19:37:31 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Thu, 30 Oct 2014 14:37:31 -0400 Subject: [FieldTrip] Undefined function or variable 'lay' In-Reply-To: References: Message-ID: Yanina, It looks like your layout variable is called "layout", but your cfg.layout is looking for a variable called "lay". The variable "lay" variable doesn't exist, but I bet "layout" does :-) Best, Raquel On Thu, Oct 30, 2014 at 2:10 PM, Yanina Prystauka wrote: > Dear Fieldtripers! > > I have data collected with Neuroscan 32 channels quickcap (1020 > standard). There is no template layout for it so I tried to create it > myself and had to use Robert Oostenveld's help to succeed (please, see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2740). > > So now I have a nice layout. I have checked it with > > cfg = []; > cfg.layout = 'quickcap32.lay' > ft_layoutplot(cfg) > > And I have created a .mat file out of it with > > layout = ft_prepare_layout(cfg) > > save quickcap32.mat layout > > And according to the tutorial on Fieldtrip Donders website this .mat file should contain variable 'lay'. But now whenever I try to use the 'lay' variable for whatever purposes (e.g. plotting): > > templates_dir = 'D:/My Documents/MATLAB/template/layout/' > > load([templates_dir 'quickcap32.mat']); > > cfg = []; > > cfg.layout = lay; > > ... I get this *Undefined function or variable 'lay'* message. > > What am I doing wrong? Any tips will be GREATLY appreciated! > > Kind regards, > > Yanina > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Fri Oct 31 13:19:18 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 12:19:18 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Oct 31 13:29:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 31 Oct 2014 13:29:30 +0100 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> References: <0c74cebd8e9047cbb2133f9e57afec17@EXPRD03.hosting.ru.nl> Message-ID: Dear Emma, I've not read your full post, but can say this about the latter part: fieldnames() should be a builtin MATLAB command. Most likely your version of MATLAB is too old; could you try using a more recent version? Typically we try to support versions up to 5 years old for use with FieldTrip. Hope that helps, Best, Eelke On 31 October 2014 13:19, Emma Holmes wrote: > Dear all, > > I am trying to perform spatio-temporal cluster statistics to the sources of > an EEG dataset, which I localised using the SPM8 toolbox. > For each participant (averaged across trials), I have a .nii image > containing the source reconstruction for each of two conditions at multiple > different time points. Each nifti file contains a matrix of 91 x 109 x 91, > which corresponds to the source estimates at each voxel. > My aim is to identify sources of activity that span large clusters of voxels > and/or time points, similar to what I have done previously with the scalp > data. > > I understand that the function 'ft_sourcestatistics' should be able to > achieve this with the data output from the function 'ft_sourcegrandaverage'. > However, I am having difficulty structuring the data from the nifti files in > a format that can be successfully input to 'ft_sourcegrandaverage'. > > The data that I am trying to input to 'ft_sourcegrandaverage' contains a > cell array of structures--one for each participant. > As far as I understand from the documentation, each structure should contain > a 'pos' field, which specifies the [x y z] co-ordinates for each position in > the matrix (in my case, a matrix of size 91*109*91 x 3). > I have also included a 'time' field, containing a vector of the time points > to which each .nii image corresponds and a 'dim' field containing the vector > [91 109 91]. > > Could you please let me know whether or not this is correct and in which > field(s) I should subsequently add the source reconstruction estimates at > each time point. > So far, I have tried including an 'avg' field with the data at each time > point (91 x 109 x 91 x ntps). > However, when I do so, I get the following error: > > ??? Undefined function or method 'fieldnames' for input arguments of type > 'double'. > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > Error in ==> ft_checkdata at 578 > param = setdiff(parameterselection('all', data), exclude); > > Error in ==> ft_sourcegrandaverage at 81 > varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, > 'feedback', 'no', > 'inside', 'logical', 'sourcerepresentation', 'new'); > > I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 > (although I have also tried other fieldtrip versions). > > Any help would be greatly appreciated. > > Best wishes, > Emma > From eh776 at york.ac.uk Fri Oct 31 14:45:04 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Fri, 31 Oct 2014 13:45:04 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Dear Eelke, Thanks for your comment--a relevant suggestion. However, the fieldnames() command is present in my version of MATLAB when I type "help fieldnames". Therefore, I suspect my problem arises not because the function is unavailable, but because the input to the function is incorrect. The documentation states that the input to fieldnames() should be a structure. However, if data.avg should be a structure, this seems to conflict with other fieldtrip data types involving data.avg. I suspect that I should not input the source matrix to the data.avg field. However, I am unsure into which field it should go... Is there anyone who could help me? Best, Emma On 31 October 2014 13:29, Eelke Spaak wrote: > Dear Emma, > > I've not read your full post, but can say this about the latter part: > fieldnames() should be a builtin MATLAB command. Most likely your > version of MATLAB is too old; could you try using a more recent > version? Typically we try to support versions up to 5 years old for > use with FieldTrip. > > Hope that helps, > Best, > Eelke On 31 October 2014 13:19, Emma Holmes > wrote: >* Dear all, *>>* I am trying to perform spatio-temporal cluster statistics to the sources of *>* an EEG dataset, which I localised using the SPM8 toolbox. *>* For each participant (averaged across trials), I have a .nii image *>* containing the source reconstruction for each of two conditions at multiple *>* different time points. Each nifti file contains a matrix of 91 x 109 x 91, *>* which corresponds to the source estimates at each voxel. *>* My aim is to identify sources of activity that span large clusters of voxels *>* and/or time points, similar to what I have done previously with the scalp *>* data. *>>* I understand that the function 'ft_sourcestatistics' should be able to *>* achieve this with the data output from the function 'ft_sourcegrandaverage'. *>* However, I am having difficulty structuring the data from the nifti files in *>* a format that can be successfully input to 'ft_sourcegrandaverage'. *>>* The data that I am trying to input to 'ft_sourcegrandaverage' contains a *>* cell array of structures--one for each participant. *>* As far as I understand from the documentation, each structure should contain *>* a 'pos' field, which specifies the [x y z] co-ordinates for each position in *>* the matrix (in my case, a matrix of size 91*109*91 x 3). *>* I have also included a 'time' field, containing a vector of the time points *>* to which each .nii image corresponds and a 'dim' field containing the vector *>* [91 109 91]. *>>* Could you please let me know whether or not this is correct and in which *>* field(s) I should subsequently add the source reconstruction estimates at *>* each time point. *>* So far, I have tried including an 'avg' field with the data at each time *>* point (91 x 109 x 91 x ntps). *>* However, when I do so, I get the following error: *>>* ??? Undefined function or method 'fieldnames' for input arguments of type *>* 'double'. *>>* Error in ==> parameterselection at 47 *>* tmp = fieldnames(data.avg); *>>* Error in ==> ft_checkdata at 578 *>* param = setdiff(parameterselection('all', data), exclude); *>>* Error in ==> ft_sourcegrandaverage at 81 *>* varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, *>* 'feedback', 'no', *>* 'inside', 'logical', 'sourcerepresentation', 'new'); *>>* I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 *>* (although I have also tried other fieldtrip versions). *>>* Any help would be greatly appreciated. *>>* Best wishes, *>* Emma* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ojoe4ki at gmail.com Fri Oct 31 16:28:59 2014 From: ojoe4ki at gmail.com (Yanina Prystauka) Date: Fri, 31 Oct 2014 16:28:59 +0100 Subject: [FieldTrip] Undefined function or variable 'lay' Message-ID: Dear Raquel, Thanks a lot for paying attention to my e-mail! I have messed up with the variables and didn't even notice, thanks for pointing that out! Good luck, Yanina -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Fri Oct 31 16:47:38 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Fri, 31 Oct 2014 16:47:38 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions Message-ID: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Oct 31 16:56:16 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 31 Oct 2014 16:56:16 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_testsbut instead of a 2-by-2 factorial design, I am using a 2-by-11 factorialdesign. As such, I am not sure how this translates when making differencedata structures. I hope I am not missing something obvious.Thanks again,DylanOn Tuesday, 28 October 2014, Eelke Spaak wrote:Dear Dylan,You don't want (or need) a single struct with a subj X chan X freq Xtime powspctrm. Instead, it is often convenient to collect eachindividual subject's struct in a *cell* array (rather than a structarray). See, for example, here:http://www.mathworks.nl/help/matlab/cell-arrays.html and here:http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/.At the statistics step you should pass in multiple structs, each onecorresponding to one unit-of-observa tion, to ft_freqstatistics. Thiscan be done like so:stat = ft_freqstatistics(cfg, struct11, struct12,struct13,...struct21, struct22, ...);or, using the cell arrays, like so:stat = ft_freqstatistics(cfg, groupA{:}, groupB{:});Make sure that each column in your design matrix describes oneunit-of-observation, in the order in which the structs are passed intoft_freqstatistics.Best,EelkeOn 21 October 2014 03:41, Dylan DeLosAngeles > wrote:> Dear Eelke,>> Thank you for help regarding cluster-based permutation analysis of two ormore conditions.>> I am using time-frequency data (not time-lock structures). My firstproblem seems to be getting my 12 subjects into the 4D powspectrum.>> My code below loads 12 subjects from the first group, but I end up with a1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x3 frequencies x 2049 time points, rather than one struct with a 4D powspctrmwith 12 subjects as rows x electrodes x freqs x time points.>> for k = 1:Nmt, % states> for i = 1%:Ng, % groups> for j = 1:Ns, % subjects>> % load files> p(j) = eeg3.eeg.load(fullfile(fpath,fname2));>> % convert to eeglab to get channel locations> EEG(j) = eeg2eeglab( p(j));> EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile);>> % preprocessing in fieldtrip> d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing');>> % specify length of time to use in config> time = EEG(j).xmax-EEG(j).xmin;>> % setup configuration for freqanalysis> cfg = []; % clear cfg> cfg.output = 'pow';> cfg.channel = 'EEG';> cfg.method = 'mtmconvol';> cfg.taper = 'hanning';> cfg.foi = 0.5:3; % delta> cfg.toi = 1:0.05:time; % length of each state> cfg.t_ftimwin = 7./cfg.foi; % 7 cycles> cfg .keeptrials = 'yes';>> % do freqanalysis> freqdata(j) = ft_freqanalysis( cfg, d(j));> end> end> end>> My second problem is loading in the second group of 12 subjects and whatthat will look like when I run ft_freqstatistics.>> Lastly, I just want to confirm what you said in your previous email, thatI should be using indepsamplesF for more than two conditions (I have 11),and therefore my design should look like this;> 1 2 1 2 1 2 1 2 1 2 1 2 12 1 2 1 2 1 2 1 2 (two groups)> 1 1 2 2 3 3 4 4 5 5 6 6 77 8 8 9 9 10 10 11 11 (11 conditions)>> Any help would be appreciated.>> Kind regards,> Dylan>>>>> On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak >> wrote:> Hello Dylan,>> You can analyse a between-subje cts design exactly as you would a> between-trials design (at least as far as the statistics step is> concerned), in both cases the two conditions correspond to two groups> of observations, and not to the same group of observations measured in> two separate conditions (which would be a within-UO design). In> FieldTrip, you would typically compute averages per subject, then use> an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic> (not depsamples). indepsamplesT only requires one row in the design> matrix, indicating the condition.>> Note that if you have e.g. timelock structures in two (or more) cell> arrays, corresponding to the conditions, you can input them into the> statistics function as follows:>> stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:});>> without having to call ft_timelockgrandaverage. In fact, the above is> the preferred way to do statistics now. (The same holds for> ft_freqstatistics.)>> Hope that helps,> Best,> Eelke>> On 24 September 2014 0 2:32, Dylan DeLosAngeles> >> wrote:>> Hello,>>>> So far, the tutorial on "Cluster-based permutation tests ontime-frequency>> data" has been very helpful.>>>> Out of the four combinations from the two UO-types (subjects and trials)and>> the two experimental designs (between- and within-UO), the tutorialcovers>> statistics on data in two conditions in a between-trials, in awithin-trials>> and in a within-subjects design. However, I am wondering if there is any>> information about the fourth type of experiment design: between-subjects.>>>> I have data for 2 groups with 12 subjects in each group. Both groups are>> measured during 11 conditions.>> Can I approach this in a similar fashion to within-subjects design(multiple>> subjects in multiple experimental conditions), such that my design is>> multiple groups in multiple experimental conditions. Is it a case offirst>> averaging over all trial s belonging to each of the experimentalconditions>> for each subject (as instructed in tutorial), and then averaging over all>> subjects in each group?>>>> Configuration code for setting up the design currently looks like this;>> grp = 2;>> subj = 11;>> design = zeros(2, subj*grp);>>>> for i = 1:grp>> design(1,i:2:end) = i;>> end>>>> idx = 1;>> for i = 1:subj>> design(2,idx:idx+1) = i;>> idx = idx+2;>> end>>>> Is there anything else I need to take into consideration when doing these>> statistics?>>>> Thank you,>> Dr Dylan DeLosAngeles>> Research Fellow>> Brain Signal Laboratory>> Flinders University>>>> _______________________________________________>> fieldtrip mailing list>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip> _______________________________________________> fieldtrip mailing list> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>_______________________________________________fieldtrip mailing listfieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Oct 31 17:02:09 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 31 Oct 2014 16:02:09 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> References: , <0F9665FF-07B8-464E-8277-B8610C97DE0F@fcdonders.ru.nl> Message-ID: Hi Emma, In this part: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); it says that the function 'fieldnames' doesn't know how to deal with data that is of the type double. This is because fieldnames expects your data to be in the format of a struct. I'm guessing there was just an error in your implementation because from your message you understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones for each participant. Furthermore, you need to put your source estimates in data.pow.avg. Based on your description, you might try something like this (but it's not guaranteed to work because I'm not entirely sure about the details of your data) data.pos = [902629x3 double] data.dim = [91 109 91] data.time = [1 x Z double] % vector of time points data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency x time points, depending on your data). As a side note, the size of your data will be quite taxing on computational memory so you might also want to consider using a lower spatial resolution. Finally, in the future, when describing your data, it would be best to show the structure of your data as shown in matlab (as done above), because this makes it easier for everyone else to see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community Best, Nietzsche From: Emma Holmes > Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Date: October 31, 2014 at 1:19:18 PM GMT+1 To: > Reply-To: FieldTrip discussion list > Dear all, I am trying to perform spatio-temporal cluster statistics to the sources of an EEG dataset, which I localised using the SPM8 toolbox. For each participant (averaged across trials), I have a .nii image containing the source reconstruction for each of two conditions at multiple different time points. Each nifti file contains a matrix of 91 x 109 x 91, which corresponds to the source estimates at each voxel. My aim is to identify sources of activity that span large clusters of voxels and/or time points, similar to what I have done previously with the scalp data. I understand that the function 'ft_sourcestatistics' should be able to achieve this with the data output from the function 'ft_sourcegrandaverage'. However, I am having difficulty structuring the data from the nifti files in a format that can be successfully input to 'ft_sourcegrandaverage'. The data that I am trying to input to 'ft_sourcegrandaverage' contains a cell array of structures--one for each participant. As far as I understand from the documentation, each structure should contain a 'pos' field, which specifies the [x y z] co-ordinates for each position in the matrix (in my case, a matrix of size 91*109*91 x 3). I have also included a 'time' field, containing a vector of the time points to which each .nii image corresponds and a 'dim' field containing the vector [91 109 91]. Could you please let me know whether or not this is correct and in which field(s) I should subsequently add the source reconstruction estimates at each time point. So far, I have tried including an 'avg' field with the data at each time point (91 x 109 x 91 x ntps). However, when I do so, I get the following error: ??? Undefined function or method 'fieldnames' for input arguments of type 'double'. Error in ==> parameterselection at 47 tmp = fieldnames(data.avg); Error in ==> ft_checkdata at 578 param = setdiff(parameterselection('all', data), exclude); Error in ==> ft_sourcegrandaverage at 81 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); I am using matlab version 7.7.0.471 (R2008b) and fieldtrip-20140415 (although I have also tried other fieldtrip versions). Any help would be greatly appreciated. Best wishes, Emma _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: