From stephan.bickel at ANATOM.UNIZH.CH Tue Mar 4 17:15:08 2008 From: stephan.bickel at ANATOM.UNIZH.CH (Stephan Bickel) Date: Tue, 4 Mar 2008 17:15:08 +0100 Subject: clusteranalysis inter-trial phase-locking Message-ID: Hi, I would like to use clusterrandanalysis to test significant differences of inter-trial phase-locking values between conditions, within subjects. I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs cross- and autospectra as input, to test between channel coherence differenes. I was wondering if there is a way to use this function to compute inter-trial phase locking differences. Thanks a lot for your help, Stephan PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in freqanalysis. then: frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); I hope this is ok? would it be legitimate to change clusteranalysis to accept fouriersptrm as input and introduce the phase-locking calculation step for every random partition? then compute the z-statistics in clusterstatistics with those values? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Tue Mar 4 17:59:49 2008 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 4 Mar 2008 17:59:49 +0100 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: Message-ID: Hi Stephan, > I would like to use clusterrandanalysis to test significant differences of > inter-trial phase-locking values between conditions, within subjects. > I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs > cross- and autospectra as input, to test between channel coherence differenes. > I was wondering if there is a way to use this function to compute > inter-trial phase locking differences. I guess you want to compare the PLF/coherence values between experimental conditions. (PLF/coherence itself is calculated OVER trials, as correctly show in your code snippet below.) > PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in > freqanalysis. then: > frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); > I hope this is ok? Yes, this is OK. However, you can improve by using spectral smoothing, preferably using multitapers. When you have a small number of very long trials this will make a big difference. Have a look in our paper (Maris, Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. > > would it be legitimate to change clusteranalysis to accept fouriersptrm as > input and introduce the phase-locking calculation step for every random > partition? then compute the z-statistics in clusterstatistics with those values? I will not change clusterrandanalysis to accept fourierspctrm data. However, I may change freqstatistics (one of the successors of clusterrandanalysis) to accept fourierspctrm data (and supporting multitapers). This could be in the form of a small collaborative project. You can find me at maris at nici.ru.nl. Greetings, Eric Maris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip > toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > See also http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tomh at KURAGE.NIMH.NIH.GOV Tue Mar 4 19:44:41 2008 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Tue, 4 Mar 2008 13:44:41 -0500 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: > Yes, this is OK. However, you can improve by using spectral smoothing, > preferably using multitapers. When you have a small number of very long > trials this will make a big difference. Have a look in our paper (Maris, > Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. By the way, congratulations on that paper. That's really good stuff but you made a spelling error on page 171. :-) I think this paper will be required reading for all NIMH MEG researchers. Dr. Tom -- Like the sail trembling with the violence of the spirit, does my wisdom cross the sea- my wild wisdom! Thus spoke Zarathustra. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Mar 5 11:08:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (Jan-Mathijs Schoffelen) Date: Wed, 5 Mar 2008 10:08:49 +0000 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: Dear Eric and Stephan, > I will not change clusterrandanalysis to accept fourierspctrm data. However, > I may change freqstatistics (one of the successors of clusterrandanalysis) > to accept fourierspctrm data (and supporting multitapers). This could be in > the form of a small collaborative project. Please note that freqstatistics accepts fourierspectra as an input, but I am not sure whether the underlying statistics_wrapper.m correctly deals with this. Moreover, you can code the tapers as a row in your design-vector and specifying the row-number in cfg.wvar for the correct resampling. You might want to have a look at resampledesign for this. Provided this all works the only thing which is needed is a proper statfun_xxx Yours, Jan-Mathijs ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Marcel.Bastiaansen at FCDONDERS.RU.NL Wed Mar 12 14:50:27 2008 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Wed, 12 Mar 2008 14:50:27 +0100 Subject: output of timelockstatistics Message-ID: An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 12 16:07:37 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 12 Mar 2008 16:07:37 +0100 Subject: output of timelockstatistics In-Reply-To: <47D7DFA3.7040508@fcdonders.ru.nl> Message-ID: Hi Marcel, On 12 Mar 2008, at 14:50, Marcel Bastiaansen wrote: > I used timelockstatistics (method montecarlo, i.e. cluster > randomization) to compare the significance between two erp's. > Here's the output struct. > > stats112_113 = > > prob: [30x600 double] your input consists of 30 channels and 600 timepoints. For each of the 30x600 samples a probability is computed. In your case (montecarlo and correctm=cluster) the probabilities of neighbouring chan_time points will often be identical, as they belong to the same cluster. > posclusters: [1x5 struct] There are 5 clusters with a positive summed t-value > posclusterslabelmat: [30x600 double] this contains the cluster number that each sample belongs to, or a 0 if it does not belong to a sampple. Try imagesc (stat.posclusterslabelmat) > posdistribution: [1x1000 double] This is the randomization distribution for the statistic of interest for the positive tail, i.e. the sum of the t-values in the largest cluster in each randomization. Do hist(stat.posdistribution) and look at the content of stat.poscluster(1) to see where the first cluster lies in that distribution. > > negclusters: [1x20 struct] > negclusterslabelmat: [30x600 double] > negdistribution: [1x1000 double] idem for negative clusters, except that there are 20 in total (note that not all might be significant). > mask: [30x600 logical] for each sample contains a 0 if not significant, or a 1 if significant. > stat: [30x600 double] for each sample contains the t-value (assuming that you used that as statistic). So you can do imagesc(stat.stat), and then alpha ((stat.mask+1)/2) to add some transparency. The summed cluster statsitic for the first positive cluster can be retrieved using sum (stat.stat(find(stat.posclusterslabelmat(:)==1)). This should match the content of the stat.posclusters(1) structure. > dimord: 'chan_time' > label: {30x1 cell} > time: [1x600 double] The other fields have the first dimension "channel" and second dimension "time". For freqstatistics on TFR data you would get dimord='chan_freq_time' > cfg: [1x1 struct] this was the configuration used in the computation, including all defaults that were set. See also http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting and the clusterplot function. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 17 22:04:21 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 17 Mar 2008 22:04:21 +0100 Subject: Fries-lab: 5 postdoc and 1 PhD position open Message-ID: Dear fieldtrip list members, Attached please find an job announcement for 5 postdoc and 1 PhD positions that are available in the group of Pacsal Fries at the F.C. Donders Centre. More details can be found in the attached pdf. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Jobs_PascalFries.pdf Type: application/pdf Size: 630952 bytes Desc: not available URL: From soren.r.christensen at GSK.COM Mon Mar 17 22:08:01 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 17 Mar 2008 21:08:01 +0000 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 14-Mar-2008 and will not return until 18-Mar-2008. Back 18th March ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lwn_07 at YAHOO.COM.CN Tue Mar 18 08:24:05 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Tue, 18 Mar 2008 15:24:05 +0800 Subject: Something Wrong in Trial Definition Message-ID: Hi, everyone, There was something wrong when I use the fieldtrip function 'definetrial', or exectly 'read_fcdc_event'. I first got the basic information of my data by using function 'ctf_read', and it returned data which was orgnized as <1800*185*75 double>, that is , there were 75 trials in my data. But when I defined trial by using 'definetrial', (key parameters were configured as follows: cfg.trialdef.eventtype='frontpanel trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it showed 88 trials were defined. What's more, I found the trials defined by 'definetrial' were not consecutive. SO, I want to know what' s wrong with the processing or the fucntion? Thank you for your answer! Best wishes. Li Weina --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Tue Mar 18 09:51:24 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Tue, 18 Mar 2008 09:51:24 +0100 Subject: Comparing topographies Message-ID: Dear Fieldtrip users, I would like to statistically compare the topographies of two groups of participants. Is there a way to do this in Fieldtrip? Maybe using permutation tests? Thanks for your help. Best wishes, Margriet Groen -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Mar 18 10:12:05 2008 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 18 Mar 2008 10:12:05 +0100 Subject: Comparing topographies In-Reply-To: <47DF828C.2020703@uni-hamburg.de> Message-ID: hi, take a look here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics if you want to use a permutation test, then your case is a variation of what's described under 2.2, i.e. you have to change the statistic (probably indepsamplesT) and adapt the design matrix described in the same tutorial. in the tutorial you will find descriptions on how to interpret the output. hth, n On 18.03.2008, at 09:51, Margriet Groen wrote: > Dear Fieldtrip users, > > I would like to statistically compare the topographies of two groups > of participants. Is there a way to do this in Fieldtrip? Maybe using > permutation tests? > > Thanks for your help. > > Best wishes, > > Margriet Groen > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 18 22:10:04 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 18 Mar 2008 22:10:04 +0100 Subject: Something Wrong in Trial Definition In-Reply-To: <940608.12845.qm@web15602.mail.cnb.yahoo.com> Message-ID: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.gross at PSY.GLA.AC.UK Wed Mar 19 11:26:24 2008 From: j.gross at PSY.GLA.AC.UK (Joachim Gross) Date: Wed, 19 Mar 2008 10:26:24 +0000 Subject: job advert Message-ID: *UNIVERSITY** /of/ GLASGOW** * * DEPARTMENT OF PSYCHOLOGY* *Centre for Cognitive Neuroimaging (CCNi)* * POSTDOCTORAL RESEARCH ASSISTANT* * Salary: £23,692 - £26,666 (grade 6)/£29,139 -- £32,796 (grade 7)* * REF: *14162/DPO/A3** A strategic priority of the University is the current creation within the Department of Psychology of a Centre for Cognitive Neuroimaging (CCNi), a major initiative to install an in-house platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. Equipment include a 3T fMRI scanner, a MEG system, a TMS system, and several EEG systems -- including fMRI compatible systems. Applications are invited for a Postdoctoral Research Assistant to work in the Magnetoencephalography (MEG) group in the newly established CCNi. The project "Investigating neural communication with multivariate autoregressive models" is funded by Wellcome Trust for 3 years. The successful candidate will work with Prof. Gross on the development of new analysis tools for the investigation of neural communication using MEG data. You will be involved in methods development, extensive simulations, data acquisition and analysis. You will have the opportunity to be part of a very dynamic research centre. You will have a background in Electrical Engineering, Mathematics, Neuroinformatics, Physics, Psychology, Neuroscience or a related discipline. Expertise in advanced programming (preferably with MATLAB) is important. Experience with multivariate autoregressive models and MEG/EEG is desirable. This post is available from 1 May 2008 and funding is available for 36 months. Informal enquiries may be made to Professor J Gross, (+44 (0) 141 330 3947; or email j.gross at psy.gla.ac.uk . For further details about the post and how to apply: See our website at www.glasgow.ac.uk/jobs/vacancies or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, email: c.alexander at psy.gla.ac.uk . Applications should be sent to: Clare Alexander at the above address. Closing date: 18 April 2008. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Wed Mar 19 14:44:51 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Wed, 19 Mar 2008 14:44:51 +0100 Subject: Mixed design + permutation test Message-ID: Hi, please excuse my ignorance, but is it possible to use permutation tests with a mixed (3 conditions x 2 groups) design? Thanks, Margriet -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lwn_07 at YAHOO.COM.CN Wed Mar 19 14:54:02 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Wed, 19 Mar 2008 21:54:02 +0800 Subject: =?gb2312?Q?=BB=D8=B8=B4=A3=BA?= Re: [FIELDTRIP] Something Wrong i n Trial Definition In-Reply-To: Message-ID: Dear Robert, Thank you for your suggestion. It does help a lot. Yes, the function 'ctf_read' is from EEGLAB, I used it to obtain the basic information of the dataset. And my data was recorded trial-based. As you pointed, the problem in my trial definition was that I have multiple triggers of the same value in "a single trial". Then I defined my own trial function based on the 'trial' event, and it works out. Thanks a lot! Li Weina Robert Oostenveld 写道: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 19 16:28:02 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 19 Mar 2008 16:28:02 +0100 Subject: plotting clusters Message-ID: Hi, We have made a plotting function for the clutster analysis, but sometimes we get very weird results. For example in one dataset for a certain time period the whole head (i.e., all the sensors) belongs to a significant cluster. I have attached the m-file that we use. All of the calls to the preprocessing and stat functions have been made, so this function just takes the data and the output of those functions and plots the significant clusters. Is there anything that we are missing or have done to make the plots output something different than intended? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The plotting function for FieldTrip data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function fieldtrip_plots(ft_args) % Try to clear save('TempArgs.mat', 'ft_args'); clear all; load('TempArgs.mat'); % Grab these fprintf('Loading Stats...\n'); sFile = ''; try sFile = ft_args.statsFile; catch sFile = [ft_args.experimentName 'Stats.mat']; end fprintf('Using %s\n', sFile); load(sFile); % Load the data try dFile1 = ft_args.gAvgFile1; catch dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; end try dFile2 = ft_args.gAvgFile2; catch dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; end % Load the first fprintf('Loading Avg1...\n'); fprintf('Using %s\n', dFile1); load(dFile1); grandAvg = grandAvgData; % Load the second fprintf('Loading Avg2...\n'); fprintf('Using %s\n', dFile2); load(dFile2); grandAvg.avg = grandAvg.avg - grandAvgData.avg; fprintf('Plotting...\n'); % Sorry... Feel free to fix %fprintf('Sorry, plotting down for now. Feel free to fix it at your leisure.\n'); %return; % TTest % Find the significant clusters sigClusters = {}; for i = 1:length(stats.posclusters) if stats.posclusters(i).prob < ft_args.alpha % Find the column and row corresponding to that cluster [m,n] = find(stats.posclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end % And do the same for negative clusters for i = 1:length(stats.negclusters) if stats.negclusters(i).prob < ft_args.alpha [m,n] = find(stats.negclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end if isempty(sigClusters) fprintf('Sorry, no significant clusters. Exiting...\n'); return; end % Get how long each sample is secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... size(stats.posclusterslabelmat,2); % And plot each significant cluster numPlots = length(sigClusters); for k = 1:numPlots % Layout the plots subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); % Get the bounds of this plot currCluster = sigClusters{k}; % Setup the config argument for plotting cfg = []; % This should be the bounds in seconds cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster(1,2) ... ft_args.stats_epoch(1) + secPerSample*currCluster(length(currCluster),2)]; % Have to have the user set for now, because not sure % how to grab from the raw data yet. cfg.zlim = ft_args.plotScale; cfg.layout='CTF275.lay'; % Want to highlight all the sensors in the % significant cluster % TODO: Figure out how to interpret clusters clusterTimePoints = currCluster(length(currCluster),2) - currCluster(1,2); sigLimit = ceil(0*clusterTimePoints); cfg.highlight = []; for j = 1:size(stats.posclusterslabelmat,1) if (length(find(currCluster(:,1) == j)) > sigLimit) cfg.highlight(size(cfg.highlight)+1) = j; end end cfg.comment = 'xlim'; cfg.commentpos = 'title'; % And plot it topoplotER(cfg, grandAvg); end % Done with these clear all; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From g.rousselet at PSY.GLA.AC.UK Wed Mar 19 18:38:47 2008 From: g.rousselet at PSY.GLA.AC.UK (Guillaume Rousselet) Date: Wed, 19 Mar 2008 17:38:47 +0000 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elo221 at MED.NYU.EDU Wed Mar 19 21:19:36 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Wed, 19 Mar 2008 16:19:36 -0400 Subject: trialdef with bdf files Message-ID: hi, It looks like fieldtrip supports Biosemi .bdf files, as well as .cnt files. Why do I get an error when calling "trialdef" for a .bdf file, but no error if i use "trialdef" for a .cnt file ? I'm using the latest version of fieldtrip. Here is the error--- Warning: Out of range value or NaN computed in integer arithmetic. > In fieldtrip-20080318\private\read_event at 400 In read_fcdc_event at 51 In fieldtrip-20080318\private\trialfun_general at 59 In definetrial at 183 ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help i know this is gotta be something easy, and i'm new at it. erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Thu Mar 20 11:38:13 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 20 Mar 2008 10:38:13 +0000 Subject: Mixed design + permutation test In-Reply-To: <893EEA7A-B01C-47CA-B6C7-8D2872BCCFBA@psy.gla.ac.uk> Message-ID: Hi Margriet, If your data is in analyse format or you can get in analyse/nifti format then FSL's randomise function can do all this for you....if you set your design matrix up properly - Suresh Suresh Muthukumaraswamy, PhD CUBRIC Cardiff University Park Place Cardiff, CF10 3AT United Kingdom email: sdmuthu at cardiff.ac.uk Phone: +44 (0)29 2087 0353 >>> Guillaume Rousselet 19/03/2008 17:38:47 >>> Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From elo221 at MED.NYU.EDU Mon Mar 24 21:21:10 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Mon, 24 Mar 2008 16:21:10 -0400 Subject: trialdef with bdf files Message-ID: hi, The filename of my data is 'vv(P)-gamma-aod_20.bdf' When using bdf files, and the trialdef function, I received this message. process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction 'trialfun_general' ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, there is no conflict. Thanks Erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 12:57:13 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 12:57:13 +0100 Subject: trialdef with bdf files In-Reply-To: <1206390070.47e80d364551d@imp.med.nyu.edu> Message-ID: Hi Erin, The DEFINETRIAL function is used to determine which segments of the data are of interest. Only the segments of interest ("trials") are read from the file and preprocessed using the PREPROCESING function. In your case theer are trials defined for the cnt, but not for the bdf file. The preferred approach for using DEFINETRIAL is to supply it with your own "trialfun" (cfg.trialfun=name_of_your_function, see the documentation on the website). If you do not specify cfg.trialfun, a default trialfun will be used. There are different defaults for the different file formats. Your problem seems to be related to the trialfun for neuroscan ctf having more appropriate defaults that the trialfun for biosemi bdf. I suggest that you explicitely write your own trialfun, using read_fcdc_event. See http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing#appendixdefining_your_ own_function_for_trial_selection and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 24 Mar 2008, at 21:21, Erin Oakman wrote: > hi, > > The filename of my data is 'vv(P)-gamma-aod_20.bdf' > > When using bdf files, and the trialdef function, I received this > message. > > > process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction > 'trialfun_general' > ??? Error using ==> definetrial at 193 > no trials were defined, see DEFINETRIAL for help > > If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, > there is no > conflict. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:10:58 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:10:58 +0100 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hi Margriet, The fieldtrip statistics functions (timelockstatistics, freqstatistics and sourcestatistics) allow you to do this. You should specify a design matrix (cfg.design) with one row for the condition number (I suggest to use condition numbers "1", "2" and "3"), a second row with the subject number and a third row for the two group (1 and 2). Subsequently you can supply your own statistic to be tested using the montecarlo permutation approach, by specifiying cfg.method='montecarlo' and cfg.statistic='xxx'. This will cause a function to be called with the name "statfun_xxx.m". This is a function that you can easily implement yourself, including the suggestions of Guillame. Example statfuns can be found in fieldtrip/ private. The statfun gets called for each permutation of the columns of the design matrix. In your case, you want the permutations of the columns to be restricted to within the groups. The resampling/ permuting of the design matrix is done by the function fieldtrip/ private/resampledesign. If I recall correctly (please look into that function), you should specify cfg.ivar=1 (for the 3 levels of your condition), cfg.uvar=2 (for the "unit of observation", i.e. subject) and cfg.wvar=2 (for keeping the shuffles within each group). Using the fieldtrip statistics functions with your own statfun allows you to use the multiple comparison correction techniques already implemented (including max-statistic, FDR and even clustering). In case of an f-statistic, you should specify the other options correctly so that the permulation distribution is tested only one-sided. best regards, Robert On 19 Mar 2008, at 14:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:16:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:16:00 +0100 Subject: plotting clusters In-Reply-To: Message-ID: Hi Andrew, There is a clusterplot function included with fieldtrip. See http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting#plotting_clusters You could compare your figures to the ones from clusterplot. Note that it may very well be possible that the significant clusters in your data are very large, up to the point that most channels in a timeframe of interest are significant. E.g. think of a large ERP component, which is visible on many channels (depending on the choise of reference). But that is something that I would not neccessarily expect in the case of whole-head MEG. best regards, Robert On 19 Mar 2008, at 16:28, Andrew Smart wrote: > Hi, > > We have made a plotting function for the clutster analysis, but > sometimes > we get very weird results. For example in one dataset for a certain > time > period the whole head (i.e., all the sensors) belongs to a significant > cluster. > > I have attached the m-file that we use. All of the calls to the > preprocessing and stat functions have been made, so this function just > takes the data and the output of those functions and plots the > significant > clusters. > > Is there anything that we are missing or have done to make the > plots output > something different than intended? > > Thank you! > andy > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % The plotting function for FieldTrip data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > function fieldtrip_plots(ft_args) > > % Try to clear > save('TempArgs.mat', 'ft_args'); > clear all; > load('TempArgs.mat'); > > % Grab these > fprintf('Loading Stats...\n'); > sFile = ''; > try > sFile = ft_args.statsFile; > catch > sFile = [ft_args.experimentName 'Stats.mat']; > end > fprintf('Using %s\n', sFile); > load(sFile); > > % Load the data > try > dFile1 = ft_args.gAvgFile1; > catch > dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; > end > try > dFile2 = ft_args.gAvgFile2; > catch > dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; > end > > % Load the first > fprintf('Loading Avg1...\n'); > fprintf('Using %s\n', dFile1); > load(dFile1); > grandAvg = grandAvgData; > > % Load the second > fprintf('Loading Avg2...\n'); > fprintf('Using %s\n', dFile2); > load(dFile2); > grandAvg.avg = grandAvg.avg - grandAvgData.avg; > > fprintf('Plotting...\n'); > > % Sorry... Feel free to fix > %fprintf('Sorry, plotting down for now. Feel free to fix it at > your leisure.\n'); > %return; > > % TTest > % Find the significant clusters > sigClusters = {}; > for i = 1:length(stats.posclusters) > if stats.posclusters(i).prob < ft_args.alpha > > % Find the column and row corresponding to that cluster > [m,n] = find(stats.posclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > % And do the same for negative clusters > for i = 1:length(stats.negclusters) > if stats.negclusters(i).prob < ft_args.alpha > [m,n] = find(stats.negclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > if isempty(sigClusters) > fprintf('Sorry, no significant clusters. Exiting...\n'); > return; > end > > % Get how long each sample is > secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... > size(stats.posclusterslabelmat,2); > > % And plot each significant cluster > numPlots = length(sigClusters); > for k = 1:numPlots > > % Layout the plots > subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); > > % Get the bounds of this plot > currCluster = sigClusters{k}; > > % Setup the config argument for plotting > cfg = []; > > % This should be the bounds in seconds > cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster > (1,2) ... > ft_args.stats_epoch(1) + secPerSample*currCluster(length > (currCluster),2)]; > > % Have to have the user set for now, because not sure > % how to grab from the raw data yet. > cfg.zlim = ft_args.plotScale; > cfg.layout='CTF275.lay'; > > % Want to highlight all the sensors in the > % significant cluster > % TODO: Figure out how to interpret clusters > clusterTimePoints = currCluster(length(currCluster),2) - > currCluster(1,2); > sigLimit = ceil(0*clusterTimePoints); > cfg.highlight = []; > for j = 1:size(stats.posclusterslabelmat,1) > if (length(find(currCluster(:,1) == j)) > sigLimit) > cfg.highlight(size(cfg.highlight)+1) = j; > end > end > > cfg.comment = 'xlim'; > cfg.commentpos = 'title'; > > % And plot it > topoplotER(cfg, grandAvg); > end > > % Done with these > clear all; > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Mon Mar 31 17:41:14 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Mon, 31 Mar 2008 17:41:14 +0200 Subject: unbalanced mixed design Message-ID: Apropos Margriets question about a mixed design and permutation test, I tried your suggestion, but for a 2 x 2 unbalanced mixed design with the depsamplesF test because I have different numbers of subjects in a clinical and control group, and two conditions. I tried a design matrix with row 1 for condition ("1" and "2") row 2 subject number and the third row group (1 and 2). So the design matrix is 3 X 22 like this: condition: 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 subj number: 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 group: 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 2 However, the resampledesign function wants the design matrix to be constant within a block and since I have an unbalanced design this doesn't seem to be possible. Is there work around to set up the design matrix with an unbalanced design to call the F statistic for the permutations? I do not want to throw away a subject to make the design balanced because I have already so few subjects in this experiment. Thank you, Andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From stephan.bickel at ANATOM.UNIZH.CH Tue Mar 4 17:15:08 2008 From: stephan.bickel at ANATOM.UNIZH.CH (Stephan Bickel) Date: Tue, 4 Mar 2008 17:15:08 +0100 Subject: clusteranalysis inter-trial phase-locking Message-ID: Hi, I would like to use clusterrandanalysis to test significant differences of inter-trial phase-locking values between conditions, within subjects. I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs cross- and autospectra as input, to test between channel coherence differenes. I was wondering if there is a way to use this function to compute inter-trial phase locking differences. Thanks a lot for your help, Stephan PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in freqanalysis. then: frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); I hope this is ok? would it be legitimate to change clusteranalysis to accept fouriersptrm as input and introduce the phase-locking calculation step for every random partition? then compute the z-statistics in clusterstatistics with those values? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Tue Mar 4 17:59:49 2008 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 4 Mar 2008 17:59:49 +0100 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: Message-ID: Hi Stephan, > I would like to use clusterrandanalysis to test significant differences of > inter-trial phase-locking values between conditions, within subjects. > I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs > cross- and autospectra as input, to test between channel coherence differenes. > I was wondering if there is a way to use this function to compute > inter-trial phase locking differences. I guess you want to compare the PLF/coherence values between experimental conditions. (PLF/coherence itself is calculated OVER trials, as correctly show in your code snippet below.) > PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in > freqanalysis. then: > frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); > I hope this is ok? Yes, this is OK. However, you can improve by using spectral smoothing, preferably using multitapers. When you have a small number of very long trials this will make a big difference. Have a look in our paper (Maris, Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. > > would it be legitimate to change clusteranalysis to accept fouriersptrm as > input and introduce the phase-locking calculation step for every random > partition? then compute the z-statistics in clusterstatistics with those values? I will not change clusterrandanalysis to accept fourierspctrm data. However, I may change freqstatistics (one of the successors of clusterrandanalysis) to accept fourierspctrm data (and supporting multitapers). This could be in the form of a small collaborative project. You can find me at maris at nici.ru.nl. Greetings, Eric Maris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip > toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > See also http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tomh at KURAGE.NIMH.NIH.GOV Tue Mar 4 19:44:41 2008 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Tue, 4 Mar 2008 13:44:41 -0500 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: > Yes, this is OK. However, you can improve by using spectral smoothing, > preferably using multitapers. When you have a small number of very long > trials this will make a big difference. Have a look in our paper (Maris, > Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. By the way, congratulations on that paper. That's really good stuff but you made a spelling error on page 171. :-) I think this paper will be required reading for all NIMH MEG researchers. Dr. Tom -- Like the sail trembling with the violence of the spirit, does my wisdom cross the sea- my wild wisdom! Thus spoke Zarathustra. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Mar 5 11:08:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (Jan-Mathijs Schoffelen) Date: Wed, 5 Mar 2008 10:08:49 +0000 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: Dear Eric and Stephan, > I will not change clusterrandanalysis to accept fourierspctrm data. However, > I may change freqstatistics (one of the successors of clusterrandanalysis) > to accept fourierspctrm data (and supporting multitapers). This could be in > the form of a small collaborative project. Please note that freqstatistics accepts fourierspectra as an input, but I am not sure whether the underlying statistics_wrapper.m correctly deals with this. Moreover, you can code the tapers as a row in your design-vector and specifying the row-number in cfg.wvar for the correct resampling. You might want to have a look at resampledesign for this. Provided this all works the only thing which is needed is a proper statfun_xxx Yours, Jan-Mathijs ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Marcel.Bastiaansen at FCDONDERS.RU.NL Wed Mar 12 14:50:27 2008 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Wed, 12 Mar 2008 14:50:27 +0100 Subject: output of timelockstatistics Message-ID: An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 12 16:07:37 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 12 Mar 2008 16:07:37 +0100 Subject: output of timelockstatistics In-Reply-To: <47D7DFA3.7040508@fcdonders.ru.nl> Message-ID: Hi Marcel, On 12 Mar 2008, at 14:50, Marcel Bastiaansen wrote: > I used timelockstatistics (method montecarlo, i.e. cluster > randomization) to compare the significance between two erp's. > Here's the output struct. > > stats112_113 = > > prob: [30x600 double] your input consists of 30 channels and 600 timepoints. For each of the 30x600 samples a probability is computed. In your case (montecarlo and correctm=cluster) the probabilities of neighbouring chan_time points will often be identical, as they belong to the same cluster. > posclusters: [1x5 struct] There are 5 clusters with a positive summed t-value > posclusterslabelmat: [30x600 double] this contains the cluster number that each sample belongs to, or a 0 if it does not belong to a sampple. Try imagesc (stat.posclusterslabelmat) > posdistribution: [1x1000 double] This is the randomization distribution for the statistic of interest for the positive tail, i.e. the sum of the t-values in the largest cluster in each randomization. Do hist(stat.posdistribution) and look at the content of stat.poscluster(1) to see where the first cluster lies in that distribution. > > negclusters: [1x20 struct] > negclusterslabelmat: [30x600 double] > negdistribution: [1x1000 double] idem for negative clusters, except that there are 20 in total (note that not all might be significant). > mask: [30x600 logical] for each sample contains a 0 if not significant, or a 1 if significant. > stat: [30x600 double] for each sample contains the t-value (assuming that you used that as statistic). So you can do imagesc(stat.stat), and then alpha ((stat.mask+1)/2) to add some transparency. The summed cluster statsitic for the first positive cluster can be retrieved using sum (stat.stat(find(stat.posclusterslabelmat(:)==1)). This should match the content of the stat.posclusters(1) structure. > dimord: 'chan_time' > label: {30x1 cell} > time: [1x600 double] The other fields have the first dimension "channel" and second dimension "time". For freqstatistics on TFR data you would get dimord='chan_freq_time' > cfg: [1x1 struct] this was the configuration used in the computation, including all defaults that were set. See also http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting and the clusterplot function. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 17 22:04:21 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 17 Mar 2008 22:04:21 +0100 Subject: Fries-lab: 5 postdoc and 1 PhD position open Message-ID: Dear fieldtrip list members, Attached please find an job announcement for 5 postdoc and 1 PhD positions that are available in the group of Pacsal Fries at the F.C. Donders Centre. More details can be found in the attached pdf. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Jobs_PascalFries.pdf Type: application/pdf Size: 630952 bytes Desc: not available URL: From soren.r.christensen at GSK.COM Mon Mar 17 22:08:01 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 17 Mar 2008 21:08:01 +0000 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 14-Mar-2008 and will not return until 18-Mar-2008. Back 18th March ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lwn_07 at YAHOO.COM.CN Tue Mar 18 08:24:05 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Tue, 18 Mar 2008 15:24:05 +0800 Subject: Something Wrong in Trial Definition Message-ID: Hi, everyone, There was something wrong when I use the fieldtrip function 'definetrial', or exectly 'read_fcdc_event'. I first got the basic information of my data by using function 'ctf_read', and it returned data which was orgnized as <1800*185*75 double>, that is , there were 75 trials in my data. But when I defined trial by using 'definetrial', (key parameters were configured as follows: cfg.trialdef.eventtype='frontpanel trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it showed 88 trials were defined. What's more, I found the trials defined by 'definetrial' were not consecutive. SO, I want to know what' s wrong with the processing or the fucntion? Thank you for your answer! Best wishes. Li Weina --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Tue Mar 18 09:51:24 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Tue, 18 Mar 2008 09:51:24 +0100 Subject: Comparing topographies Message-ID: Dear Fieldtrip users, I would like to statistically compare the topographies of two groups of participants. Is there a way to do this in Fieldtrip? Maybe using permutation tests? Thanks for your help. Best wishes, Margriet Groen -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Mar 18 10:12:05 2008 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 18 Mar 2008 10:12:05 +0100 Subject: Comparing topographies In-Reply-To: <47DF828C.2020703@uni-hamburg.de> Message-ID: hi, take a look here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics if you want to use a permutation test, then your case is a variation of what's described under 2.2, i.e. you have to change the statistic (probably indepsamplesT) and adapt the design matrix described in the same tutorial. in the tutorial you will find descriptions on how to interpret the output. hth, n On 18.03.2008, at 09:51, Margriet Groen wrote: > Dear Fieldtrip users, > > I would like to statistically compare the topographies of two groups > of participants. Is there a way to do this in Fieldtrip? Maybe using > permutation tests? > > Thanks for your help. > > Best wishes, > > Margriet Groen > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 18 22:10:04 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 18 Mar 2008 22:10:04 +0100 Subject: Something Wrong in Trial Definition In-Reply-To: <940608.12845.qm@web15602.mail.cnb.yahoo.com> Message-ID: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.gross at PSY.GLA.AC.UK Wed Mar 19 11:26:24 2008 From: j.gross at PSY.GLA.AC.UK (Joachim Gross) Date: Wed, 19 Mar 2008 10:26:24 +0000 Subject: job advert Message-ID: *UNIVERSITY** /of/ GLASGOW** * * DEPARTMENT OF PSYCHOLOGY* *Centre for Cognitive Neuroimaging (CCNi)* * POSTDOCTORAL RESEARCH ASSISTANT* * Salary: £23,692 - £26,666 (grade 6)/£29,139 -- £32,796 (grade 7)* * REF: *14162/DPO/A3** A strategic priority of the University is the current creation within the Department of Psychology of a Centre for Cognitive Neuroimaging (CCNi), a major initiative to install an in-house platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. Equipment include a 3T fMRI scanner, a MEG system, a TMS system, and several EEG systems -- including fMRI compatible systems. Applications are invited for a Postdoctoral Research Assistant to work in the Magnetoencephalography (MEG) group in the newly established CCNi. The project "Investigating neural communication with multivariate autoregressive models" is funded by Wellcome Trust for 3 years. The successful candidate will work with Prof. Gross on the development of new analysis tools for the investigation of neural communication using MEG data. You will be involved in methods development, extensive simulations, data acquisition and analysis. You will have the opportunity to be part of a very dynamic research centre. You will have a background in Electrical Engineering, Mathematics, Neuroinformatics, Physics, Psychology, Neuroscience or a related discipline. Expertise in advanced programming (preferably with MATLAB) is important. Experience with multivariate autoregressive models and MEG/EEG is desirable. This post is available from 1 May 2008 and funding is available for 36 months. Informal enquiries may be made to Professor J Gross, (+44 (0) 141 330 3947; or email j.gross at psy.gla.ac.uk . For further details about the post and how to apply: See our website at www.glasgow.ac.uk/jobs/vacancies or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, email: c.alexander at psy.gla.ac.uk . Applications should be sent to: Clare Alexander at the above address. Closing date: 18 April 2008. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Wed Mar 19 14:44:51 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Wed, 19 Mar 2008 14:44:51 +0100 Subject: Mixed design + permutation test Message-ID: Hi, please excuse my ignorance, but is it possible to use permutation tests with a mixed (3 conditions x 2 groups) design? Thanks, Margriet -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lwn_07 at YAHOO.COM.CN Wed Mar 19 14:54:02 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Wed, 19 Mar 2008 21:54:02 +0800 Subject: =?gb2312?Q?=BB=D8=B8=B4=A3=BA?= Re: [FIELDTRIP] Something Wrong i n Trial Definition In-Reply-To: Message-ID: Dear Robert, Thank you for your suggestion. It does help a lot. Yes, the function 'ctf_read' is from EEGLAB, I used it to obtain the basic information of the dataset. And my data was recorded trial-based. As you pointed, the problem in my trial definition was that I have multiple triggers of the same value in "a single trial". Then I defined my own trial function based on the 'trial' event, and it works out. Thanks a lot! Li Weina Robert Oostenveld 写道: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 19 16:28:02 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 19 Mar 2008 16:28:02 +0100 Subject: plotting clusters Message-ID: Hi, We have made a plotting function for the clutster analysis, but sometimes we get very weird results. For example in one dataset for a certain time period the whole head (i.e., all the sensors) belongs to a significant cluster. I have attached the m-file that we use. All of the calls to the preprocessing and stat functions have been made, so this function just takes the data and the output of those functions and plots the significant clusters. Is there anything that we are missing or have done to make the plots output something different than intended? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The plotting function for FieldTrip data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function fieldtrip_plots(ft_args) % Try to clear save('TempArgs.mat', 'ft_args'); clear all; load('TempArgs.mat'); % Grab these fprintf('Loading Stats...\n'); sFile = ''; try sFile = ft_args.statsFile; catch sFile = [ft_args.experimentName 'Stats.mat']; end fprintf('Using %s\n', sFile); load(sFile); % Load the data try dFile1 = ft_args.gAvgFile1; catch dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; end try dFile2 = ft_args.gAvgFile2; catch dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; end % Load the first fprintf('Loading Avg1...\n'); fprintf('Using %s\n', dFile1); load(dFile1); grandAvg = grandAvgData; % Load the second fprintf('Loading Avg2...\n'); fprintf('Using %s\n', dFile2); load(dFile2); grandAvg.avg = grandAvg.avg - grandAvgData.avg; fprintf('Plotting...\n'); % Sorry... Feel free to fix %fprintf('Sorry, plotting down for now. Feel free to fix it at your leisure.\n'); %return; % TTest % Find the significant clusters sigClusters = {}; for i = 1:length(stats.posclusters) if stats.posclusters(i).prob < ft_args.alpha % Find the column and row corresponding to that cluster [m,n] = find(stats.posclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end % And do the same for negative clusters for i = 1:length(stats.negclusters) if stats.negclusters(i).prob < ft_args.alpha [m,n] = find(stats.negclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end if isempty(sigClusters) fprintf('Sorry, no significant clusters. Exiting...\n'); return; end % Get how long each sample is secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... size(stats.posclusterslabelmat,2); % And plot each significant cluster numPlots = length(sigClusters); for k = 1:numPlots % Layout the plots subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); % Get the bounds of this plot currCluster = sigClusters{k}; % Setup the config argument for plotting cfg = []; % This should be the bounds in seconds cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster(1,2) ... ft_args.stats_epoch(1) + secPerSample*currCluster(length(currCluster),2)]; % Have to have the user set for now, because not sure % how to grab from the raw data yet. cfg.zlim = ft_args.plotScale; cfg.layout='CTF275.lay'; % Want to highlight all the sensors in the % significant cluster % TODO: Figure out how to interpret clusters clusterTimePoints = currCluster(length(currCluster),2) - currCluster(1,2); sigLimit = ceil(0*clusterTimePoints); cfg.highlight = []; for j = 1:size(stats.posclusterslabelmat,1) if (length(find(currCluster(:,1) == j)) > sigLimit) cfg.highlight(size(cfg.highlight)+1) = j; end end cfg.comment = 'xlim'; cfg.commentpos = 'title'; % And plot it topoplotER(cfg, grandAvg); end % Done with these clear all; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From g.rousselet at PSY.GLA.AC.UK Wed Mar 19 18:38:47 2008 From: g.rousselet at PSY.GLA.AC.UK (Guillaume Rousselet) Date: Wed, 19 Mar 2008 17:38:47 +0000 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elo221 at MED.NYU.EDU Wed Mar 19 21:19:36 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Wed, 19 Mar 2008 16:19:36 -0400 Subject: trialdef with bdf files Message-ID: hi, It looks like fieldtrip supports Biosemi .bdf files, as well as .cnt files. Why do I get an error when calling "trialdef" for a .bdf file, but no error if i use "trialdef" for a .cnt file ? I'm using the latest version of fieldtrip. Here is the error--- Warning: Out of range value or NaN computed in integer arithmetic. > In fieldtrip-20080318\private\read_event at 400 In read_fcdc_event at 51 In fieldtrip-20080318\private\trialfun_general at 59 In definetrial at 183 ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help i know this is gotta be something easy, and i'm new at it. erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Thu Mar 20 11:38:13 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 20 Mar 2008 10:38:13 +0000 Subject: Mixed design + permutation test In-Reply-To: <893EEA7A-B01C-47CA-B6C7-8D2872BCCFBA@psy.gla.ac.uk> Message-ID: Hi Margriet, If your data is in analyse format or you can get in analyse/nifti format then FSL's randomise function can do all this for you....if you set your design matrix up properly - Suresh Suresh Muthukumaraswamy, PhD CUBRIC Cardiff University Park Place Cardiff, CF10 3AT United Kingdom email: sdmuthu at cardiff.ac.uk Phone: +44 (0)29 2087 0353 >>> Guillaume Rousselet 19/03/2008 17:38:47 >>> Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From elo221 at MED.NYU.EDU Mon Mar 24 21:21:10 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Mon, 24 Mar 2008 16:21:10 -0400 Subject: trialdef with bdf files Message-ID: hi, The filename of my data is 'vv(P)-gamma-aod_20.bdf' When using bdf files, and the trialdef function, I received this message. process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction 'trialfun_general' ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, there is no conflict. Thanks Erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 12:57:13 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 12:57:13 +0100 Subject: trialdef with bdf files In-Reply-To: <1206390070.47e80d364551d@imp.med.nyu.edu> Message-ID: Hi Erin, The DEFINETRIAL function is used to determine which segments of the data are of interest. Only the segments of interest ("trials") are read from the file and preprocessed using the PREPROCESING function. In your case theer are trials defined for the cnt, but not for the bdf file. The preferred approach for using DEFINETRIAL is to supply it with your own "trialfun" (cfg.trialfun=name_of_your_function, see the documentation on the website). If you do not specify cfg.trialfun, a default trialfun will be used. There are different defaults for the different file formats. Your problem seems to be related to the trialfun for neuroscan ctf having more appropriate defaults that the trialfun for biosemi bdf. I suggest that you explicitely write your own trialfun, using read_fcdc_event. See http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing#appendixdefining_your_ own_function_for_trial_selection and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 24 Mar 2008, at 21:21, Erin Oakman wrote: > hi, > > The filename of my data is 'vv(P)-gamma-aod_20.bdf' > > When using bdf files, and the trialdef function, I received this > message. > > > process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction > 'trialfun_general' > ??? Error using ==> definetrial at 193 > no trials were defined, see DEFINETRIAL for help > > If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, > there is no > conflict. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:10:58 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:10:58 +0100 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hi Margriet, The fieldtrip statistics functions (timelockstatistics, freqstatistics and sourcestatistics) allow you to do this. You should specify a design matrix (cfg.design) with one row for the condition number (I suggest to use condition numbers "1", "2" and "3"), a second row with the subject number and a third row for the two group (1 and 2). Subsequently you can supply your own statistic to be tested using the montecarlo permutation approach, by specifiying cfg.method='montecarlo' and cfg.statistic='xxx'. This will cause a function to be called with the name "statfun_xxx.m". This is a function that you can easily implement yourself, including the suggestions of Guillame. Example statfuns can be found in fieldtrip/ private. The statfun gets called for each permutation of the columns of the design matrix. In your case, you want the permutations of the columns to be restricted to within the groups. The resampling/ permuting of the design matrix is done by the function fieldtrip/ private/resampledesign. If I recall correctly (please look into that function), you should specify cfg.ivar=1 (for the 3 levels of your condition), cfg.uvar=2 (for the "unit of observation", i.e. subject) and cfg.wvar=2 (for keeping the shuffles within each group). Using the fieldtrip statistics functions with your own statfun allows you to use the multiple comparison correction techniques already implemented (including max-statistic, FDR and even clustering). In case of an f-statistic, you should specify the other options correctly so that the permulation distribution is tested only one-sided. best regards, Robert On 19 Mar 2008, at 14:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:16:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:16:00 +0100 Subject: plotting clusters In-Reply-To: Message-ID: Hi Andrew, There is a clusterplot function included with fieldtrip. See http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting#plotting_clusters You could compare your figures to the ones from clusterplot. Note that it may very well be possible that the significant clusters in your data are very large, up to the point that most channels in a timeframe of interest are significant. E.g. think of a large ERP component, which is visible on many channels (depending on the choise of reference). But that is something that I would not neccessarily expect in the case of whole-head MEG. best regards, Robert On 19 Mar 2008, at 16:28, Andrew Smart wrote: > Hi, > > We have made a plotting function for the clutster analysis, but > sometimes > we get very weird results. For example in one dataset for a certain > time > period the whole head (i.e., all the sensors) belongs to a significant > cluster. > > I have attached the m-file that we use. All of the calls to the > preprocessing and stat functions have been made, so this function just > takes the data and the output of those functions and plots the > significant > clusters. > > Is there anything that we are missing or have done to make the > plots output > something different than intended? > > Thank you! > andy > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % The plotting function for FieldTrip data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > function fieldtrip_plots(ft_args) > > % Try to clear > save('TempArgs.mat', 'ft_args'); > clear all; > load('TempArgs.mat'); > > % Grab these > fprintf('Loading Stats...\n'); > sFile = ''; > try > sFile = ft_args.statsFile; > catch > sFile = [ft_args.experimentName 'Stats.mat']; > end > fprintf('Using %s\n', sFile); > load(sFile); > > % Load the data > try > dFile1 = ft_args.gAvgFile1; > catch > dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; > end > try > dFile2 = ft_args.gAvgFile2; > catch > dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; > end > > % Load the first > fprintf('Loading Avg1...\n'); > fprintf('Using %s\n', dFile1); > load(dFile1); > grandAvg = grandAvgData; > > % Load the second > fprintf('Loading Avg2...\n'); > fprintf('Using %s\n', dFile2); > load(dFile2); > grandAvg.avg = grandAvg.avg - grandAvgData.avg; > > fprintf('Plotting...\n'); > > % Sorry... Feel free to fix > %fprintf('Sorry, plotting down for now. Feel free to fix it at > your leisure.\n'); > %return; > > % TTest > % Find the significant clusters > sigClusters = {}; > for i = 1:length(stats.posclusters) > if stats.posclusters(i).prob < ft_args.alpha > > % Find the column and row corresponding to that cluster > [m,n] = find(stats.posclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > % And do the same for negative clusters > for i = 1:length(stats.negclusters) > if stats.negclusters(i).prob < ft_args.alpha > [m,n] = find(stats.negclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > if isempty(sigClusters) > fprintf('Sorry, no significant clusters. Exiting...\n'); > return; > end > > % Get how long each sample is > secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... > size(stats.posclusterslabelmat,2); > > % And plot each significant cluster > numPlots = length(sigClusters); > for k = 1:numPlots > > % Layout the plots > subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); > > % Get the bounds of this plot > currCluster = sigClusters{k}; > > % Setup the config argument for plotting > cfg = []; > > % This should be the bounds in seconds > cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster > (1,2) ... > ft_args.stats_epoch(1) + secPerSample*currCluster(length > (currCluster),2)]; > > % Have to have the user set for now, because not sure > % how to grab from the raw data yet. > cfg.zlim = ft_args.plotScale; > cfg.layout='CTF275.lay'; > > % Want to highlight all the sensors in the > % significant cluster > % TODO: Figure out how to interpret clusters > clusterTimePoints = currCluster(length(currCluster),2) - > currCluster(1,2); > sigLimit = ceil(0*clusterTimePoints); > cfg.highlight = []; > for j = 1:size(stats.posclusterslabelmat,1) > if (length(find(currCluster(:,1) == j)) > sigLimit) > cfg.highlight(size(cfg.highlight)+1) = j; > end > end > > cfg.comment = 'xlim'; > cfg.commentpos = 'title'; > > % And plot it > topoplotER(cfg, grandAvg); > end > > % Done with these > clear all; > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Mon Mar 31 17:41:14 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Mon, 31 Mar 2008 17:41:14 +0200 Subject: unbalanced mixed design Message-ID: Apropos Margriets question about a mixed design and permutation test, I tried your suggestion, but for a 2 x 2 unbalanced mixed design with the depsamplesF test because I have different numbers of subjects in a clinical and control group, and two conditions. I tried a design matrix with row 1 for condition ("1" and "2") row 2 subject number and the third row group (1 and 2). So the design matrix is 3 X 22 like this: condition: 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 subj number: 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 group: 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 2 However, the resampledesign function wants the design matrix to be constant within a block and since I have an unbalanced design this doesn't seem to be possible. Is there work around to set up the design matrix with an unbalanced design to call the F statistic for the permutations? I do not want to throw away a subject to make the design balanced because I have already so few subjects in this experiment. Thank you, Andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From stephan.bickel at ANATOM.UNIZH.CH Tue Mar 4 17:15:08 2008 From: stephan.bickel at ANATOM.UNIZH.CH (Stephan Bickel) Date: Tue, 4 Mar 2008 17:15:08 +0100 Subject: clusteranalysis inter-trial phase-locking Message-ID: Hi, I would like to use clusterrandanalysis to test significant differences of inter-trial phase-locking values between conditions, within subjects. I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs cross- and autospectra as input, to test between channel coherence differenes. I was wondering if there is a way to use this function to compute inter-trial phase locking differences. Thanks a lot for your help, Stephan PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in freqanalysis. then: frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); I hope this is ok? would it be legitimate to change clusteranalysis to accept fouriersptrm as input and introduce the phase-locking calculation step for every random partition? then compute the z-statistics in clusterstatistics with those values? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Tue Mar 4 17:59:49 2008 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 4 Mar 2008 17:59:49 +0100 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: Message-ID: Hi Stephan, > I would like to use clusterrandanalysis to test significant differences of > inter-trial phase-locking values between conditions, within subjects. > I think clusterrandanalysis, with the 'indepsamplesZcoh' configuration needs > cross- and autospectra as input, to test between channel coherence differenes. > I was wondering if there is a way to use this function to compute > inter-trial phase locking differences. I guess you want to compare the PLF/coherence values between experimental conditions. (PLF/coherence itself is calculated OVER trials, as correctly show in your code snippet below.) > PS: I compute phase-locking with output='Fourier' and keeptrials='yes', in > freqanalysis. then: > frq.plv = squeeze(abs(mean(frq.fourierspctrm./abs(frq.fourierspctrm),1))); > I hope this is ok? Yes, this is OK. However, you can improve by using spectral smoothing, preferably using multitapers. When you have a small number of very long trials this will make a big difference. Have a look in our paper (Maris, Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. > > would it be legitimate to change clusteranalysis to accept fouriersptrm as > input and introduce the phase-locking calculation step for every random > partition? then compute the z-statistics in clusterstatistics with those values? I will not change clusterrandanalysis to accept fourierspctrm data. However, I may change freqstatistics (one of the successors of clusterrandanalysis) to accept fourierspctrm data (and supporting multitapers). This could be in the form of a small collaborative project. You can find me at maris at nici.ru.nl. Greetings, Eric Maris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip > toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > See also http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tomh at KURAGE.NIMH.NIH.GOV Tue Mar 4 19:44:41 2008 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Tue, 4 Mar 2008 13:44:41 -0500 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: > Yes, this is OK. However, you can improve by using spectral smoothing, > preferably using multitapers. When you have a small number of very long > trials this will make a big difference. Have a look in our paper (Maris, > Schoffelen, Fries, 2007) in the Journal of Neuroscience Methods. By the way, congratulations on that paper. That's really good stuff but you made a spelling error on page 171. :-) I think this paper will be required reading for all NIMH MEG researchers. Dr. Tom -- Like the sail trembling with the violence of the spirit, does my wisdom cross the sea- my wild wisdom! Thus spoke Zarathustra. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Mar 5 11:08:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (Jan-Mathijs Schoffelen) Date: Wed, 5 Mar 2008 10:08:49 +0000 Subject: clusteranalysis inter-trial phase-locking In-Reply-To: <02ee01c87e19$2845bbc0$6801a8c0@fcdonders.nl> Message-ID: Dear Eric and Stephan, > I will not change clusterrandanalysis to accept fourierspctrm data. However, > I may change freqstatistics (one of the successors of clusterrandanalysis) > to accept fourierspctrm data (and supporting multitapers). This could be in > the form of a small collaborative project. Please note that freqstatistics accepts fourierspectra as an input, but I am not sure whether the underlying statistics_wrapper.m correctly deals with this. Moreover, you can code the tapers as a row in your design-vector and specifying the row-number in cfg.wvar for the correct resampling. You might want to have a look at resampledesign for this. Provided this all works the only thing which is needed is a proper statfun_xxx Yours, Jan-Mathijs ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Marcel.Bastiaansen at FCDONDERS.RU.NL Wed Mar 12 14:50:27 2008 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Wed, 12 Mar 2008 14:50:27 +0100 Subject: output of timelockstatistics Message-ID: An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 12 16:07:37 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 12 Mar 2008 16:07:37 +0100 Subject: output of timelockstatistics In-Reply-To: <47D7DFA3.7040508@fcdonders.ru.nl> Message-ID: Hi Marcel, On 12 Mar 2008, at 14:50, Marcel Bastiaansen wrote: > I used timelockstatistics (method montecarlo, i.e. cluster > randomization) to compare the significance between two erp's. > Here's the output struct. > > stats112_113 = > > prob: [30x600 double] your input consists of 30 channels and 600 timepoints. For each of the 30x600 samples a probability is computed. In your case (montecarlo and correctm=cluster) the probabilities of neighbouring chan_time points will often be identical, as they belong to the same cluster. > posclusters: [1x5 struct] There are 5 clusters with a positive summed t-value > posclusterslabelmat: [30x600 double] this contains the cluster number that each sample belongs to, or a 0 if it does not belong to a sampple. Try imagesc (stat.posclusterslabelmat) > posdistribution: [1x1000 double] This is the randomization distribution for the statistic of interest for the positive tail, i.e. the sum of the t-values in the largest cluster in each randomization. Do hist(stat.posdistribution) and look at the content of stat.poscluster(1) to see where the first cluster lies in that distribution. > > negclusters: [1x20 struct] > negclusterslabelmat: [30x600 double] > negdistribution: [1x1000 double] idem for negative clusters, except that there are 20 in total (note that not all might be significant). > mask: [30x600 logical] for each sample contains a 0 if not significant, or a 1 if significant. > stat: [30x600 double] for each sample contains the t-value (assuming that you used that as statistic). So you can do imagesc(stat.stat), and then alpha ((stat.mask+1)/2) to add some transparency. The summed cluster statsitic for the first positive cluster can be retrieved using sum (stat.stat(find(stat.posclusterslabelmat(:)==1)). This should match the content of the stat.posclusters(1) structure. > dimord: 'chan_time' > label: {30x1 cell} > time: [1x600 double] The other fields have the first dimension "channel" and second dimension "time". For freqstatistics on TFR data you would get dimord='chan_freq_time' > cfg: [1x1 struct] this was the configuration used in the computation, including all defaults that were set. See also http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting and the clusterplot function. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 17 22:04:21 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 17 Mar 2008 22:04:21 +0100 Subject: Fries-lab: 5 postdoc and 1 PhD position open Message-ID: Dear fieldtrip list members, Attached please find an job announcement for 5 postdoc and 1 PhD positions that are available in the group of Pacsal Fries at the F.C. Donders Centre. More details can be found in the attached pdf. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Jobs_PascalFries.pdf Type: application/pdf Size: 630952 bytes Desc: not available URL: From soren.r.christensen at GSK.COM Mon Mar 17 22:08:01 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 17 Mar 2008 21:08:01 +0000 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 14-Mar-2008 and will not return until 18-Mar-2008. Back 18th March ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lwn_07 at YAHOO.COM.CN Tue Mar 18 08:24:05 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Tue, 18 Mar 2008 15:24:05 +0800 Subject: Something Wrong in Trial Definition Message-ID: Hi, everyone, There was something wrong when I use the fieldtrip function 'definetrial', or exectly 'read_fcdc_event'. I first got the basic information of my data by using function 'ctf_read', and it returned data which was orgnized as <1800*185*75 double>, that is , there were 75 trials in my data. But when I defined trial by using 'definetrial', (key parameters were configured as follows: cfg.trialdef.eventtype='frontpanel trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it showed 88 trials were defined. What's more, I found the trials defined by 'definetrial' were not consecutive. SO, I want to know what' s wrong with the processing or the fucntion? Thank you for your answer! Best wishes. Li Weina --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Tue Mar 18 09:51:24 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Tue, 18 Mar 2008 09:51:24 +0100 Subject: Comparing topographies Message-ID: Dear Fieldtrip users, I would like to statistically compare the topographies of two groups of participants. Is there a way to do this in Fieldtrip? Maybe using permutation tests? Thanks for your help. Best wishes, Margriet Groen -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Mar 18 10:12:05 2008 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 18 Mar 2008 10:12:05 +0100 Subject: Comparing topographies In-Reply-To: <47DF828C.2020703@uni-hamburg.de> Message-ID: hi, take a look here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics if you want to use a permutation test, then your case is a variation of what's described under 2.2, i.e. you have to change the statistic (probably indepsamplesT) and adapt the design matrix described in the same tutorial. in the tutorial you will find descriptions on how to interpret the output. hth, n On 18.03.2008, at 09:51, Margriet Groen wrote: > Dear Fieldtrip users, > > I would like to statistically compare the topographies of two groups > of participants. Is there a way to do this in Fieldtrip? Maybe using > permutation tests? > > Thanks for your help. > > Best wishes, > > Margriet Groen > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 18 22:10:04 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 18 Mar 2008 22:10:04 +0100 Subject: Something Wrong in Trial Definition In-Reply-To: <940608.12845.qm@web15602.mail.cnb.yahoo.com> Message-ID: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.gross at PSY.GLA.AC.UK Wed Mar 19 11:26:24 2008 From: j.gross at PSY.GLA.AC.UK (Joachim Gross) Date: Wed, 19 Mar 2008 10:26:24 +0000 Subject: job advert Message-ID: *UNIVERSITY** /of/ GLASGOW** * * DEPARTMENT OF PSYCHOLOGY* *Centre for Cognitive Neuroimaging (CCNi)* * POSTDOCTORAL RESEARCH ASSISTANT* * Salary: £23,692 - £26,666 (grade 6)/£29,139 -- £32,796 (grade 7)* * REF: *14162/DPO/A3** A strategic priority of the University is the current creation within the Department of Psychology of a Centre for Cognitive Neuroimaging (CCNi), a major initiative to install an in-house platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. Equipment include a 3T fMRI scanner, a MEG system, a TMS system, and several EEG systems -- including fMRI compatible systems. Applications are invited for a Postdoctoral Research Assistant to work in the Magnetoencephalography (MEG) group in the newly established CCNi. The project "Investigating neural communication with multivariate autoregressive models" is funded by Wellcome Trust for 3 years. The successful candidate will work with Prof. Gross on the development of new analysis tools for the investigation of neural communication using MEG data. You will be involved in methods development, extensive simulations, data acquisition and analysis. You will have the opportunity to be part of a very dynamic research centre. You will have a background in Electrical Engineering, Mathematics, Neuroinformatics, Physics, Psychology, Neuroscience or a related discipline. Expertise in advanced programming (preferably with MATLAB) is important. Experience with multivariate autoregressive models and MEG/EEG is desirable. This post is available from 1 May 2008 and funding is available for 36 months. Informal enquiries may be made to Professor J Gross, (+44 (0) 141 330 3947; or email j.gross at psy.gla.ac.uk . For further details about the post and how to apply: See our website at www.glasgow.ac.uk/jobs/vacancies or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, email: c.alexander at psy.gla.ac.uk . Applications should be sent to: Clare Alexander at the above address. Closing date: 18 April 2008. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From margriet.groen at UNI-HAMBURG.DE Wed Mar 19 14:44:51 2008 From: margriet.groen at UNI-HAMBURG.DE (Margriet Groen) Date: Wed, 19 Mar 2008 14:44:51 +0100 Subject: Mixed design + permutation test Message-ID: Hi, please excuse my ignorance, but is it possible to use permutation tests with a mixed (3 conditions x 2 groups) design? Thanks, Margriet -- ================================= Dr. Margriet A. Groen Post-doctoral researcher University of Hamburg Biological Psychology and Neuropsychology Von-Melle-Park 11 20146 Hamburg Germany Phone: +49-40-42838-5838 Fax: +49-40-42838-6591 Email: margriet.groen at uni-hamburg.de Website: http://bpn.uni-hamburg.de/groen_e.html ================================= ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lwn_07 at YAHOO.COM.CN Wed Mar 19 14:54:02 2008 From: lwn_07 at YAHOO.COM.CN (=?gb2312?q?=C0=EE=CE=C0=C4=C8?=) Date: Wed, 19 Mar 2008 21:54:02 +0800 Subject: =?gb2312?Q?=BB=D8=B8=B4=A3=BA?= Re: [FIELDTRIP] Something Wrong i n Trial Definition In-Reply-To: Message-ID: Dear Robert, Thank you for your suggestion. It does help a lot. Yes, the function 'ctf_read' is from EEGLAB, I used it to obtain the basic information of the dataset. And my data was recorded trial-based. As you pointed, the problem in my trial definition was that I have multiple triggers of the same value in "a single trial". Then I defined my own trial function based on the 'trial' event, and it works out. Thanks a lot! Li Weina Robert Oostenveld 写道: Dear Li Weina I am not sure what you mean with the function "ctf_read", as that is not part of Fieldtrip. If the data was acquired continuously, then I suggest that you use read_fcdc_event and that you plot the value of each trial versus the sample event = read_fcdc_event(..) sel = find(strcmp('backpanel trigger', {event.type}); event = sevent(sel); x = cell2mat(event.sample); y = cell2mat(event.value); plot(x, y, '.') that will show the structure in the sequence of the triggers in your data. It might well be that you have multiple triggers of value "9" in your data within what you condider to be a single trial, or that some trials do not have the tigger 9 in them. If the data was acquired trial-based, then I suggest that you make your own trialfunction (cfg.trialfun) that defines the segments of interest based on the 'trial' event (i.e. search for event(i).type='trial' and use event (i).sample, duration and offset to define the begin, end and offset of each segment of interest). see "help definetrial" and e.g. http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 18 Mar 2008, at 8:24, 李卫娜 wrote: > Hi, everyone, > > There was something wrong when I use the fieldtrip function > 'definetrial', or exectly 'read_fcdc_event'. > I first got the basic information of my data by using function > 'ctf_read', and it returned data which was orgnized as <1800*185*75 > double>, that is , there were 75 trials in my data. But when I > defined trial by using 'definetrial', (key parameters were > configured as follows: cfg.trialdef.eventtype='frontpanel > trigger' ; cfg.trialdef.prestim=1; cfg.trialdef.poststim=2; > cfg.trialdef.eventvalue=9 %(obtained from 'read_fcdc_event'); ), it > showed 88 trials were defined. What's more, I found the trials > defined by 'definetrial' were not consecutive. > SO, I want to know what' s wrong with the processing or the fucntion? > Thank you for your answer! > Best wishes. > > > Li Weina > > 雅虎邮箱传递新年祝福,个性贺卡送亲朋! > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 19 16:28:02 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 19 Mar 2008 16:28:02 +0100 Subject: plotting clusters Message-ID: Hi, We have made a plotting function for the clutster analysis, but sometimes we get very weird results. For example in one dataset for a certain time period the whole head (i.e., all the sensors) belongs to a significant cluster. I have attached the m-file that we use. All of the calls to the preprocessing and stat functions have been made, so this function just takes the data and the output of those functions and plots the significant clusters. Is there anything that we are missing or have done to make the plots output something different than intended? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The plotting function for FieldTrip data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function fieldtrip_plots(ft_args) % Try to clear save('TempArgs.mat', 'ft_args'); clear all; load('TempArgs.mat'); % Grab these fprintf('Loading Stats...\n'); sFile = ''; try sFile = ft_args.statsFile; catch sFile = [ft_args.experimentName 'Stats.mat']; end fprintf('Using %s\n', sFile); load(sFile); % Load the data try dFile1 = ft_args.gAvgFile1; catch dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; end try dFile2 = ft_args.gAvgFile2; catch dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; end % Load the first fprintf('Loading Avg1...\n'); fprintf('Using %s\n', dFile1); load(dFile1); grandAvg = grandAvgData; % Load the second fprintf('Loading Avg2...\n'); fprintf('Using %s\n', dFile2); load(dFile2); grandAvg.avg = grandAvg.avg - grandAvgData.avg; fprintf('Plotting...\n'); % Sorry... Feel free to fix %fprintf('Sorry, plotting down for now. Feel free to fix it at your leisure.\n'); %return; % TTest % Find the significant clusters sigClusters = {}; for i = 1:length(stats.posclusters) if stats.posclusters(i).prob < ft_args.alpha % Find the column and row corresponding to that cluster [m,n] = find(stats.posclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end % And do the same for negative clusters for i = 1:length(stats.negclusters) if stats.negclusters(i).prob < ft_args.alpha [m,n] = find(stats.negclusterslabelmat == i); sigClusters{length(sigClusters)+1} = [m,n]; else break; end end if isempty(sigClusters) fprintf('Sorry, no significant clusters. Exiting...\n'); return; end % Get how long each sample is secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... size(stats.posclusterslabelmat,2); % And plot each significant cluster numPlots = length(sigClusters); for k = 1:numPlots % Layout the plots subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); % Get the bounds of this plot currCluster = sigClusters{k}; % Setup the config argument for plotting cfg = []; % This should be the bounds in seconds cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster(1,2) ... ft_args.stats_epoch(1) + secPerSample*currCluster(length(currCluster),2)]; % Have to have the user set for now, because not sure % how to grab from the raw data yet. cfg.zlim = ft_args.plotScale; cfg.layout='CTF275.lay'; % Want to highlight all the sensors in the % significant cluster % TODO: Figure out how to interpret clusters clusterTimePoints = currCluster(length(currCluster),2) - currCluster(1,2); sigLimit = ceil(0*clusterTimePoints); cfg.highlight = []; for j = 1:size(stats.posclusterslabelmat,1) if (length(find(currCluster(:,1) == j)) > sigLimit) cfg.highlight(size(cfg.highlight)+1) = j; end end cfg.comment = 'xlim'; cfg.commentpos = 'title'; % And plot it topoplotER(cfg, grandAvg); end % Done with these clear all; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From g.rousselet at PSY.GLA.AC.UK Wed Mar 19 18:38:47 2008 From: g.rousselet at PSY.GLA.AC.UK (Guillaume Rousselet) Date: Wed, 19 Mar 2008 17:38:47 +0000 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elo221 at MED.NYU.EDU Wed Mar 19 21:19:36 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Wed, 19 Mar 2008 16:19:36 -0400 Subject: trialdef with bdf files Message-ID: hi, It looks like fieldtrip supports Biosemi .bdf files, as well as .cnt files. Why do I get an error when calling "trialdef" for a .bdf file, but no error if i use "trialdef" for a .cnt file ? I'm using the latest version of fieldtrip. Here is the error--- Warning: Out of range value or NaN computed in integer arithmetic. > In fieldtrip-20080318\private\read_event at 400 In read_fcdc_event at 51 In fieldtrip-20080318\private\trialfun_general at 59 In definetrial at 183 ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help i know this is gotta be something easy, and i'm new at it. erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Thu Mar 20 11:38:13 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 20 Mar 2008 10:38:13 +0000 Subject: Mixed design + permutation test In-Reply-To: <893EEA7A-B01C-47CA-B6C7-8D2872BCCFBA@psy.gla.ac.uk> Message-ID: Hi Margriet, If your data is in analyse format or you can get in analyse/nifti format then FSL's randomise function can do all this for you....if you set your design matrix up properly - Suresh Suresh Muthukumaraswamy, PhD CUBRIC Cardiff University Park Place Cardiff, CF10 3AT United Kingdom email: sdmuthu at cardiff.ac.uk Phone: +44 (0)29 2087 0353 >>> Guillaume Rousselet 19/03/2008 17:38:47 >>> Hey Margriet, given your design, and if you don't plan on doing >>all<< the pairwise comparisons anyway, then you could do an ANOVA. One way to make your analysis robust to non-normality is: 1) compute F for your data 2) center your data independently for each of your 6 conditions, i.e. if your measure of central tendency is the mean then subtract the mean of one condition from each member of that condition, so that the new mean is zero 3) you just created a new dataset in which the null hypothesis is true. Now you can sample with replacement subjects (paired design) or trials (unpaired design), compute the F, and store it. 4) repeat 3) x times, for instance 1000 times. You will obtain a data driven distribution of F under the null hypothesis. 5) compare the one-tail, let say 95% confidence interval of the F under the null hypothesis to the original F obtained for non-centered data. If the original F is larger than the 95% F, then your effect is significant. This bootstrap procedure + it's validation is described here: BOOTSTRAP RESAMPLING APPROACHES FOR REPEATED MEASURE DESIGNS: RELATIVE ROBUSTNESS TO SPHERICITY AND NORMALITY VIOLATIONS BERKOVITS et al. 2000 Educational and Psychological Measurement, Vol. 60 No. 6, December 2000 877-892 More advanced coverage of robust analysis of variance can be found here: Wilcox, R. R. (2005). Introduction to Robust Estimation and Hypothesis Testing (2nd Ed. ed.): Academic Press. hope this help, GAR On 19 Mar 2008, at 13:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ************************************************************************************ Guillaume A. Rousselet, Ph.D. Lecturer Department of Psychology University of Glasgow 58 Hillhead Street Glasgow, UK G12 8QB http://web.mac.com/rousseg/iWeb/ Email: g.rousselet at psy.gla.ac.uk Fax. +44 (0)141 330 4606 Tel. +44 (0)141 330 6652 Cell +44 (0)791 779 7833 “Computers in the future may weigh no more than 1.5 tons.” Popular Mechanics, 1949 ************************************************************************************ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From elo221 at MED.NYU.EDU Mon Mar 24 21:21:10 2008 From: elo221 at MED.NYU.EDU (Erin Oakman) Date: Mon, 24 Mar 2008 16:21:10 -0400 Subject: trialdef with bdf files Message-ID: hi, The filename of my data is 'vv(P)-gamma-aod_20.bdf' When using bdf files, and the trialdef function, I received this message. process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction 'trialfun_general' ??? Error using ==> definetrial at 193 no trials were defined, see DEFINETRIAL for help If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, there is no conflict. Thanks Erin ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 12:57:13 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 12:57:13 +0100 Subject: trialdef with bdf files In-Reply-To: <1206390070.47e80d364551d@imp.med.nyu.edu> Message-ID: Hi Erin, The DEFINETRIAL function is used to determine which segments of the data are of interest. Only the segments of interest ("trials") are read from the file and preprocessed using the PREPROCESING function. In your case theer are trials defined for the cnt, but not for the bdf file. The preferred approach for using DEFINETRIAL is to supply it with your own "trialfun" (cfg.trialfun=name_of_your_function, see the documentation on the website). If you do not specify cfg.trialfun, a default trialfun will be used. There are different defaults for the different file formats. Your problem seems to be related to the trialfun for neuroscan ctf having more appropriate defaults that the trialfun for biosemi bdf. I suggest that you explicitely write your own trialfun, using read_fcdc_event. See http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:preprocessing#appendixdefining_your_ own_function_for_trial_selection and http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:examples:making_your_own_trialfun_for_conditi onal_trial_definition best regards, Robert On 24 Mar 2008, at 21:21, Erin Oakman wrote: > hi, > > The filename of my data is 'vv(P)-gamma-aod_20.bdf' > > When using bdf files, and the trialdef function, I received this > message. > > > process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction > 'trialfun_general' > ??? Error using ==> definetrial at 193 > no trials were defined, see DEFINETRIAL for help > > If I read 'vv(P)-gamma-aod_20.cnt' files into the same script, > there is no > conflict. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:10:58 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:10:58 +0100 Subject: Mixed design + permutation test In-Reply-To: <47E118D3.9070108@uni-hamburg.de> Message-ID: Hi Margriet, The fieldtrip statistics functions (timelockstatistics, freqstatistics and sourcestatistics) allow you to do this. You should specify a design matrix (cfg.design) with one row for the condition number (I suggest to use condition numbers "1", "2" and "3"), a second row with the subject number and a third row for the two group (1 and 2). Subsequently you can supply your own statistic to be tested using the montecarlo permutation approach, by specifiying cfg.method='montecarlo' and cfg.statistic='xxx'. This will cause a function to be called with the name "statfun_xxx.m". This is a function that you can easily implement yourself, including the suggestions of Guillame. Example statfuns can be found in fieldtrip/ private. The statfun gets called for each permutation of the columns of the design matrix. In your case, you want the permutations of the columns to be restricted to within the groups. The resampling/ permuting of the design matrix is done by the function fieldtrip/ private/resampledesign. If I recall correctly (please look into that function), you should specify cfg.ivar=1 (for the 3 levels of your condition), cfg.uvar=2 (for the "unit of observation", i.e. subject) and cfg.wvar=2 (for keeping the shuffles within each group). Using the fieldtrip statistics functions with your own statfun allows you to use the multiple comparison correction techniques already implemented (including max-statistic, FDR and even clustering). In case of an f-statistic, you should specify the other options correctly so that the permulation distribution is tested only one-sided. best regards, Robert On 19 Mar 2008, at 14:44, Margriet Groen wrote: > Hi, > > please excuse my ignorance, but is it possible to use permutation > tests with a mixed (3 conditions x 2 groups) design? > > Thanks, > Margriet > > -- > ================================= > Dr. Margriet A. Groen > Post-doctoral researcher > University of Hamburg > Biological Psychology and Neuropsychology > Von-Melle-Park 11 > 20146 Hamburg > Germany > > Phone: +49-40-42838-5838 > Fax: +49-40-42838-6591 > Email: margriet.groen at uni-hamburg.de > Website: http://bpn.uni-hamburg.de/groen_e.html > ================================= > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Mar 25 13:16:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 25 Mar 2008 13:16:00 +0100 Subject: plotting clusters In-Reply-To: Message-ID: Hi Andrew, There is a clusterplot function included with fieldtrip. See http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:plotting#plotting_clusters You could compare your figures to the ones from clusterplot. Note that it may very well be possible that the significant clusters in your data are very large, up to the point that most channels in a timeframe of interest are significant. E.g. think of a large ERP component, which is visible on many channels (depending on the choise of reference). But that is something that I would not neccessarily expect in the case of whole-head MEG. best regards, Robert On 19 Mar 2008, at 16:28, Andrew Smart wrote: > Hi, > > We have made a plotting function for the clutster analysis, but > sometimes > we get very weird results. For example in one dataset for a certain > time > period the whole head (i.e., all the sensors) belongs to a significant > cluster. > > I have attached the m-file that we use. All of the calls to the > preprocessing and stat functions have been made, so this function just > takes the data and the output of those functions and plots the > significant > clusters. > > Is there anything that we are missing or have done to make the > plots output > something different than intended? > > Thank you! > andy > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % The plotting function for FieldTrip data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > function fieldtrip_plots(ft_args) > > % Try to clear > save('TempArgs.mat', 'ft_args'); > clear all; > load('TempArgs.mat'); > > % Grab these > fprintf('Loading Stats...\n'); > sFile = ''; > try > sFile = ft_args.statsFile; > catch > sFile = [ft_args.experimentName 'Stats.mat']; > end > fprintf('Using %s\n', sFile); > load(sFile); > > % Load the data > try > dFile1 = ft_args.gAvgFile1; > catch > dFile1 = [ft_args.experimentName 'GrandAvgData1.mat']; > end > try > dFile2 = ft_args.gAvgFile2; > catch > dFile2 = [ft_args.experimentName 'GrandAvgData2.mat']; > end > > % Load the first > fprintf('Loading Avg1...\n'); > fprintf('Using %s\n', dFile1); > load(dFile1); > grandAvg = grandAvgData; > > % Load the second > fprintf('Loading Avg2...\n'); > fprintf('Using %s\n', dFile2); > load(dFile2); > grandAvg.avg = grandAvg.avg - grandAvgData.avg; > > fprintf('Plotting...\n'); > > % Sorry... Feel free to fix > %fprintf('Sorry, plotting down for now. Feel free to fix it at > your leisure.\n'); > %return; > > % TTest > % Find the significant clusters > sigClusters = {}; > for i = 1:length(stats.posclusters) > if stats.posclusters(i).prob < ft_args.alpha > > % Find the column and row corresponding to that cluster > [m,n] = find(stats.posclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > % And do the same for negative clusters > for i = 1:length(stats.negclusters) > if stats.negclusters(i).prob < ft_args.alpha > [m,n] = find(stats.negclusterslabelmat == i); > sigClusters{length(sigClusters)+1} = [m,n]; > else > break; > end > end > > if isempty(sigClusters) > fprintf('Sorry, no significant clusters. Exiting...\n'); > return; > end > > % Get how long each sample is > secPerSample = (ft_args.stats_epoch(2) - ft_args.stats_epoch(1)) / ... > size(stats.posclusterslabelmat,2); > > % And plot each significant cluster > numPlots = length(sigClusters); > for k = 1:numPlots > > % Layout the plots > subplot(ceil(sqrt(numPlots)), ceil(sqrt(numPlots)),k); > > % Get the bounds of this plot > currCluster = sigClusters{k}; > > % Setup the config argument for plotting > cfg = []; > > % This should be the bounds in seconds > cfg.xlim = [ft_args.stats_epoch(1) + secPerSample*currCluster > (1,2) ... > ft_args.stats_epoch(1) + secPerSample*currCluster(length > (currCluster),2)]; > > % Have to have the user set for now, because not sure > % how to grab from the raw data yet. > cfg.zlim = ft_args.plotScale; > cfg.layout='CTF275.lay'; > > % Want to highlight all the sensors in the > % significant cluster > % TODO: Figure out how to interpret clusters > clusterTimePoints = currCluster(length(currCluster),2) - > currCluster(1,2); > sigLimit = ceil(0*clusterTimePoints); > cfg.highlight = []; > for j = 1:size(stats.posclusterslabelmat,1) > if (length(find(currCluster(:,1) == j)) > sigLimit) > cfg.highlight(size(cfg.highlight)+1) = j; > end > end > > cfg.comment = 'xlim'; > cfg.commentpos = 'title'; > > % And plot it > topoplotER(cfg, grandAvg); > end > > % Done with these > clear all; > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Mon Mar 31 17:41:14 2008 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Mon, 31 Mar 2008 17:41:14 +0200 Subject: unbalanced mixed design Message-ID: Apropos Margriets question about a mixed design and permutation test, I tried your suggestion, but for a 2 x 2 unbalanced mixed design with the depsamplesF test because I have different numbers of subjects in a clinical and control group, and two conditions. I tried a design matrix with row 1 for condition ("1" and "2") row 2 subject number and the third row group (1 and 2). So the design matrix is 3 X 22 like this: condition: 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 subj number: 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 group: 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 2 However, the resampledesign function wants the design matrix to be constant within a block and since I have an unbalanced design this doesn't seem to be possible. Is there work around to set up the design matrix with an unbalanced design to call the F statistic for the permutations? I do not want to throw away a subject to make the design balanced because I have already so few subjects in this experiment. Thank you, Andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.