From d.stoffers at gmail.com Thu Jan 3 19:39:37 2013 From: d.stoffers at gmail.com (Diederick Stoffers) Date: Thu, 3 Jan 2013 19:39:37 +0100 Subject: [FieldTrip] Brain imaging PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands. Message-ID: <21E5F1A0-241E-43B6-957B-18A7767A7B51@gmail.com> Dear all, Please find attached a description of PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands, that I am posting on behalf of my group leader. Relevant keywords for this project are sleep, emotion, arousal, high-density EEG, fMRI, insomnia and internet. Cheers, Diederick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VacancyPhDCandidateBrainImaging.pdf Type: application/pdf Size: 83310 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 3 23:02:29 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 3 Jan 2013 17:02:29 -0500 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data Message-ID: Hello All, I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on this board, i.e. to use ft_connectivityanlaysis, or using tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc >From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of coherence), since when plotting cross-spectra you would need a reference channel? Thanks Russell Port Upenn Neuroscience Graduate Group -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 4 09:38:08 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Jan 2013 09:38:08 +0100 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data In-Reply-To: References: Message-ID: Dear Russell, There's an important detail that you may have glossed over, and relates indeed to the difference between PLV and ITC. ITC can be defined within a single electrode (i.e. it is a univariate measure), and it quantifies the phase consistency across observations, of oscillations relative to an event of interest. PLC can only be defined across two electrodes (i.e. it is a bivariate measure), and it quantifies the phase difference consistency across observations, of oscillations (i.e. relative to one another). The reference electrode does not count as a second electrode in this case. In other words, it looks like you can only compute ITC. In order to visualize it, you can do something like this: freqnew = freq; freqnew = rmfield(freq, 'fourierspctrm'); freqnew.powspctrm = itc; cfg = ... (build the cfg according to your needs) figure;ft_singleplotER(cfg, freqnew); Best wishes, Jan-Mathijs On Jan 3, 2013, at 11:02 PM, Russell G Port wrote: > Hello All, > > I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal > electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 > corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which > would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets > and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking > value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on > this board, i.e. to use ft_connectivityanlaysis, or using > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as > ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of > coherence), since when plotting cross-spectra you would need a reference channel? > > Thanks > Russell Port > Upenn Neuroscience Graduate Group > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Jan 4 15:50:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Jan 2013 15:50:21 +0100 (CET) Subject: [FieldTrip] Question about cluster-based statistical testing (sum of t-stats or suprathreshold t-stats?) In-Reply-To: References: <50de2ca3.e90b320a.2720.73b5SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03ae01cdea8a$d4476e90$7cd64bb0$@maris@psych.ru.nl> Dear Artemy, Importantly, these constants also enter in the permutation distribution that is used to evaluated the significance of the maximum cluster-mass statistic, to the effect that the Bullmore-style and the Fieldtrip-style permutation distributions are shifted versions of each other. As a result, the p-values that roll out of the two approaches are identical. If I understand correctly, having the same resulting p-values could only be if the two methods assign the same rank-ordering to a given a set of clusters. But I don't think that is the case. Let's imagine that the t-statistic cutoff 'c' is equal to 1, and the data contains two suprathreshold clusters (let's say this is a spatial test and the clusters are composed of electrodes): - The first cluster has 10 electrodes, each one with a t-statistic equal to 1.1 - The second cluster has 2 electrodes, both with a t-statistic equal to 3 As I understand, Bullmore's method would assign cluster 1 a mass of 10*(1.1-1) = 1 and cluster 2 a mass of 2*(3-1)=4 , while your method would assign cluster 1 a mass of 10*1.1 = 11 and cluster 2 a mass of 2*3 = 6. Hence, given a null distribution, it should be possible to choose a cluster-based threshold that indicates as significant only cluster 1 under Bullmore's method, and only cluster 2 under yours. I think your reasoning is correct: when the data contain more than one suprathreshold cluster, my argument does not apply anymore. Your example shows that the Bullmore- and Fieldtrip-style cluster statistics have different sensitivities. Thank you for pointing this out. For every test statistic, the decisions based on the permutation p-value controls the type-I error rate, but the type-II error rate (the complement of sensitivity) depends on the exact test statistic. Thanks for confirming that up. I should note, though, that this is an issue even in data without multiple suprathreshold clusters. The same logic as above -- which shows that the two measures gives different ranks to same set of clusters -- also applies to the distribution of clusters under the null hypothesis. Thus one can imagine a single cluster in the data that would be judged significant under Fieldtrip's method and not significant under Bullmore, or vice-versa. I believe that generally, in comparison to Bullmore's method, Fieldtrip's method would tend to favor judging-as-significant large clusters (with many electrodes). Sure, it also applies to the distribution of clusters under the null hypothesis and, therefore, can result in different p-values for the Fieldtrip and the Bullmore style cluster statistics, even when there is only single cluster in the data. I should have made this more explicit in my reply, especially since the distribution of clusters under the null hypothesis is random (and therefore a focus on the single-cluster-in-the-data situation is not a very useful one). I personally think of the distinction not so much in terms of controlling sensitivity, but rather as concerning the definition of what counts as a cluster of interest. Though both methods look for spatiotemoprally contiguous regions of electrodes that exceed threshold, for Bullmore the cluster is the sum of suprathreshold statistic values , while for Fieldtrip it's the sum of the entire statistic values in the region. I'm quite interested in the question of which gives more justifiable/better results in real-world settings, though unfortunately I have not seen any work done on the matter. From what I have seen in my brief forays into the extensive analytic + numerical studies of cluster-based significance testing in the fMRI literature, in that field they always refer to Bullmore-style clusters. I do think that sensitivity is a crucial concept here. Neurobiological data are almost always high-dimensional (data arrays with dimensions space, time and/or frequency), but the statistical test only answers the question whether there is some direction in this high-dimensional space along which the experimental conditions differ. It is crucial that our test statistics are chosen such that they have a high sensitivity in the directions that are neurobiologically plausible. In a recent paper in Psychophysiology (2012), I took some time to explain this issue. Note that others in the field (e.g., Karl Friston) often put forward the claim that parametric statistical tests (e.g., the t-statistic) are always more sensitive than nonparametric statistical tests. This claim only holds for scalar observations (e.g., an electrical potential measured at one electrode and one post-stimulus time), which is not the type of data neurobiological studies are typically interested in. Thanks for your interest in this issue. You ask the right questions. Also, my apologies for my earlier sloppy replies. Eric Thanks again & happy holidays... -Artemy -------------- next part -------------- An HTML attachment was scrubbed... URL: From taherahlansari at hotmail.com Fri Jan 4 18:44:42 2013 From: taherahlansari at hotmail.com (Tahereh L. Ansari) Date: Fri, 4 Jan 2013 17:44:42 +0000 Subject: [FieldTrip] RealTime fMRI _ Problem with gui_Streamer In-Reply-To: References: Message-ID: Hi,I get this error (in the cmd window of the siemens_gui_streamer): "Warning: another change on file E:/IMAGE/...xxxxx.PixelData detected - ignoring" when i've ran one scan (e.g. structural) and am now running the second scan (e.g functional)! So it seems that if 'xxxx.PixelData' is detected in E:/IMAGE, gui_streamer will NOT send it to the buffer (even though this xxxx.PixelData belongs to a new scan session!) and gives the above warning!! restarting the gui_streamer does not help either! Please help! L -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertram0611 at pku.edu.cn Sat Jan 5 09:12:28 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) Subject: [FieldTrip] =?gbk?q?Questions_about_Cluster-based_permutation_tes?= =?gbk?q?ts_on_time-frequency_data?= Message-ID: <2121284504.247.1357373548881.JavaMail.root@bj-mail07.pku.edu.cn> Dear all, I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. Thanks in advance! -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From vitoria.piai at gmail.com Sat Jan 5 11:21:34 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:21:34 +0100 Subject: [FieldTrip] When to detrend/demean Message-ID: <50E7FEAE.3080103@gmail.com> Dear ftrippers, I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? As relevant background, our EEG datasets involve speech production on every trial. We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. But in the FT example 'Reading and pre-processing EEG data', the cfg is cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. Then, when calculating ERPs, I had both demean and detrend before timelocking. But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? - preprocess with default (so NO detrend and NO demean) - then demean and detrend for ft_timelockanalysis and ft_freqanalysis Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! Vitoria From vitoria.piai at gmail.com Sat Jan 5 11:38:54 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:38:54 +0100 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data (??) In-Reply-To: References: Message-ID: <50E802BE.7040005@gmail.com> Dear Lin, There have been previous posts on that matter, for example: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004260.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html Good luck! On 1/5/2013 11:21 AM, fieldtrip-request at science.ru.nl wrote: > > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! From politzerahless at gmail.com Sat Jan 5 11:54:53 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 18:54:53 +0800 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data Message-ID: Hello Lin, Hi Lin, Yes, it's definitely possible to use the cluster-based test for a 2x2 within-subjects design, by hard-coding the main effects and the interaction. See http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html Best, Steve Politzer-Ahles > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! > -- > Lin Cai > Department of Psychology, > Peking University, > Beijing 100871, P.R.China > -------------- next part -------------- > An embedded and charset-unspecified text was scrubbed... > Name: SpamAssassinReport.txt > URL: From politzerahless at gmail.com Sat Jan 5 12:07:09 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 19:07:09 +0800 Subject: [FieldTrip] When to detrend/demean Message-ID: Hi Vitoria, This is not exactly my area of expertise, but I just wanted to point out that in other speech production ERP research I'm familiar with (such as bereitschaftspotential experiments--e.g. McArdle et al., 2009, in Clinical Neuropsychology), a baseline period somewhere before the onset of motor activity is used. (For instance, that paper used [-3 -2.5] relative to the onset of articulator movement.) However, if you're using ICA, there is an argument that ICA does better when you use the whole epoch as the baseline (or at least use a pretty long baseline) or do no baseline correction at all (David Groppe has a paper on this, Groppe et al. 2009 in NeuroImage); see e.g. http://sccn.ucsd.edu/pipermail/eeglablist/2010/003539.html. Best, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://people.ku.edu/~sjpa/ > Message: 4 > Date: Sat, 05 Jan 2013 11:21:34 +0100 > From: Vit?ria Magalh?es Piai > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] When to detrend/demean > Message-ID: <50E7FEAE.3080103 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a lot, > I thought it would be my best chance to get a good answer: When should > we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials often > include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right next > time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria From inieuwenhuis at berkeley.edu Sun Jan 6 03:24:56 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Sat, 05 Jan 2013 18:24:56 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E7FEAE.3080103@gmail.com> References: <50E7FEAE.3080103@gmail.com> Message-ID: <50E8E078.1030407@berkeley.edu> Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From bertram0611 at pku.edu.cn Sun Jan 6 06:03:47 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sun, 6 Jan 2013 13:03:47 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAgV2hlbiB0byBkZXRyZW5k?= =?utf-8?q?/demean?= In-Reply-To: <50E8E078.1030407@berkeley.edu> Message-ID: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Hi Ingrid After having seen your explaination, I want to know the relationship between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the linear detrending can reduce a linear trend due to equipment drift over longer time just as you said before. But I think the highpass filter have the same function as detrending. Am I right? If I want to do a time-frequency analysis, must I filter my raw data? I hope you can give me some advice. I have been puzzled for a long time. Thanks! Lin ----- 原始邮件 ----- 发件人: Ingrid Nieuwenhuis 收件人: fieldtrip at science.ru.nl 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) 主题: Re: [FieldTrip] When to detrend/demean Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From ith at deakin.edu.au Mon Jan 7 04:31:38 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Mon, 7 Jan 2013 03:31:38 +0000 Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: From r.oostenveld at donders.ru.nl Mon Jan 7 09:54:21 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 7 Jan 2013 09:54:21 +0100 Subject: [FieldTrip] fieldtrip website down Message-ID: Dear FieldTrip users First of all a Happy New Year to all of you! The last year has seen a steadily growth in the number of users of FieldTrip and especially in the contributions to this email discussion list. I am really happy to see so many valuable contributions from people all over the world and hope that in 2013 we can further strenghen our community. However, for the server hosting the FieldTrip website the new year did not start that well: last Saturday it was hacked. Over the weekend you may have noticed that you were redirected to an obscure website in Togo. Also some other websites hosted on this server have been compromised. We are working on restoring the server and the FieldTrip website, you can expect it to be up and running again in a few hours. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- From jm.horschig at donders.ru.nl Mon Jan 7 11:49:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 07 Jan 2013 11:49:11 +0100 Subject: [FieldTrip] MEG-EMG coherence In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> Message-ID: <50EAA827.2030101@donders.ru.nl> Dear Bethel, I don't see any potential reason why to not use the same procedure for MEG-EMG as for EEG-EMG. FieldTrip regards any signal the same, and for most analysis it does not care if it is electrical or magnetical or anything else. Best, Jörn On 12/13/2012 12:39 AM, Bethel Osuagwu wrote: > Dear all, > I am new to FieldTrip. > Is FieldTrip limited to MEG-EMG coherence computation? > I want to use FieldTrip to compute EEG-EMG coherence. The EEG and EMG data was recorded with Biosig. > What procedure do I follow to obtain the coherence. Any help will be highly appreciated. > > Thank you very much > Bethel > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.vandermeij at donders.ru.nl Mon Jan 7 13:28:01 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:28:01 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E8E078.1030407@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: Hi Vitoria, I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. The FAQs have two great example on this: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. Hope it helps! All the best, Roemer On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < inieuwenhuis at berkeley.edu> wrote: > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different pro > and cons, so depending on your hypotheses and effects, what's good in one > setup can be bad in the next. So you have to think of what the measures do, > and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or indeed > whole trial) from all samples > detrending removes linear trend (you can also remove higher order trends, > just for completeness) > > For ERPs you generally do want to demean using the baseline window, so the > effect cancels out pre-stim. You don't want to detrend here, since often > the ERP can have late components, and the signal might not be back to > baseline yet. If you detrend in such a case, you will decrease the value > samples late in the trials and increase the values during baseline. You > will tilt the data (end down thus start up). But if you expect a linear > trend due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is noisy (high > amplitude noise) at the end (due to speach artifacts), detrending might be > dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, since > subtracting a constant does not change the frequency info in the signal. I > know people do tend to detrend before freq analysis (so I also tend to do > that), but I have to admit, I don't know why really. Maybe to get rid of > the drift, so it does not end up in the low frequencies. But again, the > effect of detrending (which freqs it affects) depends how long your time > window is, and which frequencies your interested in. If you are interested > in really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit >> unclear to us. Since I trust the knowledge going around here a lot, I >> thought it would be my best chance to get a good answer: When should we >> demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on >> every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do >> complete artefact rejection with ft_rejectartifact. The trials often >> include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, >> and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >> window because I don't want to correct the signal with a specific interval >> (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial >> (always towards the end), using demean here is not a good idea (the signal >> changes induced by moving the jaws, etc., are included in the calculation). >> Is this necessarily the case or can it be fixed with subsequent >> computations (see below)? Do I need to go through artefact rejection again? >> My guess would be that the damage caused by having demean here doesn't >> change that much where the eyeblinks are and I always take quite broad >> windows to mark the artefacts, so at least for the AR I should be safe, but >> I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before >> timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the >> ft_freqanalysis after the 2011 change (removing the first order linear >> trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and >> everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next >> time from the start (assuming that I'll always have EEG speech production >> data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Mon Jan 7 13:42:37 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:42:37 +0100 Subject: [FieldTrip] =?gb2312?b?u9i4tKO6IFJlOiBXaGVuIHRvIGRldHJlbmQvZGVt?= =?gb2312?b?ZWFu?= In-Reply-To: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> References: <50E8E078.1030407@berkeley.edu> <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Message-ID: Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Mon Jan 7 14:14:48 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Mon, 07 Jan 2013 14:14:48 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: Message-ID: <50EACA48.3050509@gmail.com> Thank you Roemer, Ingrid, and Stephen. Let me see if I can summarise it all and do a last check. So for the ERPs, it's better not to detrend, especially if the signal is noisy (high amplitude noise) at the end (due to speach artifacts). I know that using demean with a baseline window is "common sense" but I'm a bit against this in many cases. For example, in my data now, I have a whole semantic context building up towards one final word, which people have to produce overtly. I can expect (intuitively, theoretically, etc.) that anticipation will be going on, inducing changes in the signal. This is relevant cognitive stuff, not noise. Yet, it is in my "baseline period" (i.e., before people get the cue to say something). If I correct against this baseline, I'll not be doing justice to my signal in my opinion. What I did instead was to collect many trials (120 on average). So even without baseline correction, my waves across conditions are lying on top of each other until a certain point before the cue. I take this as an indication that I have a good SNR and if baseline correction is just to ensure that things are the same across conditions pre-stimulus, then it suffices for me if my waves are nicely on top of each other pre-stimulus (but deviating from each other before the onset of the cue). I'd like to hear your opinion on this issue, though, if you think this still is problematic. Indeed, Roemer, I had checked these FAQs before and concluded that my TFRs passed this specific sanity check as well, but thanx for pointing out. The question that still remains is regarding demean in the preprocessing. FT page shows two possibilities. Tutorial: ft_preprocessing default (no detrend/demean). EEG specific: cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; So the baseline correction is in there already at pre-processing. But this seems more specific for a ERP follow-up analysis to me, or isn't it? Having it as in the tutorial would be the most neutral/standard way, right? So maybe I could add a note to the page, if we agree on this. Finally, having a demean using the whole trial instead already at pre-processing does not seem to create effects across conditions in later ERP and TFR analyses (without ICA), I'd conclude from this discussion, but please point out if I'm wrong. Thanx a lot once more, Cheers, Vitoria On 1/7/2013 1:43 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: When to detrend/demean (Roemer van der Meij) > 2. Re: ??? Re: When to detrend/demean (Roemer van der Meij) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 7 Jan 2013 13:28:01 +0100 > From: Roemer van der Meij > To: FieldTrip discussion list > Subject: Re: [FieldTrip] When to detrend/demean > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For frequency > analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been > can bleed into all other frequency bins in a funny but patterned way. For > detrending, the same story applies. When not detrending, the power of the > center frequency of the linear trend (this frequency is very low), can > bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why this > is so is explained shortly in the first FAQ), although in principle the > issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < > inieuwenhuis at berkeley.edu> wrote: > >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in >> (hypothesis) and which methods you're using to analyze the data (ERP or >> frequanalysis, with our without ICA). All analysis steps have different pro >> and cons, so depending on your hypotheses and effects, what's good in one >> setup can be bad in the next. So you have to think of what the measures do, >> and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some >> common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed >> whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, >> just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the >> effect cancels out pre-stim. You don't want to detrend here, since often >> the ERP can have late components, and the signal might not be back to >> baseline yet. If you detrend in such a case, you will decrease the value >> samples late in the trials and increase the values during baseline. You >> will tilt the data (end down thus start up). But if you expect a linear >> trend due to equipment drift over longer time, that can muddle the ERP >> effect, then you might want to detrend. Also when the signal is noisy (high >> amplitude noise) at the end (due to speach artifacts), detrending might be >> dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since >> subtracting a constant does not change the frequency info in the signal. I >> know people do tend to detrend before freq analysis (so I also tend to do >> that), but I have to admit, I don't know why really. Maybe to get rid of >> the drift, so it does not end up in the low frequencies. But again, the >> effect of detrending (which freqs it affects) depends how long your time >> window is, and which frequencies your interested in. If you are interested >> in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vit?ria Magalh?es Piai wrote: >> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that is still a bit >>> unclear to us. Since I trust the knowledge going around here a lot, I >>> thought it would be my best chance to get a good answer: When should we >>> demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech production on >>> every trial. >>> We read in the data, use ft_databrowser to mark the artefacts and then do >>> complete artefact rejection with ft_rejectartifact. The trials often >>> include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is pretty simple, >>> and ft_preprocessing default has no detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >>> window because I don't want to correct the signal with a specific interval >>> (and I assume this will take the whole segment then). >>> Our concern is that, given that people speak during part of the trial >>> (always towards the end), using demean here is not a good idea (the signal >>> changes induced by moving the jaws, etc., are included in the calculation). >>> Is this necessarily the case or can it be fixed with subsequent >>> computations (see below)? Do I need to go through artefact rejection again? >>> My guess would be that the damage caused by having demean here doesn't >>> change that much where the eyeblinks are and I always take quite broad >>> windows to mark the artefacts, so at least for the AR I should be safe, but >>> I'd like to check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend before >>> timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm using the >>> ft_freqanalysis after the 2011 change (removing the first order linear >>> trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity checks and >>> everything is in place (like visual alpha and gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it right next >>> time from the start (assuming that I'll always have EEG speech production >>> data with ERPs and TFRs analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >>> Vitoria >>> >>> >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > From bertram0611 at pku.edu.cn Mon Jan 7 16:14:16 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Mon, 7 Jan 2013 23:14:16 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAJ5Zue5aSN77yaIFJlOiBX?= =?utf-8?q?hen_to_detrend/demean?= In-Reply-To: Message-ID: <503107254.817.1357571656960.JavaMail.root@bj-mail07.pku.edu.cn> Hi,Roemer, Thank you very much.I benefited a lot from your explainations. Lin ----- 原始邮件 ----- 发件人: Roemer van der Meij 收件人: FieldTrip discussion list 已发送邮件: Mon, 07 Jan 2013 20:42:37 +0800 (CST) 主题: Re: [FieldTrip] 回复: Re: When to detrend/demean Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From sherrykhan78 at gmail.com Mon Jan 7 20:23:09 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Mon, 7 Jan 2013 14:23:09 -0500 Subject: [FieldTrip] MEG/EEG Post-doc position at Martinos Center, MGH/ Harvard Medical School Message-ID: POST DOCTORAL Position available at the Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA: Studying the Neuroscience of Autism Using MEG. Responsibilities: The position will involve investigating sensory processing, functional connectivity, and other processing abnormalities in autism, using MEG. Our current projects use state of the art approaches for data analysis, and include analyses of coherence, local cross-frequency coupling, graph theory methods, and other approaches to mining MEG data. There is a range of possible projects to choose from within these categories, and new approaches and ideas are welcomed. The position requires working closely with other members of the Martinos center (in particular Dr. Matti Hamalainen), as well as with other lab members, to develop, explore, improve and apply various data analysis methodologies. Multiple paradigms are routinely used in the lab, each offering opportunities for different approaches and research directions. The position will also involve running the MEG and MRI sessions. Recruitment of subjects is carried out by other members (research coordinators) in the lab. A minimum commitment of two years is required. Salary will be competitive and commensurate with experience. Ideal start date would be summer or fall of 2013. Requirements: PhD (or prior post-doc experience) in MEG/EEG data analysis/methodology or other signal processing. Background in specific aspects of neuroscience or cognitive science is not required, but is a plus. Contact: Tal Kenet, tal at nmr.mgh.harvard.edu The Massachusetts General Hospital is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 20:31:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 11:31:59 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: <50EB22AF.7040509@berkeley.edu> Hi Roemer, Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) Cheers, Ingrid On 1/7/2013 4:28 AM, Roemer van der Meij wrote: > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For > frequency analysis, it's mostly a matter of noise. If you do not > demean, the 0Hz been can bleed into all other frequency bins in a > funny but patterned way. For detrending, the same story applies. When > not detrending, the power of the center frequency of the linear trend > (this frequency is very low), can bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why > this is so is explained shortly in the first FAQ), although in > principle the issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis > > wrote: > > Hi Vitoria, > > The problem with these things is, it depends on what your > interested in (hypothesis) and which methods you're using to > analyze the data (ERP or frequanalysis, with our without ICA). All > analysis steps have different pro and cons, so depending on your > hypotheses and effects, what's good in one setup can be bad in the > next. So you have to think of what the measures do, and how that > effects your data. > > But now for some answers :) I'm just using a lot of experience and > some common sense, maybe people can add in some refs and math if > they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline > window, so the effect cancels out pre-stim. You don't want to > detrend here, since often the ERP can have late components, and > the signal might not be back to baseline yet. If you detrend in > such a case, you will decrease the value samples late in the > trials and increase the values during baseline. You will tilt the > data (end down thus start up). But if you expect a linear trend > due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is > noisy (high amplitude noise) at the end (due to speach artifacts), > detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no > effect, since subtracting a constant does not change the frequency > info in the signal. I know people do tend to detrend before freq > analysis (so I also tend to do that), but I have to admit, I don't > know why really. Maybe to get rid of the drift, so it does not end > up in the low frequencies. But again, the effect of detrending > (which freqs it affects) depends how long your time window is, and > which frequencies your interested in. If you are interested in > really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is > still a bit unclear to us. Since I trust the knowledge going > around here a lot, I thought it would be my best chance to get > a good answer: When should we demean/detrend? > > As relevant background, our EEG datasets involve speech > production on every trial. > We read in the data, use ft_databrowser to mark the artefacts > and then do complete artefact rejection with > ft_rejectartifact. The trials often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty > simple, and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', > the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the > baseline window because I don't want to correct the signal > with a specific interval (and I assume this will take the > whole segment then). > Our concern is that, given that people speak during part of > the trial (always towards the end), using demean here is not a > good idea (the signal changes induced by moving the jaws, > etc., are included in the calculation). Is this necessarily > the case or can it be fixed with subsequent computations (see > below)? Do I need to go through artefact rejection again? My > guess would be that the damage caused by having demean here > doesn't change that much where the eyeblinks are and I always > take quite broad windows to mark the artefacts, so at least > for the AR I should be safe, but I'd like to check that with > you guys. > > Then, when calculating ERPs, I had both demean and detrend > before timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm > using the ft_freqanalysis after the 2011 change (removing the > first order linear trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity > checks and everything is in place (like visual alpha and > gamma, etc.)? > > And my last question, for once and for all, so that I get it > right next time from the start (assuming that I'll always have > EEG speech production data with ERPs and TFRs analysed). Is > this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and > ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best > for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:01:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:01:34 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <7454504B-42D8-4703-835D-C631A046015D@donders.ru.nl> Hi Ingrid, Please feel free to update the text in the FAQs ;-). You understand it perfectly so go ahead. Two tiny remarks from 'spuit elf', as we say in Dutch: - removing a polynomial of order 1 also takes out the constant term, so it also demeans. - actually, there is an error in the text of the FAQ, because FT's default behavior is to remove a zero-order polynomial, so it only demeans. If you want detrending, you should either do this in ft_preprocessing, or specify the appropriate option in ft_freqanalysis. Best wishes, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:07:49 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:07:49 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: Dear Ingrid and others, I forgot to mention, the default has changed one year ago, according to the following thread on the list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html Apologies for not having updated the FAQ. Ingrid, would you mind giving this a shot? Best, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 22:53:19 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 13:53:19 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <50EB43CF.3040705@berkeley.edu> Thanks JM, all clear now. FAQ updated: Done! Cheers, Ingrid On 1/7/2013 12:07 PM, jan-mathijs schoffelen wrote: > Dear Ingrid and others, > > I forgot to mention, the default has changed one year ago, according > to the following thread on the list: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html > > Apologies for not having updated the FAQ. Ingrid, would you mind > giving this a shot? > > Best, > > Jan-Mathijs > > > > On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > >> Hi Roemer, >> >> Thanks for pointing to these questions. I'm a little bit confused >> about the default behavior with cfg.polyremoval as described there. >> So it seems the default of polyremoval for ft_freqanalysis is 1, >> meaning detrending always happens unless you specify otherwise, >> correct? So that means you don't have to call preprocessing with >> cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = >> 'yes' in preprocessing? Or does removing the linear trend (which is >> the default) in ft_freqanalysis automatically also demean the data? >> From the text under the figure in >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it >> almost looks that way. Because it talks about cfg.polyremoval in the >> context of demeaning, not detrending. I don't find that text very >> clear by the way. Also, the title above the figure says "TFR before >> (left) and after (right) subtracting the DC component in the time >> domain", while when I look at the code it seems it should be "TFR of >> channel with large DC component (left) and channel without DC >> component (right) after ft_freqanalysis without demeaning". I'd be >> happy to update the FAQ, but first wanted to check whether I >> understand correctly :) >> >> Cheers, >> Ingrid >> >> >> On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >>> Hi Vitoria, >>> >>> I have only one thing to add to Ingrid's clear explanation. For >>> frequency analysis, it's mostly a matter of noise. If you do not >>> demean, the 0Hz been can bleed into all other frequency bins in a >>> funny but patterned way. For detrending, the same story applies. >>> When not detrending, the power of the center frequency of the linear >>> trend (this frequency is very low), can bleed into other bins. >>> >>> The FAQs have two great example on this: >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >>> >>> Both are specific for when using 'mtmconvol' as frequency method >>> (why this is so is explained shortly in the first FAQ), although in >>> principle the issues could also occur using the other methods. >>> >>> Hope it helps! >>> >>> All the best, >>> Roemer >>> >>> >>> >>> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis >>> > wrote: >>> >>> Hi Vitoria, >>> >>> The problem with these things is, it depends on what your >>> interested in (hypothesis) and which methods you're using to >>> analyze the data (ERP or frequanalysis, with our without ICA). >>> All analysis steps have different pro and cons, so depending on >>> your hypotheses and effects, what's good in one setup can be bad >>> in the next. So you have to think of what the measures do, and >>> how that effects your data. >>> >>> But now for some answers :) I'm just using a lot of experience >>> and some common sense, maybe people can add in some refs and >>> math if they know :) >>> Demeaning just subtracts the mean of the specified time window >>> (or indeed whole trial) from all samples >>> detrending removes linear trend (you can also remove higher >>> order trends, just for completeness) >>> >>> For ERPs you generally do want to demean using the baseline >>> window, so the effect cancels out pre-stim. You don't want to >>> detrend here, since often the ERP can have late components, and >>> the signal might not be back to baseline yet. If you detrend in >>> such a case, you will decrease the value samples late in the >>> trials and increase the values during baseline. You will tilt >>> the data (end down thus start up). But if you expect a linear >>> trend due to equipment drift over longer time, that can muddle >>> the ERP effect, then you might want to detrend. Also when the >>> signal is noisy (high amplitude noise) at the end (due to speach >>> artifacts), detrending might be dangerous. >>> >>> For frequency analysis, demeaning has (as far as I know) no >>> effect, since subtracting a constant does not change the >>> frequency info in the signal. I know people do tend to detrend >>> before freq analysis (so I also tend to do that), but I have to >>> admit, I don't know why really. Maybe to get rid of the drift, >>> so it does not end up in the low frequencies. But again, the >>> effect of detrending (which freqs it affects) depends how long >>> your time window is, and which frequencies your interested in. >>> If you are interested in really low frequencies, detrending >>> might change your effects. >>> >>> Hope this helps somewhat, >>> Ingrid >>> >>> >>> >>> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >>> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that >>> is still a bit unclear to us. Since I trust the knowledge >>> going around here a lot, I thought it would be my best >>> chance to get a good answer: When should we demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech >>> production on every trial. >>> We read in the data, use ft_databrowser to mark the >>> artefacts and then do complete artefact rejection with >>> ft_rejectartifact. The trials often include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is >>> pretty simple, and ft_preprocessing default has no >>> detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', >>> the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the >>> baseline window because I don't want to correct the signal >>> with a specific interval (and I assume this will take the >>> whole segment then). >>> Our concern is that, given that people speak during part of >>> the trial (always towards the end), using demean here is not >>> a good idea (the signal changes induced by moving the jaws, >>> etc., are included in the calculation). Is this necessarily >>> the case or can it be fixed with subsequent computations >>> (see below)? Do I need to go through artefact rejection >>> again? My guess would be that the damage caused by having >>> demean here doesn't change that much where the eyeblinks are >>> and I always take quite broad windows to mark the artefacts, >>> so at least for the AR I should be safe, but I'd like to >>> check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend >>> before timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm >>> using the ft_freqanalysis after the 2011 change (removing >>> the first order linear trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity >>> checks and everything is in place (like visual alpha and >>> gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it >>> right next time from the start (assuming that I'll always >>> have EEG speech production data with ERPs and TFRs >>> analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and >>> ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the >>> best for 2013! >>> Vitoria >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Roemer van der Meij M.Sc. >>> PhD Candidate >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3655932 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Jan 8 03:46:01 2013 From: octavian.lie at gmail.com (octavian lie) Date: Mon, 7 Jan 2013 20:46:01 -0600 Subject: [FieldTrip] Import Cartool & Brainstorm Message-ID: > > Dear All, > > > > I am new to Fieldtrip, Is there a way to import Cartool .eph files and .els channel files? Also, how about importing Brainstorm files (brainstorm typically exports files in .mat format, regardless of the data type (MRI, sensors, recording, source solutions, etc). Thank you, Octavian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Jan 9 01:39:22 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 9 Jan 2013 00:39:22 +0000 Subject: [FieldTrip] FW: Tutorial EEG data processing for ERP analysis In-Reply-To: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DCB3@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I was not sure whether this email reached everyone as the server has been down for a few days. So I am resending it. Could anyone please give me some suggestions on my queries? Thank you very much! Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of IMALI THANUJA HETTIARACHCHI Sent: Monday, 7 January 2013 2:32 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From Christos.Papadelis at childrens.harvard.edu Wed Jan 9 16:17:39 2013 From: Christos.Papadelis at childrens.harvard.edu (Papadelis, Christos) Date: Wed, 9 Jan 2013 15:17:39 +0000 Subject: [FieldTrip] Special Issue in FRONTIERS IN HUMAN NEUROSCIENCE Message-ID: <876E0E5B34DB6A4DBD0E65B9091B435010E0933E@CHEXMBX2A.CHBOSTON.ORG> In collaboration with Frontiers in Neurology, we are currently organizing a Research Topic, "Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development", and as host editors we think that your work could make an excellent contribution. The proposed structure of this Research Topic is provided below. Although MEG studies will be the main focus of the research topic, articles concerning studies that use other state-of-the-art neuroimaging methods for examining the normal and abnormal human brain development are also welcome. Host Specialty: Frontiers in Human Neuroscience (Impact Factor: 2.339) Research Topic Title: Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development Topic Editors: Christos Papadelis, Patricia Ellen Grant, Yoshio Okada, Hubert Preissl Description: Research on the human brain development has seen an upturn in the past years mostly due to novel neuroimaging tools that became available to study the anatomy and function of the developing brain. Magnetic Resonance Imaging (MRI) and Diffusion Tensor Imaging (DTI) are beginning to be used more frequently in children to determine the gross anatomy and structural connectivity of their brain. Functional MRI and Near-Infrared Spectroscopy (NIRS) determine the hemodynamics and electroencephalography (EEG) the electrophysiological functions of the developing human brain. Magnetoencephalography (MEG) complements EEG as the only other technique capable of directly measuring the developing brain electrophysiology. Although MEG is still being used relatively rarely in pediatric studies, the recent development in this technology is beginning to demonstrate its utility in both basic and clinical neurosciences. MEG seems to be quite attractive for pediatric use, since it measures the human brain activity in an entirely passive manner without possessing any conceivable risk to the developing tissue. MEG sessions generally require minimal patient preparation, and the recordings are extremely well tolerated from children. Biomagnetic techniques also offer an indirect way to assess the functional brain and heart activity of fetuses in humans in utero by measuring the magnetic field outside the maternal abdomen. Magnetic field produced by the electrical activity in the heart and brain of the fetus is not attenuated by the vernix, a waxy film covering its entire skin. A biomagnetic instrument specifically designed for fetal studies has been developed for this purpose. Fetal MEG studies using such a system have shown that both spontaneous brain activity and evoked cortical activity can be measured from outside the abdomen of pregnant mothers. Fetal MEG may become clinically very useful for implementation and evaluation of intervention programs in at-risk populations. Biomagnetic instruments have also been developed for specifically measuring the brain activity in newborns, infants and older children. MEG studies have shown the usefulness of MEG for localizing active regions in the brain and also for tracking the longitudinal maturation of various sensory systems. Studies of pediatric patients are beginning to show interesting functional pathology in autism spectrum disorder, cerebral palsy, epilepsy and other types of neurological and psychiatric disorders (Down syndrome, traumatic brain injury, Tourette syndrome, hearing deficits, childhood migraine). We propose to compile the state of the art MEG studies focused on pediatric population in both health and disease. Researchers either engaged with human brain development research, clinical applications of MEG with or without EEG, or methodological developments will be invited to submit original research articles, reviews, case reports, or opinion pieces. Articles concerning studies that use other neuroimaging methods for studying the normal and abnormal human brain development are also welcome. We believe a review of the recent studies of human brain development using MEG is quite timely, since we are witnessing advances not only in the instrumentation optimized for the pediatric population, but also in the research based on various types of MEG systems designed for both human fetuses in utero and neonates and older children. Abstract Submission Deadline: Jun 01, 2013 Article Submission Deadline: Oct 01, 2013 For more information about this topic and Frontiers in Human Neuroscience, please visit: http://www.frontiersin.org/Human_Neuroscience/researchtopics/Magnetoencephalography_an_emer/1351 Should you choose to participate, please confirm by sending us a quick email and then your abstract no later than Jun 01, 2013 using the following link: http://www.frontiersin.org/submissioninfo With best regards, CHRISTOS PAPADELIS Instructor of Neurology, Harvard Medical School, Boston Children's Hospital ELLEN GRANT Associate Professor of Radiology, Harvard Medical School, Boston Children's Hospital Founding Director, Fetal-Neonatal Neuroimaging & Developmental Science Center (FNNDSC) YOSHIO OKADA Clinical Professor of Neurology, Harvard Medical School Director, MEG Program, Boston Children's Hospital HUBERT PREISSL Assistant Professor, MEG-Center, University of Tubingen, Germany Research Associate Professor, Department of Obstetrics and Gynecology, University of Arkansas for Medical Sciences, Little Rock, USA From arno at cerco.ups-tlse.fr Thu Jan 10 08:08:05 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:08:05 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> Message-ID: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Hi Dave and Robert, By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) The issue is that the Windows 32 bit version uses read_eep_trg.dll to read triggers and that the 64 bit version uses read_eep_trg.m (programmed by Robert) now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. Just so you know, Arno On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > >> Thanks, Arno, >> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >> >> EEGLAB error in function loadeep() at line 75 >> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >> >> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >> >> Do you have any suggestions? >> -Dave >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>> Dear Dave, >>> >>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>> >>> Hope this helps. >>> Best wishes, >>> >>> Arno >>> >>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>> >>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>> >>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>> >>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>> >>>> Dave Britton >>>> City College of New York >>>> Psychology Dept. >>>> >>>> Here is the error message I get: >>>> >>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>> Invalid MEX-file >>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>> libeep.so.3: cannot open shared object file: No such file or directory >>>> >>>> Error in ft_read_header (line 627) >>>> hdr = read_eep_cnt(filename, 1, 1); >>>> >>>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 08:33:50 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 09:33:50 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: by the way, did anyone decode the .seg file? it has the beginning time of segments but it is in seconds since 1900 or so. thanks, yuval On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 > bit version of the software when importing events (scaling of time was in > second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to *delete read_eep_trg.dll*, which does not bring > much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. > Previous versions of the libraries and mex files were hard to compile, but > I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared > libraries. This is the best way for having them, because then you don't > have to bother with the shared library path. I guess that this would also > work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out > of the box again, so I will file this as bug (see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all > three common (win/linux/.osx) platforms and in 32 and 64 bit versions will > take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > > Thanks, Arno, > > I've installed the ant-eep import files into the EEGLAB plugin directory, > but EEGLAB gives me the same error message as I got with FieldTrip: > > > EEGLAB error in function loadeep() at line 75 > > Invalid MEX-file > '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': > libeep.so.3:cannot open shared object file:No such file or directory > > > The libeep.so.3 file is copied into the same directory as the > read_eep_cnt.mexa64 file. > > > Do you have any suggestions? > > -Dave > > > > On 12/18/2012 12:38 PM, Arnaud Delorme wrote: > > Dear Dave, > > > last time I have checked FileIO (the Fieldtrip data importer) will not > read ANT trigger files by default (it should read the raw data though - > Robert Oostenveld one of the main developer of Fieldtrip was interning at > ANT about 10 years ago and wrote the Matlab import function for them). > > The anteepimport1.09 is a plugin for the EEGLAB software. It can import > events (and then you can save the data in EEGLAB format and reload it in > Fieldtrip). You cannot recompile the ANT project (their source files are > proprietary and not included). > > > Hope this helps. > > Best wishes, > > > Arno > > > On 18 Dec 2012, at 08:59, Dave Britton wrote: > > > I am trying to process EEG data in .cnt files obtained from the ANT > system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have > installed the Linux 64 bit version of FieldTrip. > > > What is required to successfully process ANT eeg .cnt and .trg files? The > libraries that came with the FieldTrip download did not work as it came > from the download, and my investigations led me to what should be the > latest version of the ANT import library. I have downloaded the latest ANT > eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make > install, successfully, but MATLAB cannot find the shared object file it > should generate, even when I link the .so.3 file into the same directory as > the MATLAB m-file and the MATLAB current directory. > > > Initially the system was unable to read the cnt files, which is why I > attempted to reinstall the anteepimort library. Is there more to this > installation than the standard" configure, make, make install" process? Any > clues would be appreciated! > > > Dave Britton > > City College of New York > > Psychology Dept. > > > Here is the error message I get: > > > cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; > > cfg.hdr = ft_read_header(cfg.headerfile); > > Invalid MEX-file > > > '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': > > libeep.so.3: cannot open shared object file: No such file or directory > > > Error in ft_read_header (line 627) > > hdr = read_eep_cnt(filename, 1, 1); > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Thu Jan 10 08:42:10 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:42:10 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: I think the .seg file should not be used (it is internal to the ASA software). Only the .trg file should be used. If you modify the .trg file though (move events), you need to remove the .seg file or ASA will use the .seg file to set the events in its graphic interface. All based on memory so I could be wrong. Arno On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >>> Thanks, Arno, >>> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >>> >>> EEGLAB error in function loadeep() at line 75 >>> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >>> >>> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >>> >>> Do you have any suggestions? >>> -Dave >>> >>> >>> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>>> Dear Dave, >>>> >>>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>>> >>>> Hope this helps. >>>> Best wishes, >>>> >>>> Arno >>>> >>>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>>> >>>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>>> >>>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>>> >>>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>>> >>>>> Dave Britton >>>>> City College of New York >>>>> Psychology Dept. >>>>> >>>>> Here is the error message I get: >>>>> >>>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>>> Invalid MEX-file >>>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>>> libeep.so.3: cannot open shared object file: No such file or directory >>>>> >>>>> Error in ft_read_header (line 627) >>>>> hdr = read_eep_cnt(filename, 1, 1); >>>>> >>>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 09:40:06 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 10:40:06 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: If you don't use the seg file, how do you know where the data is segmented? it is important when filtering raw data for example, where you have traces which and at certain y value and continue at a very different one the next sample. reading the data with fieldtrip currently doesn't let you know where the data is segmented which can sometime develop into a serious headache. If anyone have overcome this issue before please share with us. On 10 January 2013 09:42, Arnaud Delorme wrote: > I think the .seg file should not be used (it is internal to the ASA > software). > Only the .trg file should be used. > If you modify the .trg file though (move events), you need to remove the > .seg file or ASA will use the .seg file to set the events in its graphic > interface. > All based on memory so I could be wrong. > > Arno > > On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or > so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > >> Hi Dave and Robert, >> >> By the way, after much research, we figured out there was a bug for the >> 32 bit version of the software when importing events (scaling of time was >> in second instead of milliseconds) >> The issue is that the Windows 32 bit version uses >> >> read_eep_trg.dll >> >> to read triggers and that the 64 bit version uses >> >> read_eep_trg.m >> >> (programmed by Robert) >> now I would suggest to *delete read_eep_trg.dll*, which does not bring >> much speed anyway. >> Just so you know, >> >> Arno >> >> On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: >> >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of >> libeep. Previous versions of the libraries and mex files were hard to >> compile, but I have just given it another try and after a few attempts I >> ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared >> libraries. This is the best way for having them, because then you don't >> have to bother with the shared library path. I guess that this would also >> work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out >> of the box again, so I will file this as bug (see >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all >> three common (win/linux/.osx) platforms and in 32 and 64 bit versions will >> take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >> Thanks, Arno, >> >> I've installed the ant-eep import files into the EEGLAB plugin directory, >> but EEGLAB gives me the same error message as I got with FieldTrip: >> >> >> EEGLAB error in function loadeep() at line 75 >> >> Invalid MEX-file >> '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': >> libeep.so.3:cannot open shared object file:No such file or directory >> >> >> The libeep.so.3 file is copied into the same directory as the >> read_eep_cnt.mexa64 file. >> >> >> Do you have any suggestions? >> >> -Dave >> >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >> >> Dear Dave, >> >> >> last time I have checked FileIO (the Fieldtrip data importer) will not >> read ANT trigger files by default (it should read the raw data though - >> Robert Oostenveld one of the main developer of Fieldtrip was interning at >> ANT about 10 years ago and wrote the Matlab import function for them). >> >> The anteepimport1.09 is a plugin for the EEGLAB software. It can import >> events (and then you can save the data in EEGLAB format and reload it in >> Fieldtrip). You cannot recompile the ANT project (their source files are >> proprietary and not included). >> >> >> Hope this helps. >> >> Best wishes, >> >> >> Arno >> >> >> On 18 Dec 2012, at 08:59, Dave Britton wrote: >> >> >> I am trying to process EEG data in .cnt files obtained from the ANT >> system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have >> installed the Linux 64 bit version of FieldTrip. >> >> >> What is required to successfully process ANT eeg .cnt and .trg files? The >> libraries that came with the FieldTrip download did not work as it came >> from the download, and my investigations led me to what should be the >> latest version of the ANT import library. I have downloaded the latest ANT >> eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make >> install, successfully, but MATLAB cannot find the shared object file it >> should generate, even when I link the .so.3 file into the same directory as >> the MATLAB m-file and the MATLAB current directory. >> >> >> Initially the system was unable to read the cnt files, which is why I >> attempted to reinstall the anteepimort library. Is there more to this >> installation than the standard" configure, make, make install" process? Any >> clues would be appreciated! >> >> >> Dave Britton >> >> City College of New York >> >> Psychology Dept. >> >> >> Here is the error message I get: >> >> >> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >> >> cfg.hdr = ft_read_header(cfg.headerfile); >> >> Invalid MEX-file >> >> >> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >> >> libeep.so.3: cannot open shared object file: No such file or directory >> >> >> Error in ft_read_header (line 627) >> >> hdr = read_eep_cnt(filename, 1, 1); >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdnewman at indiana.edu Thu Jan 10 15:23:43 2013 From: sdnewman at indiana.edu (sdnewman at indiana.edu) Date: Thu, 10 Jan 2013 09:23:43 -0500 Subject: [FieldTrip] matlab crashes Message-ID: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Hello fieldtrippers, I am trying again to read in data. I'm using a linux machine with Matlab 2009 installed and I have downloaded fieldtrip-20130107. Whenever I try to do anything matlab crashes and complains that an error was detected while a mex-file was running. I checked the frequently asked questions and I can't find the *.c files suggested to recompile. Please help me. Sharlene From polomacnenad at gmail.com Thu Jan 10 19:56:07 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 10 Jan 2013 19:56:07 +0100 Subject: [FieldTrip] induced activity Message-ID: Hi, I would like to calculate induced time frequency activity for my MEG data. I plan to do it as follows. First I calculate total time-frequency for every single trial. Second, I calculate evoked activity with ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from every trial total activity. And finally I average these differences. I believe this is correct way... My problem is how to subtract evoked.powspctrm(3-D matrix) from total.powspctrm(4-D matrix). Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From sherrykhan78 at gmail.com Thu Jan 10 20:59:02 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Thu, 10 Jan 2013 14:59:02 -0500 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: Dear Nenad please use repmat evoked.powspctrm(3-D matrix) to match dimension of epochs in total.powspctrm(4-D matrix). Some thing like this TF_mean=repmat(evoked.powspctrm,[ 1 1 1 nEpochs]); TF_mean=permute(TF_mean,[4 1 2 3]); TF_induced=total.powspctrm-TF_mean; Induced=(squeeze(mean(abs(TF_induced)))); *This will only work if you have complex TF matrices* Sheraz Martinos Center Induced=(squeeze(mean(abs(TF_induced)))); On Thu, Jan 10, 2013 at 1:56 PM, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG data. > I plan to do it as follows. First I calculate total time-frequency for > every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from > every trial total activity. And finally I average these differences. I > believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Thu Jan 10 21:22:51 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Thu, 10 Jan 2013 23:22:51 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi I have a question on EEG preprocessing. The sampling rate of my 64 channel EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz.My question is, i it advisable to low-pass filter the data first (70 Hz) and then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing effect or should I down-sample first and then band-pass filter the data (0.5-70 Hz) ? Or does the sequence really matter ?I am new to EEG data analysis so this question might be really basic, but any help is highly appreciated! ThanksSubbu -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 10 22:39:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 10 Jan 2013 22:39:45 +0100 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: <50EF3521.20003@uni-leipzig.de> On 10/01/2013 19:56, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG > data. I plan to do it as follows. First I calculate total time-frequency > for every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity > from every trial total activity. And finally I average these > differences. I believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > Hi Nenad, Another common approach is to first compute the ERP/ERF and then subtract it from each trial before performing the time-frequency transformations. This seems to be the more common approach I see in the literature, at least in a lot of EEG gamma band studies. Personally, I've found that doing the subtraction in the frequency domain (i.e. subtracting the power spectrum of the evoked activity from each trial) can give some odd looking results. There tends not to be a whole lot of difference between total and induced (ERP-subtracted) in my experience, so I stick with total rather than worry about subtracting something *into* the data. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From david.m.groppe at gmail.com Fri Jan 11 04:36:44 2013 From: david.m.groppe at gmail.com (David Groppe) Date: Thu, 10 Jan 2013 22:36:44 -0500 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: You need to low-pass filter the data before downsaple to avoid aliasing. The matlab function decimate.m can do this for you. cheers, -David On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: > Hi > > I have a question on EEG preprocessing. The sampling rate of my 64 channel > EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. > My question is, i it advisable to low-pass filter the data first (70 Hz) and > then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing > effect or should I down-sample first and then band-pass filter the data > (0.5-70 Hz) ? Or does the sequence really matter ? > I am new to EEG data analysis so this question might be really basic, but > any help is highly appreciated! > > Thanks > Subbu > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/ From jm.horschig at donders.ru.nl Fri Jan 11 08:37:23 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 11 Jan 2013 08:37:23 +0100 Subject: [FieldTrip] matlab crashes In-Reply-To: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> References: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Message-ID: <50EFC133.2000206@donders.ru.nl> Dear Sharlene, I'd first try to download FieldTrip again to verify that it's not just some corrupt file. Most of the source code is in the src/ subfolder, maybe have a look there again. If the source code is not in FieldTrip, then the mex file must be in some external toolbox that we cannot take care of. In any case, if the error persists after downloading FT again, it might be wise to tell us precisely what kind of data you want to read it (otherwise we don't know what file you are talking about). Best, Jörn On 1/10/2013 3:23 PM, sdnewman at indiana.edu wrote: > Hello fieldtrippers, > > I am trying again to read in data. I'm using a linux machine with > Matlab 2009 installed and I have downloaded fieldtrip-20130107. > Whenever I try to do anything matlab crashes and complains that an > error was detected while a mex-file was running. I checked the > frequently asked questions and I can't find the *.c files suggested to > recompile. Please help me. > > Sharlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Jan 11 09:37:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Jan 2013 09:37:35 +0100 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298@donders.ru.nl> Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > David Groppe, Ph.D. > Postdoctoral Researcher > North Shore LIJ Health System > New Hyde Park, New York > http://www.cogsci.ucsd.edu/~dgroppe/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Fri Jan 11 12:35:32 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Fri, 11 Jan 2013 14:35:32 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi Jan-Mathijs and David Thanks for the reply. I will low-pass filter first and the do the down-sampling.Thanks again! Date: Fri, 11 Jan 2013 09:37:35 +0100 From: jan-mathijs schoffelen To: FieldTrip discussion list Subject: Re: [FieldTrip] EEG preprocessing Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.curado at yahoo.com.br Fri Jan 11 14:00:14 2013 From: marco.curado at yahoo.com.br (Marco Curado) Date: Fri, 11 Jan 2013 05:00:14 -0800 (PST) Subject: [FieldTrip] MNI grid alignment in subjects for group comparison Message-ID: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Dear Fieldtrip experts, I have a question on MNI aligned grids for subjects head prior to source reconstruction. In my experimental design, there are three experimental conditions (A, B and C) I want to compare in one group of subjects at the source level. To be able to compare source activity (by LCMV beamforming) among them, I use the MNI grid warped in every subject's head (to allow comparison at the source level) as stated in the tutorial "Create MNI-aligned grids in individual head-space": http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Up to now, everything is ok. But as I am naive in beamforming, I am a bit confused on the last sentence of this tutorial, where it is stated: "You can use these single subjects' MNI grids in source analysis. After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." My question (indeed very basic) is what is exactly referred as the subject's source? Is it the final source localization after LCMV? I.e., do I need to insert such template_grid parameters in subject's parameter as last step after all source localization? Summing up: The procedure would be to use the .grid from the subject (already warped with MNI grid) for source localization with LCMV and after it I include these parameters from the template-grid? Thanks a lot for your comprehension and attention to my question - I hope I was clear in my issue. My best wishes of an excellent year to everybody, Marco Curado -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Fri Jan 11 14:21:02 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 11 Jan 2013 14:21:02 +0100 Subject: [FieldTrip] induced activity Message-ID: Dear Sheraz and Matt, Thank you for your answers! I think I will use Matt's suggestion. The only thing I would like to know is when you subtract ERF from single trial, do you use baseline corrected ERF or not? All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Fri Jan 11 17:50:32 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Fri, 11 Jan 2013 17:50:32 +0100 Subject: [FieldTrip] MNI grid alignment in subjects for group comparison In-Reply-To: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> References: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Message-ID: Dear Marco, I agree that sentence is not phrased ideally. It is refering to the source data structure, i.e. the output of ft_sourceanalysis. Specifically, copy the template_grid.pos to source.pos and then this updated source data structure can be used in ft_sourcegrandaverage. Likewise,it can be overlaid on the MNI brain. I'm not sure if the other fields are necessary, if they are, maybe someone else can comment. Best, Johanna 2013/1/11 Marco Curado > Dear Fieldtrip experts, > > I have a question on MNI aligned grids for subjects head prior to source > reconstruction. > > In my experimental design, there are three experimental conditions (A, B > and C) I want to compare in one group of subjects at the source level. To > be able to compare source activity (by LCMV beamforming) among them, I use > the MNI grid warped in every subject's head (to allow comparison at the > source level) as stated in the tutorial "Create MNI-aligned grids in > individual head-space": > > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Up to now, everything is ok. But as I am naive in beamforming, I am a bit > confused on the last sentence of this tutorial, where it is stated: > > "You can use these single subjects' MNI grids in source analysis. After > that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the > template_grid onto the subjects's source, which is thereby in MNI > coordinates." > > My question (indeed very basic) is what is exactly referred as the > subject's source? Is it the final source localization after LCMV? I.e., do > I need to insert such template_grid parameters in subject's parameter as > last step after all source localization? > Summing up: The procedure would be to use the .grid from the subject > (already warped with MNI grid) for source localization with LCMV and after > it I include these parameters from the template-grid? > > Thanks a lot for your comprehension and attention to my question - I hope > I was clear in my issue. > My best wishes of an excellent year to everybody, > Marco Curado > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Sat Jan 12 01:22:03 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 11 Jan 2013 18:22:03 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity Message-ID: Dear fieldtrip experts, I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. thanks Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Jan 14 21:14:23 2013 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 14 Jan 2013 20:14:23 +0000 Subject: [FieldTrip] Electrode location structure Message-ID: Dear FieldTrip users, I would like to define the positions of the EEG electrodes myself. I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. I’m trying to use the ft_prepare_layout() function. Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. Many thanks, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Mon Jan 14 21:43:26 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Mon, 14 Jan 2013 22:43:26 +0200 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <50F46DEE.6010802@tut.fi> On 14/01/2013 22:14, Emma Holmes wrote: > > Dear FieldTrip users, > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. > > I'm trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > > Here, I'm referring to the part of the documentation 'cfg.elec: > structure with electrode positions', but can't seem to find any > explanation of what the layout of this structure should be. > > Many thanks, > > Emma > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Hello First create a structure called elec with two fields in int elec.pnt -> N x 3 matrix -> electrode positions elec.label - > 1 x N cell -> electrode label Then you can write the following script cfg = [] cfg.elec = elec; lay = ft_prepare_layout(cfg, data); where data is as provided by ft_preprocessing etc Hope this works. -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Jan 14 21:47:26 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A.) Date: Mon, 14 Jan 2013 21:47:26 +0100 (CET) Subject: [FieldTrip] Electrode location structure In-Reply-To: Message-ID: <1557461731.474785.1358196446162.JavaMail.root@sculptor.zimbra.ru.nl> Dear Emma, FieldTrip is moving towards layouts that are based on an image  (for reference) and that are stored in a .mat file . For some examples, see: http://fieldtrip.fcdonders.nl/template/layout The layout structure stored in those .mat files contains fields that describe the position (.pos), the width (.width), and the height (.height), and the naming (.label) of the electrodes. Furthermore, it contains fields that describe the topographic interpolation boundaries (.mask) and the outlines of the 'head' (.outline). Previous, and still supported, layout files (with a  .lay extension) typically contain a data matrix consisting of 5 columns. The first two columns describe the position of each electrode whereas the third, fourth, and fifth column describe the width, height, and label (i.e. number/name) for each electrode respectively. If you have a bitmap image, I'd recommend to create a layout variable and to store it in a .mat file. Try using  the following commands:   cfg.img = '*.bmp'  lay = ft_prepare_layout(cfg, []) Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Emma Holmes" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 14 januari 2013 21:14:23 > Onderwerp: [FieldTrip] Electrode location structure > Dear FieldTrip users, >   > I would like to define the positions of the EEG electrodes myself. > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. >   > I’m trying to use the ft_prepare_layout() function. > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > Here, I’m referring to the part of the documentation ‘cfg.elec:  > structure with electrode positions’, but can’t seem to find any > explanation of what the layout of this structure should be. >   > Many thanks, > Emma > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 14 22:46:21 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 14 Jan 2013 13:46:21 -0800 Subject: [FieldTrip] normalizing EEG power Message-ID: <50F47CAD.7010803@berkeley.edu> Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From pgoodin at swin.edu.au Tue Jan 15 06:00:28 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Tue, 15 Jan 2013 05:00:28 +0000 Subject: [FieldTrip] Running sensor space stats then source? Message-ID: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Jan 15 09:36:19 2013 From: f.roux at bcbl.eu (Frederic Roux) Date: Tue, 15 Jan 2013 09:36:19 +0100 (CET) Subject: [FieldTrip] normalizing EEG power In-Reply-To: <50F47CAD.7010803@berkeley.edu> Message-ID: <1e9ab1ac-1a4d-4a6d-ab2b-f34a03bee311@thalamus_p> Hi Ingrid, if the shapes of your power spectra look qualitatively similar and are simply shifted up or down, you could normalize the power on a frequency by frequenyc basis by computing z-scores for each individual within their respective gender according to: z(i,f) = (x(i,f) - x_males(f))./sd_males(f); % for males z(i,f) = (x(i,f) - x_females(f))./sd_females(f); % for females with x(i,f) being the individual power spectrum, x_males(f) and x_females(f) being the group mean power spectra for males and females, and sd_males(f) and sd_females(f) being the standard deviations of the power spectra for each group. At least this should help to get rid of gender specific differences and you wouldn't have to normalize your values using total power etc. Best, Fred ----- Original Message ----- From: "Ingrid Nieuwenhuis" To: "FieldTrip discussion list" Sent: Monday, January 14, 2013 10:46:21 PM Subject: [FieldTrip] normalizing EEG power Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Wed Jan 16 09:40:55 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 16 Jan 2013 09:40:55 +0100 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <61157CED-8EDB-48A4-881A-ABD1F414CB53@donders.ru.nl> Hi Emma Narayan and Arjen already pointed you in the appropriate direction. Just to clarify their emails, FieldTrip uses a layout structure for 2-D plotting of data, and the electrode structure for a 3-D representation. The electrode structure can be converted to a 2-D layout, but can also be used for source reconstruction, for which the layout is useless. Please see http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described and pointers to other documentation therein. Also these new pages http://fieldtrip.fcdonders.nl/template/electrode http://fieldtrip.fcdonders.nl/template/layout might help. best Robert On 14 Jan 2013, at 21:14, Emma Holmes wrote: > Dear FieldTrip users, > > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. > > > I’m trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. > > Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. > > > Many thanks, > > Emma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sangita.dandekar at gmail.com Wed Jan 16 22:06:44 2013 From: sangita.dandekar at gmail.com (Sangita Dandekar) Date: Wed, 16 Jan 2013 16:06:44 -0500 Subject: [FieldTrip] defining phase and axial to planar conversion Message-ID: Hi fieldtrippers, I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? My current procedure: 1. Apply megplanar to get the dH and dV components 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately Is there a better way to do this? If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? Thanks in advance for any help! Sangita -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Thu Jan 17 11:11:42 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Thu, 17 Jan 2013 11:11:42 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 05:20:02 2013 From: dave at davebritton.com (Dave Britton) Date: Thu, 17 Jan 2013 23:20:02 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing Message-ID: <50F8CD72.80507@davebritton.com> What is the structure required for the 'data' argument to "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? I am not getting meaningful results from passing the output of [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that appears in the resulting figure is the names of the channels, with no graphs of trial epochs appearing below them as it should be. What ft_preprocessing returns is: data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} fsample: NaN cfg: [1x1 struct] sampleinfo: [132x2 double] where I have 128 electrodes and 132 trials of 238 samples each. When this is passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels of the 128 electrodes, but there is no graph under each label showing the EEG data. What I am passing into ft_preprocessing may be incorrectly structured, I suspect. This is data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} (specifically, why are these all cells instead of arrays? What is the structure of data.time, and of data.trial?) where label is the cell array of strings of electrode names, time is a cell array of the 132 trials' starting times in the .cnt EEG data file, and trial is a cell array containing the 132 cell arrays of the corresponding {128 x 283} EEG samples. Where am I going wrong? What does ft_rejectvisual(data) expect to have as the structure for "data"? -Dave From jan.schoffelen at donders.ru.nl Fri Jan 18 07:55:17 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 07:55:17 +0100 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Hi Jun, If you want to test whether within a subject the PLV across conditions is significantly different (in some statistical sense), you would either do a statistical test along the lines described in "Nonparametric statistical testing of coherence differences, E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 (1), 161-175" or "Comparing spectra and coherences for groups of unequal size, H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of neuroscience methods 159 (2), 337-345". This functionality is not supported in ft_connectivityanalysis. For the former way of statistical testing, you should use ft_freqstatistics, in combination with an adjusted version of statfun_indepsamplesZcoh in order for it to compute differential PLV, rather than Z-transformed coherence difference. Alternatively, you could ask ft_connectivity to compute a jackknife estimate of the variance of the PLV, which could be used in a traditional t-test. Best, Jan-Mathijs On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > Dear fieldtrip experts, > I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Jan 18 09:46:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 18 Jan 2013 09:46:24 +0100 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: <50F8CD72.80507@davebritton.com> References: <50F8CD72.80507@davebritton.com> Message-ID: Dear Dave, You are correct in assuming that label, time, and trial are the three minimally required fields for a FT-style raw data structure. Label is a cell array, because channel names can have varying lengths. Time and trial are cell arrays, because also trials can have variable lengths. Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. For more details, you might want to have a look at http://fieldtrip.fcdonders.nl/faq/how_are_the_various_data_structures_defined . Hope this helps! Best, Eelke On 18 January 2013 05:20, Dave Britton wrote: > What is the structure required for the 'data' argument to > "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? > I am not getting meaningful results from passing the output of > [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that > appears in the resulting figure is the names of the channels, with no graphs > of trial epochs appearing below them as it should be. > > What ft_preprocessing returns is: > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > fsample: NaN > cfg: [1x1 struct] > sampleinfo: [132x2 double] > > where I have 128 electrodes and 132 trials of 238 samples each. When this is > passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels > of the 128 electrodes, but there is no graph under each label showing the > EEG data. > What I am passing into ft_preprocessing may be incorrectly structured, I > suspect. This is > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > > (specifically, why are these all cells instead of arrays? What is the > structure of data.time, and of data.trial?) > > where label is the cell array of strings of electrode names, time is a cell > array of the 132 trials' starting times in the .cnt EEG data file, and trial > is a cell array containing the 132 cell arrays of the corresponding {128 x > 283} EEG samples. > > Where am I going wrong? What does ft_rejectvisual(data) expect to have as > the structure for "data"? > > -Dave > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From caspervanheck at gmail.com Fri Jan 18 15:53:11 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Fri, 18 Jan 2013 15:53:11 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: Dear Fieldtrippers, I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: *Attempted to access dim(3); index out of bounds because numel(dim)=2.* *Error in ==> cornerpoints at 11 * *Error in ==> ft_plot_slice at 157 * So, I tried the surf-option, which gave me this: *Undefined function or variable "val".* *Error in ==> ft_sourceplot at 1174 * And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): *Out of memory* Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB Or, the mildly disconcerting: *Matlab has encountered an internal error and has to close* Which seems to have been caused by a so-called *"Segmentation violation" * Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. Sincerely, Casper van Heck On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:35:05 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:35:05 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <7180B46C-356A-456A-8C3B-66E9F94D9DAE@donders.ru.nl> Hi Casper, Looks like a lowlevel error to me. The function complains about the dim not having the number of elements it expects (should be 3). Thus it looks as if the input to the plotting function (thus the output to ft_sourceinterpolate) is unexpected. Best, Jan-Mathijs On Jan 18, 2013, at 3:53 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:40:37 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:40:37 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: > Dear all, > > I am trying to beam single trials into source space using a DICS filter and the following code. > > cfg=[]; > cfg.method='dics'; > cfg.grid=grid_ind; > cfg.vol=hdm; > cfg.grid.filter=alldics.avg.filter;% common filter > cfg.dics.lambda='5%'; > cfg.channel=channs; > cfg.frequency=13; > cfg.grad=data.grad; > cfg.keeptrials='yes'; > cfg.rawtrial='yes'; > dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) > > I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). > > However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? > > Thanks for any advice! > > Best, > Nadia > > Dr. Nadia Müller > CIMeC - Center for Mind/Brain Sciences > Università degli Studi di Trento > via delle Regole, 101 > Mattarello (TN) - ITALY > e-mail nadia.muller at unitn.it > http://sites.google.com/site/obobcimec > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Fri Jan 18 16:43:25 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 18 Jan 2013 16:43:25 +0100 (CET) Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Hi Casper, I think it is really difficult to figure only from the error message what the problem is. I think it would be also useful to see the inputs (cfg, and your data) of ft_sourceplot. Could you just send me how your cfg and your data-structure looks like? (I mean that you do not need to send the actual data, just the screen output of disp(data) and disp(cfg)). Best, Lilla > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical > reasons, or the people who actually understand what's happening here were > on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result > other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > wrote: > >> Dear Fieldtrippers, >> >> I've been trying to do a source analysis on a dataset with two >> conditions, >> mostly following the tutorials and examples from the Fieldtrip site, and >> come upon a problem; it won't plot. While the source analysis is not an >> essential component of the analysis of this dataset (it's more along the >> lines of "let's see if I can do this"), and I don't expect any result >> other >> than something like "there might be a source in the left hemisphere", >> I'd >> still would like to found out why it's not working. >> >> Essentially, I create a standard headmodel cause I don't have individual >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> to find sources based on individual EEG-datasets using ft_freqanalysis >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> surface. Initially I tried to get the ortho-option to work, but this >> gave >> the following error: >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> *Error in ==> cornerpoints at 11 >> * >> *Error in ==> ft_plot_slice at 157 >> * >> >> So, I tried the surf-option, which gave me this: >> *Undefined function or variable "val".* >> *Error in ==> ft_sourceplot at 1174 >> * >> >> And finally, I tried the slice-option, which gave one of two errors >> (which >> seems to be based on how many slices I requested): >> *Out of memory* >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> topping of at 40GB >> Or, the mildly disconcerting: >> *Matlab has encountered an internal error and has to close* >> Which seems to have been caused by a so-called *"Segmentation violation" >> * >> >> Can anyone offer any insight in these errors? I think I'm doing >> something >> wrong pretty early on, but have no idea what it is. >> >> Sincerely, >> >> Casper van Heck >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Jan 18 16:55:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:55:33 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: References: Message-ID: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 17:05:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 17:05:45 +0100 Subject: [FieldTrip] defining phase and axial to planar conversion In-Reply-To: References: Message-ID: <43CF52FF-6D8B-4888-9A4E-A7E549D3B8E6@donders.ru.nl> Hi Sangita, > I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. Good. > I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? > > My current procedure: > 1. Apply megplanar to get the dH and dV components > 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) > 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately > > Is there a better way to do this? > > If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? I wouldn't do the dH and dV analysis separately, and then combine. One of the reasons is indeed that it would be strange if there is a phase shift between the dV and dH gradients. Another reason is that the actual direction of dH and dV is rather arbitrary. One could consider an oscillatory source to yield a time-varying gradient oriented exactly along the dH-axis, exactly along the dV-axis, but also somewhere in between. In the first case, the source of interest is not visible along the dV-axis (and the phases estimated from the dV are actually rubbish, so introduces a lot of non-specific variance on your feature of interest), in the second case the situation is reversed (dH picks up nothing relevant), and in the in between situation both pick up a bit. What I would do is to do a PCA on each dH-dV combination, and then go for the first PCA-component that will be used for the phase computation. This approach is implemented in ft_combineplanar, but only for frequency domain data. The order of the steps would be: cfg = []; cfg.planarmethod = 'sincos'; dataplanar = ft_megplanar(cfg, data); cfg = []; cfg.method = 'mtmconvol'/'mtmfft' cfg.output = 'fourier'; cfg.taper = 'hanning'; freqplanar = ft_freqanalysis(cfg, dataplanar); cfg = []; cfg.method = 'svd'; % which is equivalent to PCA freqcombined = ft_combineplanar(cfg, freqplanar); freqplanar.fourierspctrm should now contain phase information, estimated at the gradient orientation yielding the maximum power (assuming a fixed orientation over time and trials, but different across frequencies). Alternatively, you can do the analysis in the time domain, but this will require some code of your own. Best wishes, Jan-Mathijs > > Thanks in advance for any help! > Sangita > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Fri Jan 18 17:32:10 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Fri, 18 Jan 2013 17:32:10 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> References: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Message-ID: <61DABECF-9193-429E-8C27-11C8580531BA@unitn.it> Hi Jan-Mathijs, That makes completely sense and you were right I used a vector beamformer. By taking only one orientation (cfg.fixedori='yes') I could solve the problem: Now the values are exactly the same. Could it be that this 'problem' also exists for the example code in the 'Common Filters Beamformer Tutorial' (http://fieldtrip.fcdonders.nl/example/common_filters_in_beamforming)? Should I include the line (cfg.fixedori='yes') also there? Thanks a lot for your very helpful response, Best, Nadia On Jan 18, 2013, at 4:40 PM, jan-mathijs schoffelen wrote: Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Fri Jan 18 18:09:41 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 18 Jan 2013 11:09:41 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Thanks, Jan-Mathijs. This is really helpful, I will check the papers you referred. Jun On Fri, Jan 18, 2013 at 12:55 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Jun, > > If you want to test whether within a subject the PLV across conditions is > significantly different (in some statistical sense), you would either do a > statistical test along the lines described in "Nonparametric statistical > testing of coherence differences > , E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 > (1), 161-175" or "Comparing spectra and coherences for groups of unequal > size > , H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of > neuroscience methods 159 (2), 337-345". > > This functionality is not supported in ft_connectivityanalysis. For the > former way of statistical testing, you should use ft_freqstatistics, in > combination with an adjusted version of statfun_indepsamplesZcoh in order > for it to compute differential PLV, rather than Z-transformed coherence > difference. Alternatively, you could ask ft_connectivity to compute a > jackknife estimate of the variance of the PLV, which could be used in a > traditional t-test. > > Best, > > Jan-Mathijs > > > On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > > Dear fieldtrip experts, > I have a question regarding to test the plv output from > ft_connectivityanalysis. How can I check the significance with a > statistical test based on surrogate data. the plv output didn't have the > magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 21:24:28 2013 From: dave at davebritton.com (Dave Britton) Date: Fri, 18 Jan 2013 15:24:28 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: References: <50F8CD72.80507@davebritton.com> Message-ID: <50F9AF7C.1060302@davebritton.com> On 01/18/2013 03:46 AM, Eelke Spaak wrote: Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. Thanks, this is very helpful. It seems that data.sampleinfo is also important for raw data, and needs to be in the reverse order, i.e. NumSamplesx1. -Dave From naran.kutt at gmail.com Sat Jan 19 07:00:06 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 01:00:06 -0500 Subject: [FieldTrip] source level statistics on one data set. Message-ID: Dear All, I had a question regarding across subject source level statistics using fieldtrip. For 15 subjects I have two conditions conA and conB. For each subject I then 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. sincerely Naran -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Jan 19 08:08:32 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 19 Jan 2013 08:08:32 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: Message-ID: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Hi Naran, It seems you're almost there! What I would do is the following: Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. The final step would be something like this: cfg = []; cfg ... stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; cfg.ivar = 2; cfg.uvar = 1; cfg.statistic = 'depsamplesT'; In this case you will perform a paired T-test between the 2 conditions. Best, Jan-Mathijs On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > Dear All, > > I had a question regarding across subject source level statistics using fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From naran.kutt at gmail.com Sat Jan 19 10:17:51 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 04:17:51 -0500 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: Hi Jan, Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest 1. would the bias be still there, or will it be taken care of? 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects Thank you again! best, Naran On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 > conditions separate. Then, srcA and srcB (for all subjects) are ready to > enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. > Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = > 'no', you'll only get an average across subjects, so that's not useful for > doing statistics to begin with. Alternatively, you could call > ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a > redundant step. Moreover, it is a bit silly, because in that case no > 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on > source level data, but you may get some inspiration from the tutorials that > deal with sensor-level data. Instead of using ft_timelockanalysis you > should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, > srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and > likewise for B. It now boils down to informing ft_sourcestatistics with the > appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > > Dear All, > > I had a question regarding across subject source level statistics using > fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I > then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. > (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate > and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage > with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are > significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another > program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sun Jan 20 03:23:51 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 20 Jan 2013 02:23:51 +0000 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: , <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thank you very much for the thoughts on the issue. I do hope to hear what others have to say also. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: Saturday, 19 January 2013 2:55 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Running sensor space stats then source? Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun Jan 20 09:15:36 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sun, 20 Jan 2013 09:15:36 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: <47B5264C-3D58-4AA1-8C21-0A0CC0C06C07@donders.ru.nl> Hi Naran, Usually the statistical contrast takes care of the depth bias. Alternatively, you could test the difference of the log10 of the power (i.e. take the log10 of srcX.avg.pow); this is equivalent to testing the log10 of the ratio. Indeed you can correct for multiple comparisons using the cluster-based test statistic. Best, Jan-Mathijs On Jan 19, 2013, at 10:17 AM, Narayanan Kutty wrote: > Hi Jan, > > Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest > > 1. would the bias be still there, or will it be taken care of? > > 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here > http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects > > Thank you again! > > best, > Naran > > On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > >> Dear All, >> >> I had a question regarding across subject source level statistics using fieldtrip. >> >> For 15 subjects I have two conditions conA and conB. For each subject I then >> >> 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) >> >> 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) >> >> 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) >> >> After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. >> >> What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). >> >> How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. >> >> sincerely >> Naran >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Mon Jan 21 12:18:58 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Mon, 21 Jan 2013 12:18:58 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: Everyone, While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: First I create a pre-post contrast as shown in the beamformer tutorial. Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); * *mri = ft_volumereslice([], mri);* Then: *[data] = ft_sourceinterpolate(cfg, data, mri); * where cfg contains: *cfg.parameter: 'avg.pow'* *cfg.downsample: 4* and I add the anatomy: *data.anatomy = mri.anatomy; clear mri* And finally, I call ft_sourceplot using these options: cfg.*parameter: 'avg.pow'* *cfg.downsample: 4* with one of these three methods: 1) *cfg.method = 'surface';* * cfg.surffile = 'surface_l4_both.mat';* * cfg.surfdownsample = 4;* * cfg.projmethod = 'nearest';* 2) *cfg.method = 'ortho';* 3) *cfg.method = 'slice';* * cfg.nslices = 20;* Which leads to the errors shown earlier. At this point, disp(data) yields: *K>> disp(data)* * avg: [1x1 struct]* * pos: [16777216x3 double]* * dim: [256 256 256]* * inside: [1x16777216 double]* * outside: [1x0 double]* * coordsys: 'ctf'* * unit: 'mm'* * cfg: [1x1 struct]* * anatomy: [256x256x256 double]* * * I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model * * * *% segment the template brain and construct a volume conduction model (i.e. head model)* *cfg = [];* *cfg.output = {'brain' 'scalp' 'skull'};* *cfg.downsample = 2;* *t_seg = ft_volumesegment(cfg, mri);* * * *% create head model* *cfg = [];* *cfg.method = 'singlesphere';* *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* *cfg.elec = ft_read_sens('standard_1020.elc');* *t_vol = ft_prepare_headmodel(cfg, t_seg);* *clear template_seg* * * *% construct the dipole grid in the template brain coordinates* *cfg = [];* *cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION* *cfg.vol = t_vol;* *t_grid = ft_prepare_sourcemodel(cfg);* * * After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* * * Anyone seeing anything obviously stupid? Sincerely, Casper On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two > conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors > (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Jan 22 09:49:16 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Jan 2013 09:49:16 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Hi intersect(everyone, casper) > Everyone, > > While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > mri = ft_volumereslice([], mri); > > Then: > [data] = ft_sourceinterpolate(cfg, data, mri); > where cfg contains: > cfg.parameter: 'avg.pow' > cfg.downsample: 4 > > and I add the anatomy: > data.anatomy = mri.anatomy; clear mri Putting mri.anatomy into data.anatomy is probably not what you want to do: the whole point about ft_sourceinterpolate is to get the functional and anatomical data in the same 'pixel-space'; this is the only way that ft_sourceplot (as of yet) can deal with it. The reason is that now the functional data is sampled once every 4 voxels, relative to the anatomy. I guess that this causes your problem in ft_sourceplot. Best wishes, Jan-Mathijs > And finally, I call ft_sourceplot using these options: > cfg.parameter: 'avg.pow'; > cfg.downsample: 4 > with one of these three methods: > 1) cfg.method = 'surface'; > cfg.surffile = 'surface_l4_both.mat'; > cfg.surfdownsample = 4; > cfg.projmethod = 'nearest'; > 2) cfg.method = 'ortho'; > 3) cfg.method = 'slice'; > cfg.nslices = 20; > Which leads to the errors shown earlier. At this point, disp(data) yields: > K>> disp(data) > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > anatomy: [256x256x256 double] > > I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model > > % segment the template brain and construct a volume conduction model (i.e. head model) > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > cfg.downsample = 2; > t_seg = ft_volumesegment(cfg, mri); > > % create head model > cfg = []; > cfg.method = 'singlesphere'; > cfg.hdmfile = strcat(h.subject,'Subject01.hdm'); > cfg.elec = ft_read_sens('standard_1020.elc'); > t_vol = ft_prepare_headmodel(cfg, t_seg); > clear template_seg > > % construct the dipole grid in the template brain coordinates > cfg = []; > cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION > cfg.vol = t_vol; > t_grid = ft_prepare_sourcemodel(cfg); > > After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): > source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid); > > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Jan 23 09:26:36 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 23 Jan 2013 09:26:36 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Peter, I think your question was aimed at asking: is it, by running the same stats on transformed data, double-dipping to use the same time window, for example? I don't think so in this case of sensor versus source because, as Jan-Mathijs already mentioned, it's not just a transform of each sensor to a given source location, but rather a linear mixture, and this linear mixture may pull out different effects, even when using cluster stats at the sensor level. I also don't think that it is double dipping if you first find the optimal time window in sensor data, and then simply want to ask: where is the most likely location of the underlying neural source? Then you are asking a spatial/where question, not a presence/if question. Although, see previous paragraph as to why you may find a different set of significant findings in source versus sensor space. Cheers, Johanna 2013/1/18 jan-mathijs schoffelen > Hi Peter, > > I don't have a definite answer to your question, but note that analysing > the data at the level of the sources is something a bit more involved than > just taking the log-transform... > > Here are some pseudo-random thoughts: > > Essentially, sensor level signals present themselves as a linear mixture > of the underlying sources of interest, and the source modelling attempts to > unmix the sensor signals using biophysical (and additional) constraints. > In general, source level analysis will allow for a 'cleaner' > interpretation of the possible location of the sources, where one should > always account for the fact that the spatial resolution of EEG/MEG source > reconstruction is not typically very high. In addition, the more relevant > reason to try to unmix the sensor-level data, is to get a cleaner account > of the temporal structure in and between the underlying neural generators, > allowing for less problematic interpretation of univariate and > bi/multivariate (connectivity) quantities estimated from the data. As a > result of the source reconstruction, it could be that results are uncovered > which are not easily visible from the sensor data alone. > > It is perfectly valid to constrain yourself to sensor-level analysis, if > this allows you to make your scientific point. Also, once you manage to > reject your null-hypothesis (allowing you to speculate about the > alternative hypothesis in your discussion section of your paper), there is > no need to go to the source level. > > I guess that to some extent it is also a matter of taste, familiarity with > the methods, and opportunity which drives researchers to choose for one or > the other approach. > > These are just my thoughts and ideas, and it could be that other people on > this forum have more sensible things to say about it. > > Best, > > Jan-Mathijs > > > > > > On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit > of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using > the cluster based tests in fieldtrip to examine for significant differences > between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be > using the same time window, just in a different (more assumption filled) > space. In my head it's like running a t-test on "raw" data then doing it > again transformed (eg, log transform) numbers, removing any assumption of > independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those > that use both don't make any discussion regarding it. Can anyone point me > in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Wed Jan 23 10:55:54 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Wed, 23 Jan 2013 10:55:54 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Since ft_sourceplot complained about not having anatomy (or functional) parameter, and it seems to default to a field named '*data.anatomy'*, I assumed adding *mri.anatomy* in *data.anatomy* would suffice. But, without this, ft_sourceplot would again require an anatomy parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' in the cfg I feed to ft_sourceplot, where 'mri' is the result from ft_volumereslice. However, ft_sourceplot then says "*do not understand cfg.anaparameter*", and thus it is not plotting "*anatomy*". After looking back to the plotting tutorial where I read "The anatomy can be read with ft_read_mri", I'm not quite sure what's going wrong. Sincerely, Casper On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi intersect(everyone, casper) > > Everyone, > > While the whole script is way too convoluted to put up here, but luckily > the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed > through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using > cfg.outputfile), where the data is fed as a cell array (which seems to work > properly), I go over to a source-comparison script. This script works as > follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and > reslice this data: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > * > *mri = ft_volumereslice([], mri);* > > Then: > *[data] = ft_sourceinterpolate(cfg, data, mri); > * > where cfg contains: > *cfg.parameter: 'avg.pow'* > *cfg.downsample: 4* > > and I add the anatomy: > *data.anatomy = mri.anatomy; clear mri* > > > Putting mri.anatomy into data.anatomy is probably not what you want to do: > the whole point about ft_sourceinterpolate is to get the functional and > anatomical data in the same 'pixel-space'; this is the only way that > ft_sourceplot (as of yet) can deal with it. The reason is that now the > functional data is sampled once every 4 voxels, relative to the anatomy. I > guess that this causes your problem in ft_sourceplot. > > > > Best wishes, > > Jan-Mathijs > > > > And finally, I call ft_sourceplot using these options: > > cfg.*parameter: 'avg.pow';* > > *cfg.downsample: 4* > > * > * > > with one of these three methods: > 1) *cfg.method = 'surface';* > * cfg.surffile = 'surface_l4_both.mat';* > * cfg.surfdownsample = 4;* > * cfg.projmethod = 'nearest';* > 2) *cfg.method = 'ortho';* > 3) *cfg.method = 'slice';* > * cfg.nslices = 20;* > Which leads to the errors shown earlier. At this point, disp(data) yields: > *K>> disp(data)* > * avg: [1x1 struct]* > * pos: [16777216x3 double]* > * dim: [256 256 256]* > * inside: [1x16777216 double]* > * outside: [1x0 double]* > * coordsys: 'ctf'* > * unit: 'mm'* > * cfg: [1x1 struct]* > * anatomy: [256x256x256 double]* > * > * > I'm guessing it has something to do with the 'inside' and 'outside' > elements, so my 'standard head model'. I think I made this using the > following code: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' > anatomical model > * > * > * > *% segment the template brain and construct a volume conduction model > (i.e. head model)* > *cfg = [];* > *cfg.output = {'brain' 'scalp' 'skull'};* > *cfg.downsample = 2;* > *t_seg = ft_volumesegment(cfg, mri);* > * * > *% create head model* > *cfg = [];* > *cfg.method = 'singlesphere';* > *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* > *cfg.elec = ft_read_sens('standard_1020.elc');* > *t_vol = ft_prepare_headmodel(cfg, t_seg);* > *clear template_seg* > * > * > *% construct the dipole grid in the template brain coordinates* > *cfg = [];* > *cfg.normalize = 'no'; % no normalization, since we're comparing two > conditions THAT'S RIGHT I DID PAY ATTENTION* > *cfg.vol = t_vol;* > *t_grid = ft_prepare_sourcemodel(cfg);* > * > * > After which I use this on all subjects, using this (note that I store all > data in a single massive structure, to make saving to disk and selecting > data etc. easier): > *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* > * > * > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > >> Hi Casper, >> >> I think it is really difficult to figure only from the error message what >> the problem is. I think it would be also useful to see the inputs (cfg, >> and your data) of ft_sourceplot. Could you just send me how your cfg and >> your data-structure looks like? (I mean that you do not need to send the >> actual data, just the screen output of disp(data) and disp(cfg)). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrippers, >> > >> > I've asked this question earlier, but either it got lost due to >> technical >> > reasons, or the people who actually understand what's happening here >> were >> > on vacation, so here it is again: >> > >> > I've been trying to do a source analysis on a dataset with two >> conditions, >> > mostly following the tutorials and examples from the Fieldtrip site, and >> > come upon a problem; it won't plot. While the source analysis is not an >> > essential component of the analysis of this dataset (it's more along the >> > lines of "let's see if I can do this"), and I don't expect any result >> > other >> > than something like "there might be a source in the left hemisphere", >> I'd >> > still would like to found out why it's not working. >> > >> > Essentially, I create a standard headmodel cause I don't have individual >> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> > to find sources based on individual EEG-datasets using ft_freqanalysis >> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> > After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> > >> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> > surface. Initially I tried to get the ortho-option to work, but this >> gave >> > the following error: >> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> > *Error in ==> cornerpoints at 11 >> > * >> > *Error in ==> ft_plot_slice at 157 >> > * >> > >> > So, I tried the surf-option, which gave me this: >> > *Undefined function or variable "val".* >> > *Error in ==> ft_sourceplot at 1174 >> > * >> > >> > And finally, I tried the slice-option, which gave one of two errors >> (which >> > seems to be based on how many slices I requested): >> > *Out of memory* >> > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> > topping of at 40GB >> > Or, the mildly disconcerting: >> > *Matlab has encountered an internal error and has to close* >> > Which seems to have been caused by a so-called *"Segmentation violation" >> > * >> > >> > Can anyone offer any insight in these errors? I think I'm doing >> something >> > wrong pretty early on, but have no idea what it is. >> > >> > Sincerely, >> > >> > Casper van Heck >> > >> > >> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >> > wrote: >> > >> >> Dear Fieldtrippers, >> >> >> >> I've been trying to do a source analysis on a dataset with two >> >> conditions, >> >> mostly following the tutorials and examples from the Fieldtrip site, >> and >> >> come upon a problem; it won't plot. While the source analysis is not an >> >> essential component of the analysis of this dataset (it's more along >> the >> >> lines of "let's see if I can do this"), and I don't expect any result >> >> other >> >> than something like "there might be a source in the left hemisphere", >> >> I'd >> >> still would like to found out why it's not working. >> >> >> >> Essentially, I create a standard headmodel cause I don't have >> individual >> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> >> Fieldtrip >> >> to find sources based on individual EEG-datasets using ft_freqanalysis >> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> >> average >> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> >> surface. Initially I tried to get the ortho-option to work, but this >> >> gave >> >> the following error: >> >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> >> *Error in ==> cornerpoints at 11 >> >> * >> >> *Error in ==> ft_plot_slice at 157 >> >> * >> >> >> >> So, I tried the surf-option, which gave me this: >> >> *Undefined function or variable "val".* >> >> *Error in ==> ft_sourceplot at 1174 >> >> * >> >> >> >> And finally, I tried the slice-option, which gave one of two errors >> >> (which >> >> seems to be based on how many slices I requested): >> >> *Out of memory* >> >> Which is pretty damn impressive since I've got 8GB of RAM and a >> pagefile >> >> topping of at 40GB >> >> Or, the mildly disconcerting: >> >> *Matlab has encountered an internal error and has to close* >> >> Which seems to have been caused by a so-called *"Segmentation >> violation" >> >> * >> >> >> >> Can anyone offer any insight in these errors? I think I'm doing >> >> something >> >> wrong pretty early on, but have no idea what it is. >> >> >> >> Sincerely, >> >> >> >> Casper van Heck >> >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Wed Jan 23 12:19:37 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Wed, 23 Jan 2013 12:19:37 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Hi Casper, The cfg.anaparameter should then be 'anatomy'. It refers to the field (in data) in which the anatomy can be found, in your case: data.anatomy. Hope this helps, Hanneke Op 23 jan. 2013 10:57 schreef "Casper van Heck" het volgende: > Dear Jan-Mathijs, > > Since ft_sourceplot complained about not having anatomy (or functional) > parameter, and it seems to default to a field named '*data.anatomy'*, I > assumed adding *mri.anatomy* in *data.anatomy* would suffice. > > But, without this, ft_sourceplot would again require an anatomy parameter, > so that would mean that I need to ut '*cfg.anaparameter = mri*' in the > cfg I feed to ft_sourceplot, where 'mri' is the result from > ft_volumereslice. > However, ft_sourceplot then says "*do not understand cfg.anaparameter*", > and thus it is not plotting "*anatomy*". After looking back to the > plotting tutorial where I read "The anatomy can be read with ft_read_mri", > I'm not quite sure what's going wrong. > > Sincerely, > > Casper > > > > On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi intersect(everyone, casper) >> >> Everyone, >> >> While the whole script is way too convoluted to put up here, but luckily >> the relevant steps are quite simple >> Input is simply raw data, read with ft_preprocessing, which is passed >> through functions as shown in my previous email. >> >> After passing the data to ft_sourcegrandaverage (only using >> cfg.outputfile), where the data is fed as a cell array (which seems to work >> properly), I go over to a source-comparison script. This script works as >> follows: >> First I create a pre-post contrast as shown in the beamformer tutorial. >> >> Next, I read some MRI-data using ft_read_mri from a standard folder, and >> reslice this data: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >> * >> *mri = ft_volumereslice([], mri);* >> >> Then: >> *[data] = ft_sourceinterpolate(cfg, data, mri); >> * >> where cfg contains: >> *cfg.parameter: 'avg.pow'* >> *cfg.downsample: 4* >> >> and I add the anatomy: >> *data.anatomy = mri.anatomy; clear mri* >> >> >> Putting mri.anatomy into data.anatomy is probably not what you want to >> do: the whole point about ft_sourceinterpolate is to get the functional and >> anatomical data in the same 'pixel-space'; this is the only way that >> ft_sourceplot (as of yet) can deal with it. The reason is that now the >> functional data is sampled once every 4 voxels, relative to the anatomy. I >> guess that this causes your problem in ft_sourceplot. >> >> >> >> Best wishes, >> >> Jan-Mathijs >> >> >> >> And finally, I call ft_sourceplot using these options: >> >> cfg.*parameter: 'avg.pow';* >> >> *cfg.downsample: 4* >> >> * >> * >> >> with one of these three methods: >> 1) *cfg.method = 'surface';* >> * cfg.surffile = 'surface_l4_both.mat';* >> * cfg.surfdownsample = 4;* >> * cfg.projmethod = 'nearest';* >> 2) *cfg.method = 'ortho';* >> 3) *cfg.method = 'slice';* >> * cfg.nslices = 20;* >> Which leads to the errors shown earlier. At this point, disp(data) yields: >> *K>> disp(data)* >> * avg: [1x1 struct]* >> * pos: [16777216x3 double]* >> * dim: [256 256 256]* >> * inside: [1x16777216 double]* >> * outside: [1x0 double]* >> * coordsys: 'ctf'* >> * unit: 'mm'* >> * cfg: [1x1 struct]* >> * anatomy: [256x256x256 double]* >> * >> * >> I'm guessing it has something to do with the 'inside' and 'outside' >> elements, so my 'standard head model'. I think I made this using the >> following code: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' >> anatomical model >> * >> * >> * >> *% segment the template brain and construct a volume conduction model >> (i.e. head model)* >> *cfg = [];* >> *cfg.output = {'brain' 'scalp' 'skull'};* >> *cfg.downsample = 2;* >> *t_seg = ft_volumesegment(cfg, mri);* >> * * >> *% create head model* >> *cfg = [];* >> *cfg.method = 'singlesphere';* >> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >> *cfg.elec = ft_read_sens('standard_1020.elc');* >> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >> *clear template_seg* >> * >> * >> *% construct the dipole grid in the template brain coordinates* >> *cfg = [];* >> *cfg.normalize = 'no'; % no normalization, since we're comparing two >> conditions THAT'S RIGHT I DID PAY ATTENTION* >> *cfg.vol = t_vol;* >> *t_grid = ft_prepare_sourcemodel(cfg);* >> * >> * >> After which I use this on all subjects, using this (note that I store all >> data in a single massive structure, to make saving to disk and selecting >> data etc. easier): >> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >> * >> * >> Anyone seeing anything obviously stupid? >> >> Sincerely, >> >> Casper >> >> >> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >> >>> Hi Casper, >>> >>> I think it is really difficult to figure only from the error message what >>> the problem is. I think it would be also useful to see the inputs (cfg, >>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>> your data-structure looks like? (I mean that you do not need to send the >>> actual data, just the screen output of disp(data) and disp(cfg)). >>> >>> Best, >>> Lilla >>> >>> >>> > Dear Fieldtrippers, >>> > >>> > I've asked this question earlier, but either it got lost due to >>> technical >>> > reasons, or the people who actually understand what's happening here >>> were >>> > on vacation, so here it is again: >>> > >>> > I've been trying to do a source analysis on a dataset with two >>> conditions, >>> > mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> > come upon a problem; it won't plot. While the source analysis is not an >>> > essential component of the analysis of this dataset (it's more along >>> the >>> > lines of "let's see if I can do this"), and I don't expect any result >>> > other >>> > than something like "there might be a source in the left hemisphere", >>> I'd >>> > still would like to found out why it's not working. >>> > >>> > Essentially, I create a standard headmodel cause I don't have >>> individual >>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> Fieldtrip >>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>> average >>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> > >>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> > surface. Initially I tried to get the ortho-option to work, but this >>> gave >>> > the following error: >>> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >>> > *Error in ==> cornerpoints at 11 >>> > * >>> > *Error in ==> ft_plot_slice at 157 >>> > * >>> > >>> > So, I tried the surf-option, which gave me this: >>> > *Undefined function or variable "val".* >>> > *Error in ==> ft_sourceplot at 1174 >>> > * >>> > >>> > And finally, I tried the slice-option, which gave one of two errors >>> (which >>> > seems to be based on how many slices I requested): >>> > *Out of memory* >>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> > topping of at 40GB >>> > Or, the mildly disconcerting: >>> > *Matlab has encountered an internal error and has to close* >>> > Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> > * >>> > >>> > Can anyone offer any insight in these errors? I think I'm doing >>> something >>> > wrong pretty early on, but have no idea what it is. >>> > >>> > Sincerely, >>> > >>> > Casper van Heck >>> > >>> > >>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>> > wrote: >>> > >>> >> Dear Fieldtrippers, >>> >> >>> >> I've been trying to do a source analysis on a dataset with two >>> >> conditions, >>> >> mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> >> come upon a problem; it won't plot. While the source analysis is not >>> an >>> >> essential component of the analysis of this dataset (it's more along >>> the >>> >> lines of "let's see if I can do this"), and I don't expect any result >>> >> other >>> >> than something like "there might be a source in the left hemisphere", >>> >> I'd >>> >> still would like to found out why it's not working. >>> >> >>> >> Essentially, I create a standard headmodel cause I don't have >>> individual >>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> >> Fieldtrip >>> >> to find sources based on individual EEG-datasets using ft_freqanalysis >>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>> >> average >>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> >> >>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> >> surface. Initially I tried to get the ortho-option to work, but this >>> >> gave >>> >> the following error: >>> >> *Attempted to access dim(3); index out of bounds because >>> numel(dim)=2.* >>> >> *Error in ==> cornerpoints at 11 >>> >> * >>> >> *Error in ==> ft_plot_slice at 157 >>> >> * >>> >> >>> >> So, I tried the surf-option, which gave me this: >>> >> *Undefined function or variable "val".* >>> >> *Error in ==> ft_sourceplot at 1174 >>> >> * >>> >> >>> >> And finally, I tried the slice-option, which gave one of two errors >>> >> (which >>> >> seems to be based on how many slices I requested): >>> >> *Out of memory* >>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> >> topping of at 40GB >>> >> Or, the mildly disconcerting: >>> >> *Matlab has encountered an internal error and has to close* >>> >> Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> >> * >>> >> >>> >> Can anyone offer any insight in these errors? I think I'm doing >>> >> something >>> >> wrong pretty early on, but have no idea what it is. >>> >> >>> >> Sincerely, >>> >> >>> >> Casper van Heck >>> >> >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Jan 23 18:21:17 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 23 Jan 2013 12:21:17 -0500 Subject: [FieldTrip] CTF MEG data anonymization Message-ID: Hello, Does anybody know *how to anonymize CTF MEG scans* (all patient's info must be removed from the file)? I have tools for the DICOM format but not for CTF formats. Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Wed Jan 23 19:01:22 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Wed, 23 Jan 2013 13:01:22 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: Message-ID: <51002572.9090908@kurage.nimh.nih.gov> Use the CTF tool newDs with the -anon option. McGowin, Inna wrote: > Hello, > > Does anybody know *how to anonymize CTF MEG scans* (all patient's info > must be removed from the file)? > I have tools for the DICOM format but not for CTF formats. > > Thanks! > -- > Inna > > > ------------------------------------------------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- The white knight is talking backwards. From a.stolk8 at gmail.com Wed Jan 23 19:08:19 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 23 Jan 2013 19:08:19 +0100 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: <51002572.9090908@kurage.nimh.nih.gov> References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Hi Inna, Have a look here http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset Yours, Arjen 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > Use the CTF tool newDs with the -anon option. > > McGowin, Inna wrote: > >> Hello, >> >> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >> must be removed from the file)? >> >> I have tools for the DICOM format but not for CTF formats. >> >> Thanks! >> -- >> Inna >> >> >> ------------------------------**------------------------------** >> ------------ >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > The white knight is talking backwards. > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 02:59:58 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 01:59:58 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment Message-ID: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Thu Jan 24 07:38:15 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Thu, 24 Jan 2013 07:38:15 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From pgoodin at swin.edu.au Thu Jan 24 10:11:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 09:11:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From julian.keil at gmail.com Thu Jan 24 11:13:11 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 24 Jan 2013 11:13:11 +0100 Subject: [FieldTrip] =?iso-8859-1?q?PhD=2E_Position_at_the_Department_of_P?= =?iso-8859-1?q?sychiatry_and_Psychotherapy=2C_Charit=E9?= Message-ID: <78950AEB-FEFC-4E59-A4E0-9A969D9AA224@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A Starting Grant of the European Research Council (ERC) will fund the currently open position (initially 24 months). The main objective of this ERC research program is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes. The studies within this program include EEG and other neuroimaging methods. Studies will be conducted in healthy subjects and patients with schizophrenia. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as some German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until February 03, 2013, electronically to: daniel.senkowski at charite.de Regards, Daniel Senkowski --------------------------------------------------------------- Daniel Senkowski, Ph.D. Professor of Clinical Neuropsychology Department of Psychiatry and Psychotherapy Charité, University Medicine Berlin St. Hedwig Hospital, Große Hamburger Str. 5-11 10115 Berlin, Germany www.danielsenkowski.com http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianpaolo.demarchi at unitn.it Thu Jan 24 11:13:49 2013 From: gianpaolo.demarchi at unitn.it (Demarchi, Gianpaolo) Date: Thu, 24 Jan 2013 11:13:49 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 13:05:48 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 12:05:48 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , Message-ID: Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrysa.lithari at gmail.com Thu Jan 24 16:33:56 2013 From: chrysa.lithari at gmail.com (Chrysa Lithari) Date: Thu, 24 Jan 2013 16:33:56 +0100 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Message-ID: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:42:43 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:42:43 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:44:17 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:44:17 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CF@nki-mail.NKI.rfmh.org> I forgot to mention - this doesn't change it to fieldtrip format, just to matlab format. But once it's in matlab, it shouldn't be too hard to convert it to a fieldtrip structure. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Epstein, Michael Sent: Thursday, January 24, 2013 10:43 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] read tfcs from BESA in Fieldtrip My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From ninja78278 at aol.com Thu Jan 24 17:11:33 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Thu, 24 Jan 2013 11:11:33 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter Message-ID: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Dear Fieldtrip-Users, I am trying to do lcmv beamform sourceanalysis with a common filter for all conditions (same session, different trials defined with ft_preprocessing belong to different conditions,sequence of conditions randomly intermixed for each block). However if I use the common filter calculated from one block (consisting of 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each condition separately without common filters it is working). Here is how I proceed: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK cfg = []; cfg.channel='MEG'; cfg.keeptrials='yes'; cfg.blc='yes'; cfg.blcwindow = [-0.2 0] data = ft_timelockanalysis(cfg,data); cfg = []; cfg.channel = 'MEG' cfg.covariance ='yes'; cfg.covariancewindow = [0 0.2]; cfg.removemean = 'no'; cfg.keeptrials = 'yes'; timelock_post = ft_timelockanalysis(cfg,data); cfg.covariancewindow = [-0.2 0]; timelock_pre = ft_timelockanalysis(cfg,data); %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.vol = vol.vol; cfg.grad = grad.grad; cfg.keeptrials='yes'; cfg.lcmv.lamda = '5%'; cfg.lcmv.keepfilter = 'yes'; source_post = ft_sourceanalysis(cfg,timelock_post); source_pre = ft_sourceanalysis(cfg,timelock_pre); source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS cfg = []; cfg.trials=cond1; %this picks out the trials belonging to condition1 cfg.channel ='MEG'; cfg.keeptrials='yes'; cfg.blc = 'yes'; cfg.blcwindow = [-02 0]; data=ft_timelockanalysis(cfg,data); cfg =[]; cfg.channel='MEG'; cfg.covariance='yes'; cfg.covariancewindow=[0 0.2]; cfg.removemean ='no'; cfg.keeptrials='yes'; timelock_post_cond1 = ft_timelockanalysis(cfg,data); timelock_pre_cond1 = ft_timelockanalysis(cfg,data); %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE BLOCK cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.grid.filter=source_post.avg.filter; cfg.lcmv.keepfilter='no'; cfg.keeptrials = 'yes'; cfg.vol = vol.vol; cfg.grad=grad.grad; cfg.lcmv.lambda='5%'; source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); source_post_cond1.avg.nai = source_post_cond1.avg.pow./source_pre_cond1.avg.pow; %PLOT source_post_cond1.pos = template.pos; source_post_cond1.dim = template.dim; source_post_cond1.xgrid = template.xgrid; source_post_cond1.ygrid = template.ygrid; source_post_cond1.zgrid = template.zgrid; cfg = []; cfg.parameter =' avg.nai'; interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); cfg = []; cfg.funparameter = 'nai'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.funcolorlim = [1.5 2.0]; ft_sourceplot (cfg,interp_cond1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I also tried it using rawtrials, but with the same outcome (no activation visible in sourceplot). As I said, doing the same thing for cond1 without using the common filter works perfectly fine. Does anybody have an idea what might be my mistake?. Thank you a lot for your help! Ninja -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Jan 24 17:29:09 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 24 Jan 2013 17:29:09 +0100 Subject: [FieldTrip] postdoc and PhD position in comp neuroscience & MEG/EEG methods, Jena, Germany References: <2059450434.7696.1358875351785.JavaMail.root@zimbra> Message-ID: Begin forwarded message: > Dear FieldTrip community, > > We are inviting applications for a postdoctoral and a PhD student position in the Computational Neuroscience & Magnetoencephalography group at the Biomagnetic Centre (http://www.biomag.uni-jena.de), Friedrich-Schiller-University of Jena, Germany. > > The successful candidates will develop novel analysis methods for Magneto- and Electroencephalography (MEG/EEG) such as connectivity analysis, source reconstruction and advanced single trial analysis. The positions are devoted to research only without any teaching or administrative duties. The work will be done in collaboration with the MEG and theoretical neuroscience groups at the Wellcome Trust Centre for Neuroimaging in London, UK. These positions are ideal for candidates with a computational/theoretical background and a strong interest in collaborating with experimental researchers in neuroimaging. > > The lab runs a 306 channels MEG (Neuromag Vectorview) with 128 integrated EEG sensors, a high-density EEG system, and high-performing compute servers. In addition the group has access to a research-only 3T MRI-scanner. All experimental facilities (MEG, EEG, MRI) are supported by experienced physics and IT staff. > > The applicants should have worked in neuroscience before and be motivated to work in a multidisciplinary team (e.g. mathematicians, engineers, psychologists, physicians). > > The postdoc applicant must have a PhD (or equivalent) in computational neuroscience, physics, or a related field and should, ideally, have expertise in EEG or MEG and nonlinear dynamical systems. The PhD student should have a mathematically oriented background in computational neuroscience, physics, or a related field but students with a cognitive neuroscience, psychology, or related background will be considered as well. > > The starting dates for both positions are flexible. Salary is based on German Public service regulations (postdoc TV-L E13, PhD student TV-L E13 65%). The postdoc position is initially for two years with possible extension; the PhD position is for three years with one year possible extension. > > Interested candidates are encouraged to get in touch at their earliest convenience. Applications are considered until 15th of March 2013 but reviewing of the applications will start immediately. > > For questions or an informal discussion about these positions please contact Prof. Stefan Kiebel (skiebel at biomag.uni-jena.de). > > The following documents should be included in the application in a single PDF-file and sent by email to skiebel at biomag.uni-jena.de: A cover letter including a brief description of personal qualifications and future research interests, curriculum vitae, and contact details of two personal references. > > > -- > Prof. Dr. Stefan Kiebel > Biomagnetic Center > Hans Berger Dept of Neurology > Jena University Hospital, Germany > Tel.: +49 (0) 3641 9325770 > http://www.biomag.uni-jena.de From johanna.zumer at donders.ru.nl Thu Jan 24 17:30:35 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Thu, 24 Jan 2013 17:30:35 +0100 Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> References: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Message-ID: Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 24 22:03:05 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 16:03:05 -0500 Subject: [FieldTrip] evoked power greater than total power Message-ID: Hi All, I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? Cheers - Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 22:45:04 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 14:45:04 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From russgport at gmail.com Thu Jan 24 23:07:35 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 17:07:35 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don wrote: > Russ, > > It might help if you posted a bit of your script so that we could see how > you are deriving the measures. But, the relationship you state is true only > given a couple of assumptions. First it depends on how you define induced > power. For some, induced power is the total signal, phase-locked and > non-phase-locked, i.e., the average in the frequency domain. So in that > sense, induced = total. If you are going with the notion that induced = > total - evoked, then yes, you would expect that evoked power would always > necessarily be less than or equal to total power. But second, that > relationship only holds up if you do not baseline correct the power > estimates you are comparing, which is often done in time-frequency > analyses. As far as I recall, in ft_freqanalysis there is no particular > option to return only induced or evoked power in the way that you mention > it, but certainly it could be calculated from the output of that function. > So if you let us know what your cfg options were and subsequent > calculations, it might be more helpful. > > Best, > > Don > ----------------------- > Don Rojas, Ph.D. > UCD Magnetoencephalography Lab > University of Colorado Denver Anschutz Medical Campus > 13001 E. 17th Pl F546 > Aurora, CO 80045 > USA > > > On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > > > Hi All, > > > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both in-vivo > EEG recordings in animals and MEG in children, through freqanalysis. I have > the strange result though that my total power (in either mV^2 or nAm^2) is > less than my evoked power. How can this be, if total=evoked+induced. I am > assuming that something that I have done while handling the data is causing > this error, but I have check my work very carefully. Has anyone ever seen > anything like this before, or can suggest what I am doing to help point me > in the right direction? > > > > Cheers - Russ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 23:17:45 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 15:17:45 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <28BB4648-B4D2-42EA-8E9D-19201531EE49@ucdenver.edu> Yes, I think it is the baseline correction you are doing. Try the comparison without the correction and see if that makes more sense. If there is still a non-trivial difference, then it might be a more interesting problem. On Jan 24, 2013, at 3:07 PM, Russell G Port wrote: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don > wrote: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab 13001 E. 17th Pl F546 Aurora, CO 80045 303-724-4994 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 24 23:24:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 24 Jan 2013 23:24:45 +0100 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <5101B4AD.30901@uni-leipzig.de> On 24/01/2013 22:03, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both > in-vivo EEG recordings in animals and MEG in children, through > freqanalysis. I have the strange result though that my total power (in > either mV^2 or nAm^2) is less than my evoked power. How can this be, if > total=evoked+induced. I am assuming that something that I have done > while handling the data is causing this error, but I have check my work > very carefully. Has anyone ever seen anything like this before, or can > suggest what I am doing to help point me in the right direction? > > Cheers - Russ > Hi Russ, I'm guessing you mean after baseline correction. Evoked and total have very different baselines: with evoked power, pre-stim-onset power is usually pretty much 0, since there shouldn't really be anything time/phase-locked in this period. That's not the case for total power. If you're doing relative measures of change from baseline this difference can be ENORMOUS - for example, I often see evoked power 500 times greater than baseline compared to, say, a 20% increase in total power (this is in the gamma band range). On the single trial level, the evoked, such as it is, contributes very little to the overall signal - averaging out the noise/background/non-phase-locked activity is what makes it stand out. one way people sometimes isolate induced activity is to remove the ERP from each trial before doing the TF; if you do it that way and compare it to total power, you should see that it makes very little difference (which is one reason why I prefer not to do it, another being that it rests on a faulty assumption - that the ERP is stationary and the same on each trial). Basically, there's nothing wrong here. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From caulveil at gmail.com Thu Jan 24 23:32:56 2013 From: caulveil at gmail.com (Jacob Martin) Date: Thu, 24 Jan 2013 17:32:56 -0500 Subject: [FieldTrip] Realtime problems with intensive computations and data loss due to buffer expiration Message-ID: Hello, I have written a Matlab StreamExtractor Class that reads data from the Fieldtrip buffer and then "notifies" various other Matlab component classes that new BCI data is available so that the class can analyze it (e.g. a Signal Viewer component could show the data so far, a Classifier component could classify the newest data, etc). The problem I am having is that since Matlab is single threaded, when the notify method is called, and the notified component does a computationally intense operation (e.g. building a classifier), then by the time that the notify() method returns to the StreamExtractor, many data samples can be lost. It is as if I am limited to very short operations that will return "in time" to catch all the samples that are in the buffer. I have thought to use parallel processing to allow "notify" to return quickly, but that strategy is made difficult with GUIs because pmode processes in Matlab do not have access to graphics. More imporantly, there is some overhead due to launching the parallel processes and executing many notify commands, which may ultimately cause the StreamExtractor class to again miss data if too many classes are listening and being notified by the StreamExtractor. I could "live downsample" the data (currently using 2048hz), but I would prefer to keep 2048hz and just increase the buffer size if possible so that all events will be recorded, regardless of how much time each component takes to return. Is there a way to increase the default buffer size in Fieldtrip so that I will not lose data due to computationally intense operations being executed intermittently during the stream? Does anyone have any other ideas? I'm almost at a loss here... Best wishes, Jacob From mcgoiv0 at wfu.edu Fri Jan 25 01:55:54 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 24 Jan 2013 19:55:54 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Thanks Tom and Arjen! I used -anon with newDs, it works fine. Thanks, Inna Thanks, Inna On Wed, Jan 23, 2013 at 1:08 PM, Arjen Stolk wrote: > Hi Inna, > > Have a look here > > http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset > > Yours, > Arjen > > 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > > Use the CTF tool newDs with the -anon option. >> >> McGowin, Inna wrote: >> >>> Hello, >>> >>> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >>> must be removed from the file)? >>> >>> I have tools for the DICOM format but not for CTF formats. >>> >>> Thanks! >>> -- >>> Inna >>> >>> >>> ------------------------------**------------------------------** >>> ------------ >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> >> -- >> The white knight is talking backwards. >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Jan 25 02:57:37 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 20:57:37 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: <5101B4AD.30901@uni-leipzig.de> References: <5101B4AD.30901@uni-leipzig.de> Message-ID: thanks everyone, I was starting to get a little nervous On Thu, Jan 24, 2013 at 5:24 PM, Matt Craddock wrote: > On 24/01/2013 22:03, Russell G Port wrote: > >> Hi All, >> >> I am currently trying to understand something and I think fieldtrip >> people will already know whats going on. I run my data, from both >> in-vivo EEG recordings in animals and MEG in children, through >> freqanalysis. I have the strange result though that my total power (in >> either mV^2 or nAm^2) is less than my evoked power. How can this be, if >> total=evoked+induced. I am assuming that something that I have done >> while handling the data is causing this error, but I have check my work >> very carefully. Has anyone ever seen anything like this before, or can >> suggest what I am doing to help point me in the right direction? >> >> Cheers - Russ >> >> > Hi Russ, > > I'm guessing you mean after baseline correction. Evoked and total have > very different baselines: with evoked power, pre-stim-onset power is > usually pretty much 0, since there shouldn't really be anything > time/phase-locked in this period. That's not the case for total power. If > you're doing relative measures of change from baseline this difference can > be ENORMOUS - for example, I often see evoked power 500 times greater than > baseline compared to, say, a 20% increase in total power (this is in the > gamma band range). On the single trial level, the evoked, such as it is, > contributes very little to the overall signal - averaging out the > noise/background/non-phase-**locked activity is what makes it stand out. > one way people sometimes isolate induced activity is to remove the ERP from > each trial before doing the TF; if you do it that way and compare it to > total power, you should see that it makes very little difference (which is > one reason why I prefer not to do it, another being that it rests on a > faulty assumption - that the ERP is stationary and the same on each trial). > Basically, there's nothing wrong here. > > Cheers, > Matt > -- > Dr. Matt Craddock > > Post-doctoral researcher, > Institute of Psychology, > University of Leipzig, > Seeburgstr. 14-20, > 04103 Leipzig, Germany > Phone: +49 341 973 95 44 > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ninja78278 at aol.com Fri Jan 25 09:25:34 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Fri, 25 Jan 2013 03:25:34 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: References: Message-ID: <8CFC8ECAE12D748-1708-DAE2@webmail-m001.sysops.aol.com> Hi Johanna, yes, of course, that was my mistake! Thank you :-)!!! Now it is working! 'nai' as cfg.funparameter is working fine. I think I also tried 'avg.nai' in the beginning and got an error. All the best, Ninja -----Original Message----- From: fieldtrip-request To: fieldtrip Sent: Thu, Jan 24, 2013 5:32 pm Subject: fieldtrip Digest, Vol 26, Issue 35 ------------------------------ Message: 3 Date: Thu, 24 Jan 2013 17:30:35 +0100 From: Johanna Zumer To: FieldTrip discussion list Subject: Re: [FieldTrip] lcmv beamform with common filter Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 26, Issue 35 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Jan 26 12:42:10 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 26 Jan 2013 11:42:10 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , , Message-ID: Hi Gianpaolo (or anyone else that can help me out again), Again, thank you very much for putting me onto mne_ex_read_write_raw.m. Unfortunately I am still having problems. Because I appear to have been not too forthcoming in my original email, the problem is with the triggering in our neuromag triux (306 channel) system, I'm having triggers add onto each other and others fail to register with the trigger channels. I've written a script to read in the trigger information from my stimuli presentation software and want to write the accurate data to the main trigger channel (STI101), then save as a new fiff file. By adding code from mne_ex_read_write_raw.m to my overall script (reading the entire data set into memory at once), I'm able to replace the questionable STI101 data with that obtained from my stim software, but have a problem when writing the new fiff file. The size of the input file is ~2gb but when writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of redundant data, but am unable to open the new file, even on a machine running 16gb RAM. I've attached the script and would be extremely grateful for any advice that could be given. Thanks again to everyone on the mailing list whose helped me out so far, Peter. _________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Peter Goodin [pgoodin at swin.edu.au] Sent: Thursday, 24 January 2013 11:05 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: trigchange.m URL: From caspervanheck at gmail.com Sat Jan 26 17:05:28 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Sat, 26 Jan 2013 17:05:28 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Hanneke, But data.anatomy doesn't exist; I added it through the line *data.anatomy = mri.anatomy; clear mri*, but originally it does not have any. I'm going to take a look at earlier steps to find out why this field isn't there in the first place (assuming it should be). Sincerely, Casper On Wed, Jan 23, 2013 at 12:19 PM, Hanneke van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Hi Casper, > > The cfg.anaparameter should then be 'anatomy'. It refers to the field (in > data) in which the anatomy can be found, in your case: data.anatomy. > > Hope this helps, > > Hanneke > Op 23 jan. 2013 10:57 schreef "Casper van Heck" > het volgende: > > Dear Jan-Mathijs, >> >> Since ft_sourceplot complained about not having anatomy (or functional) >> parameter, and it seems to default to a field named '*data.anatomy'*, I >> assumed adding *mri.anatomy* in *data.anatomy* would suffice. >> >> But, without this, ft_sourceplot would again require an anatomy >> parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' >> in the cfg I feed to ft_sourceplot, where 'mri' is the result from >> ft_volumereslice. >> However, ft_sourceplot then says "*do not understand cfg.anaparameter*", >> and thus it is not plotting "*anatomy*". After looking back to the >> plotting tutorial where I read "The anatomy can be read with ft_read_mri", >> I'm not quite sure what's going wrong. >> >> Sincerely, >> >> Casper >> >> >> >> On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi intersect(everyone, casper) >>> >>> Everyone, >>> >>> While the whole script is way too convoluted to put up here, but luckily >>> the relevant steps are quite simple >>> Input is simply raw data, read with ft_preprocessing, which is passed >>> through functions as shown in my previous email. >>> >>> After passing the data to ft_sourcegrandaverage (only using >>> cfg.outputfile), where the data is fed as a cell array (which seems to work >>> properly), I go over to a source-comparison script. This script works as >>> follows: >>> First I create a pre-post contrast as shown in the beamformer tutorial. >>> >>> Next, I read some MRI-data using ft_read_mri from a standard folder, and >>> reslice this data: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >>> * >>> *mri = ft_volumereslice([], mri);* >>> >>> Then: >>> *[data] = ft_sourceinterpolate(cfg, data, mri); >>> * >>> where cfg contains: >>> *cfg.parameter: 'avg.pow'* >>> *cfg.downsample: 4* >>> >>> and I add the anatomy: >>> *data.anatomy = mri.anatomy; clear mri* >>> >>> >>> Putting mri.anatomy into data.anatomy is probably not what you want to >>> do: the whole point about ft_sourceinterpolate is to get the functional and >>> anatomical data in the same 'pixel-space'; this is the only way that >>> ft_sourceplot (as of yet) can deal with it. The reason is that now the >>> functional data is sampled once every 4 voxels, relative to the anatomy. I >>> guess that this causes your problem in ft_sourceplot. >>> >>> >>> >>> Best wishes, >>> >>> Jan-Mathijs >>> >>> >>> >>> And finally, I call ft_sourceplot using these options: >>> >>> cfg.*parameter: 'avg.pow';* >>> >>> *cfg.downsample: 4* >>> >>> * >>> * >>> >>> with one of these three methods: >>> 1) *cfg.method = 'surface';* >>> * cfg.surffile = 'surface_l4_both.mat';* >>> * cfg.surfdownsample = 4;* >>> * cfg.projmethod = 'nearest';* >>> 2) *cfg.method = 'ortho';* >>> 3) *cfg.method = 'slice';* >>> * cfg.nslices = 20;* >>> Which leads to the errors shown earlier. At this point, disp(data) >>> yields: >>> *K>> disp(data)* >>> * avg: [1x1 struct]* >>> * pos: [16777216x3 double]* >>> * dim: [256 256 256]* >>> * inside: [1x16777216 double]* >>> * outside: [1x0 double]* >>> * coordsys: 'ctf'* >>> * unit: 'mm'* >>> * cfg: [1x1 struct]* >>> * anatomy: [256x256x256 double]* >>> * >>> * >>> I'm guessing it has something to do with the 'inside' and 'outside' >>> elements, so my 'standard head model'. I think I made this using the >>> following code: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load >>> 'standard' anatomical model >>> * >>> * >>> * >>> *% segment the template brain and construct a volume conduction model >>> (i.e. head model)* >>> *cfg = [];* >>> *cfg.output = {'brain' 'scalp' 'skull'};* >>> *cfg.downsample = 2;* >>> *t_seg = ft_volumesegment(cfg, mri);* >>> * * >>> *% create head model* >>> *cfg = [];* >>> *cfg.method = 'singlesphere';* >>> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >>> *cfg.elec = ft_read_sens('standard_1020.elc');* >>> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >>> *clear template_seg* >>> * >>> * >>> *% construct the dipole grid in the template brain coordinates* >>> *cfg = [];* >>> *cfg.normalize = 'no'; % no normalization, since we're comparing two >>> conditions THAT'S RIGHT I DID PAY ATTENTION* >>> *cfg.vol = t_vol;* >>> *t_grid = ft_prepare_sourcemodel(cfg);* >>> * >>> * >>> After which I use this on all subjects, using this (note that I store >>> all data in a single massive structure, to make saving to disk and >>> selecting data etc. easier): >>> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >>> * >>> * >>> Anyone seeing anything obviously stupid? >>> >>> Sincerely, >>> >>> Casper >>> >>> >>> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >>> >>>> Hi Casper, >>>> >>>> I think it is really difficult to figure only from the error message >>>> what >>>> the problem is. I think it would be also useful to see the inputs (cfg, >>>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>>> your data-structure looks like? (I mean that you do not need to send the >>>> actual data, just the screen output of disp(data) and disp(cfg)). >>>> >>>> Best, >>>> Lilla >>>> >>>> >>>> > Dear Fieldtrippers, >>>> > >>>> > I've asked this question earlier, but either it got lost due to >>>> technical >>>> > reasons, or the people who actually understand what's happening here >>>> were >>>> > on vacation, so here it is again: >>>> > >>>> > I've been trying to do a source analysis on a dataset with two >>>> conditions, >>>> > mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> > come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> > essential component of the analysis of this dataset (it's more along >>>> the >>>> > lines of "let's see if I can do this"), and I don't expect any result >>>> > other >>>> > than something like "there might be a source in the left hemisphere", >>>> I'd >>>> > still would like to found out why it's not working. >>>> > >>>> > Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> Fieldtrip >>>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> average >>>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> > >>>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>>> > surface. Initially I tried to get the ortho-option to work, but this >>>> gave >>>> > the following error: >>>> > *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> > *Error in ==> cornerpoints at 11 >>>> > * >>>> > *Error in ==> ft_plot_slice at 157 >>>> > * >>>> > >>>> > So, I tried the surf-option, which gave me this: >>>> > *Undefined function or variable "val".* >>>> > *Error in ==> ft_sourceplot at 1174 >>>> > * >>>> > >>>> > And finally, I tried the slice-option, which gave one of two errors >>>> (which >>>> > seems to be based on how many slices I requested): >>>> > *Out of memory* >>>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> > topping of at 40GB >>>> > Or, the mildly disconcerting: >>>> > *Matlab has encountered an internal error and has to close* >>>> > Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> > * >>>> > >>>> > Can anyone offer any insight in these errors? I think I'm doing >>>> something >>>> > wrong pretty early on, but have no idea what it is. >>>> > >>>> > Sincerely, >>>> > >>>> > Casper van Heck >>>> > >>>> > >>>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>>> > wrote: >>>> > >>>> >> Dear Fieldtrippers, >>>> >> >>>> >> I've been trying to do a source analysis on a dataset with two >>>> >> conditions, >>>> >> mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> >> come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> >> essential component of the analysis of this dataset (it's more along >>>> the >>>> >> lines of "let's see if I can do this"), and I don't expect any result >>>> >> other >>>> >> than something like "there might be a source in the left hemisphere", >>>> >> I'd >>>> >> still would like to found out why it's not working. >>>> >> >>>> >> Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> >> Fieldtrip >>>> >> to find sources based on individual EEG-datasets using >>>> ft_freqanalysis >>>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> >> average >>>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> >> >>>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, >>>> and >>>> >> surface. Initially I tried to get the ortho-option to work, but this >>>> >> gave >>>> >> the following error: >>>> >> *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> >> *Error in ==> cornerpoints at 11 >>>> >> * >>>> >> *Error in ==> ft_plot_slice at 157 >>>> >> * >>>> >> >>>> >> So, I tried the surf-option, which gave me this: >>>> >> *Undefined function or variable "val".* >>>> >> *Error in ==> ft_sourceplot at 1174 >>>> >> * >>>> >> >>>> >> And finally, I tried the slice-option, which gave one of two errors >>>> >> (which >>>> >> seems to be based on how many slices I requested): >>>> >> *Out of memory* >>>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> >> topping of at 40GB >>>> >> Or, the mildly disconcerting: >>>> >> *Matlab has encountered an internal error and has to close* >>>> >> Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> >> * >>>> >> >>>> >> Can anyone offer any insight in these errors? I think I'm doing >>>> >> something >>>> >> wrong pretty early on, but have no idea what it is. >>>> >> >>>> >> Sincerely, >>>> >> >>>> >> Casper van Heck >>>> >> >>>> > _______________________________________________ >>>> > fieldtrip mailing list >>>> > fieldtrip at donders.ru.nl >>>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Sun Jan 27 10:49:56 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Sun, 27 Jan 2013 10:49:56 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex From dave at davebritton.com Sun Jan 27 22:21:17 2013 From: dave at davebritton.com (Dave Britton) Date: Sun, 27 Jan 2013 16:21:17 -0500 Subject: [FieldTrip] cfg.viewmode='reject' throws databrowser error Message-ID: <51059A4D.2050702@davebritton.com> In the following preprocessing, reject_visual and databrowse sequence, ft_reject_visual sets viewmode to 'reject' as a default (line 176), then when ft_databrowser is run, it throws an error upon finding viewmode='reject'. (from main routine semattn.m:) data = ft_preprocessing(cfg); cfg.layout='butterfly'; [data2] = ft_rejectvisual(cfg, data); data2.cfg.layout=cfg.layout; cfg = ft_databrowser(data2.cfg,data2); >> Error using ft_databrowser>redraw_cb (line 1713) unknown viewmode "remove" Error in ft_databrowser (line 685) redraw_cb(h); Error in semattn_main (line 76) cfg = ft_databrowser(data2.cfg,data2); Am I doing something wrong or is this a bug? -Dave From pgoodin at swin.edu.au Sun Jan 27 23:36:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 27 Jan 2013 22:36:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Thanks for letting me know! I'll try changing the precision and see how it goes! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Sunday, 27 January 2013 8:49 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Mon Jan 28 13:07:08 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Mon, 28 Jan 2013 12:07:08 +0000 Subject: [FieldTrip] How to use ft_average_sens? Message-ID: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Hello Fieldtrippers, I get an error message when using ft_average_sens and couldn't find the solution on the ft homepage. Here is my short code: grad_01 = ft_read_sens('Run_01.ds') grad_02 = ft_read_sens('Run_02.ds') AvgGrad = ft_average_sens(grad_01, grad_02) And that's error message: ??? Error using ==> ft_getopt the first input should contain key-value pairs Anyone who can help me there? Thanks and best regards, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Mon Jan 28 13:11:10 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 28 Jan 2013 12:11:10 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Jan 28 13:20:58 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Jan 2013 13:20:58 +0100 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tkietzma at uos.de Mon Jan 28 17:03:47 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Jan 2013 17:03:47 +0100 Subject: [FieldTrip] Problems with Dipole Fitting Message-ID: Dear Mailing List, I am currently trying to use the ft_dipolefitting function to localize the source of a visually evoked response, and to use the dipole time-course to test for effects in source space. Along the way, however, a few questions and problems arose, which I was not yet able to solve despite excessive trying, reading and googling. Some of the questions are technical, others are more general. Please note that I am new to fieldtrip and source localization, so please excuse the potentially stupid ones. The general setup is that we have collected data using a CTF275 system, looking at visually evoked responses (we are showing drawings of faces). The data is cleaned already and we have a structural MRI scan for every subject, which we can use for individual headmodels (I use singleshell, and the models look perfectly fine). As every trial also contained a button-press I first fitted dipoles locked to this button-press as a sanity check. This worked nicely for all subjects. However, I am now looking into the visually evoked responses. This has given me a lot of trouble (see below). Here is the code I use for the actual fit: cfg=[]; cfg.numdipoles =2; cfg.symmetry = 'y'; %I use this, as I expect bilateral visual activations cfg.latency = [.1 .12]; cfg.vol = subvol_singleshell; %volume conduction model for the subject cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, ERF_all); Question 1: Dipole Time Courses To look at the individual time-courses of the dipoles I follow http://mailman.science.ru.nl/pipermail/fieldtrip/2011-April/003690.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-May/005215.html. The returned dipole information in dip.pos is 2x3 (two dipoles, three dimensions), so I can easily pick the position of each of the two dipoles. The dip.mom, however has size 6x13. Is it correct that the first three values of source.dip.mom correspond to the first dipole, and 4:6 to the second dipole? That is, to show the two activations, can I do the following? dip_select=1; dip = source.dip.pos(dip_select,:); [u,s,v] = svd(source.dip.mom((1:3)+(dip_select-1)*3,:)); [vol, grad] = ft_prepare_vol_sens(subvol_singleshell, ERF_all.grad, 'channel', ERF_all.label); L = ft_compute_leadfield(dip, grad,vol,'reducerank',2); % leadfield Li = pinv(L); % pseudoinverse of L %check which orientation the dipole is in orientation_vector = u(:,1)'; Qn = double(orientation_vector/norm(orientation_vector)); % normed orientation vector Qn = repmat(Qn,length(Li),1)'; % make Qn the same size as Li W = dot(Li,Qn)'; % weights for projection to source space waveform = dot(ERF_all.avg,repmat(W,1,size(ERF_all.avg,2))); % source waveform Given this is correct, I noticed in the resulting waveforms that only one of the two dipoles shows a clear activation, whereas the other seems to cover mostly remaining noise. However, based on the perfectly symmetric topography of the activation and given this is a visual response (the M100), I would expect both hemispheres (and therefore both dipoles) to be activated. In fitting the dipole location and moment, is there some sort of regularization, which prefers one strong dipole over two equally active dipoles? Any ideas on this? Question 2: ICA topographies as basis for the fit Given I had quite some problems with the reliability of the fits when using the sensor data, I also tried fitting the dipoles to selected ICA components (namely the ones which explain most of the variance across sensors at a given time-point, the comp structure is given as is from ft_componentanalysis). This, however, lead to the following warning/error: cfg=[]; cfg.numdipoles =1; cfg.component = [17]; cfg.vol = subvol_singleshell;%volume conduction model cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, comp); the input is component data with 271 components and 271 original channels using headmodel specified in the configuration using gradiometers specified in the data computing surface normals selected 0 channels selected 1 topographies Warning: not enough channels to perform a dipole fit I am sure this is a simple mistake, but could not yet successfully solve it. Could it have to do with the fact that the comp structure has a comp.topolabel the original sensor labels, and as comp.label the ICA labels ('runica001' ..)? Question 3: Sensor Averaging Since all else failed, I wanted to use the average gradient position across subjects together with the MNI standard brain to find the dipoles based on the Grand Average activation. Here, I would like to use the ft_average_sens function. However, I have the problem that different subjects were recorded with slightly different numbers of sensors (some with 271 sensors, some with 273). Because of this, the ft_average_sens function throws an error. Is there a way to select a subset of sensors from the grad structure such that I only use the sensors which were present for all subjects? Question 4: Stability of the Fit The toughest and most general question at last: I noticed that the solutions I get from ft_dipolefitting are not very robust. For instance, I get vastly different dipole locations with only subtle changes in the selected time-points. Moreover, although subjects show a clear M100 in sensor space, the dipole locations for some of them are extremely far off (if not to say in the middle of nowhere). Are there certain methods, tricks or tutorials I can look into to get things more robust? I am truly sorry to have so many questions, but any help is highly appreciated! I look very much forward to hearing from you Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 17:55:50 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 11:55:50 -0500 Subject: [FieldTrip] GE MRI platform 12.0 scans don't import into CTF MRIViewer Message-ID: Hello, We have an MRI research scan, GE MRI platform 12.0, that produces scans with some DICOM header fields missing. These fields are required in order to import the scan into CTF MRIViewer or DICOM_Viewer or some other software. Does anybody know if these missing fields can be somehow added to the DICOM header? Maybe in Matlab or through some conversion method? Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 18:01:06 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 12:01:06 -0500 Subject: [FieldTrip] CTF MEG current phantom Message-ID: Hello, Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. It's made of plastic and suppose to be non-magnetic. Thanks, -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Mon Jan 28 18:30:50 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 28 Jan 2013 10:30:50 -0700 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: Message-ID: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> We don't use that phantom, but the 4D MEG phantom is similar in nature. If it is electrically disconnected, then perhaps the mounting of it is coupling in some vibration that is being picked up by your sensors due to some weakly magnetic component to the phantom or phantom mount. Are you certain that the origin of the signal is the phantom? On Jan 28, 2013, at 10:01 AM, "McGowin, Inna" wrote: > Hello, > Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? > If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. > > It's made of plastic and suppose to be non-magnetic. > Thanks, > -- > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Jan 28 19:59:34 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 13:59:34 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: Yes, I run all kind of scans: noise test (good), disconnected phantom (noisy), phantom with dipole removed (noisy), phantom with saline solution removed (noisy); dipole alone (good), saline alone (good). Below is the snapshot for Phantom with no saline solution or dipole: Thanks.[image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 61830 bytes Desc: not available URL: From mushfa.yousuf at googlemail.com Mon Jan 28 20:20:31 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Mon, 28 Jan 2013 20:20:31 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction Message-ID: Hello Fieldtrippers, I am currently doing source analysis using beamformer method in fieldtrip. The data i work on is a simultaneous measurement of MEG (306) with EEG (128) on PD patients. I was successful in calculating the sources for both the modalities alone. I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation of the lead field. But, then when i want to use the created vol for the source analysis i have two structures one for EEG and the second one for MEG. Now, i can only define only one to estimate the sources. How to use this for both the modalities? Any help would be appreciated. With regards Mushfa -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Mon Jan 28 20:44:43 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 28 Jan 2013 14:44:43 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5106D52B.5050203@kurage.nimh.nih.gov> With no fluid I would hazard a guess that you are seeing building vibration. Try just putting a stiff wire under the helmet and see what kind of vibration you get. McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). -- The white knight is talking backwards. From mcgoiv0 at wfu.edu Tue Jan 29 01:28:07 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 19:28:07 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5106D52B.5050203@kurage.nimh.nih.gov> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5106D52B.5050203@kurage.nimh.nih.gov> Message-ID: Thanks, I will try that. It seems like the plastic material of the phantom is contaminated with some magnetic impurities... Inna On Mon, Jan 28, 2013 at 2:44 PM, Tom Holroyd (NIH/NIMH) [E] < tomh at kurage.nimh.nih.gov> wrote: > With no fluid I would hazard a guess that you are seeing building > vibration. Try just putting a stiff wire under the helmet and see what kind > of vibration you get. > > > McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom (noisy), >> phantom with dipole removed (noisy), phantom with saline solution removed >> (noisy); dipole alone (good), saline alone (good). >> > > -- > The white knight is talking backwards. > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Tue Jan 29 08:21:30 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Tue, 29 Jan 2013 08:21:30 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5107787A.5030309@wwu.de> Hi Inna, did you fixate the cables and connectors of the Current Phantom? Are the cables twisted? Andreas On 01/28/13 19:59, McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From patrick.jung at esi-frankfurt.de Tue Jan 29 09:52:37 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:52:37 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309B6@UM-EXCDAG-A01.um.gwdg.de> Thanks, Eelke, that works fine. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: 28 January 2013 13:21 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Tue Jan 29 09:54:12 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:54:12 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309C2@UM-EXCDAG-A01.um.gwdg.de> Thanks, Vladimir, that works. I did not understand that I have to concatenate the arrays. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Vladimir Litvak Sent: 28 January 2013 13:11 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From andrea.brovelli at univ-amu.fr Tue Jan 29 17:16:05 2013 From: andrea.brovelli at univ-amu.fr (andrea brovelli) Date: Tue, 29 Jan 2013 17:16:05 +0100 Subject: [FieldTrip] Error in prepare_freq_matrices.m ? Message-ID: <20130129171605.176164iln90u72f4@wmelperso1.univmed.fr> Dear all, I have an error while running ft_sourceanalysis. I am analysing a data set over a frequency range which includes 100 frequencies and 60 trials. I get an error due to the definition of the variable Ntrials, which as far as I understand, it is done in prepare_freq_matrices.m at lines 76 -> 85: ------------------------------------------------- % the time-frequency latency has already been squeezed away (see above) if strcmp(freq.dimord, 'chan_freq') Ntrials = 1; elseif strcmp(freq.dimord, 'rpt_chan_freq') Ntrials = length(freq.cumtapcnt); elseif strcmp(freq.dimord, 'rpttap_chan_freq') Ntrials = length(freq.cumtapcnt); else error('unrecognized dimord for frequency data'); end ------------------------------------------------- If the number of trials is less than the number of frequencies, Ntrials = length(freq.cumtapcnt) should be replaced by Ntrials = size(freq.cumtapcnt,1); It is the case ? Thanks a lot Andrea From fanny.lachat at gmail.com Tue Jan 29 16:56:20 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 16:56:20 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? Message-ID: Dear fieldtrip users, I am trying to use the function* ft_selectdata_new * on my data. I have time-frequency data that come from ft_freqanalysis. I want to average my data over the frequency of interest (10-12Hz). ---------------------- Here is my script : cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.frequency = [10 12]; cfg.avgoverfreq = 'yes'; cfg.latency = [-0.7 1]; cfg.avgovertime = 'no'; avg_10_12 = ft_selectdata_new (cfg,mydata); ------ This doesn't work : 'Undefined function 'ft_selectdata_new' for input arguments of type 'struct'. What should I change in my script in order for it to work ? (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); Thank you in advance ! -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Tue Jan 29 17:23:22 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Tue, 29 Jan 2013 17:23:22 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hi Fanny, Thats a matlab error when it cant find the function (ft_selectdata_new) since its probably in a private folder. Try ft_selectdata (it will figure out if you're using it in the old (key-value pairs) or new (cfg,data) way). Cheers, Stephen On 29 January 2013 16:56, Fanny wrote: > Dear fieldtrip users, > > I am trying to use the function ft_selectdata_new on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From johanna.zumer at gmail.com Tue Jan 29 17:23:15 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 29 Jan 2013 17:23:15 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hello, This sounds like it could be a path issue. Is ft_selectdata_new in your path? If you type 'which ft_selectdata_new' does it show up? If not, type ft_defaults and then try again. If still a problem...I'll have to look closer. Cheers, Johanna 2013/1/29 Fanny > Dear fieldtrip users, > > I am trying to use the function* ft_selectdata_new * on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanny.lachat at gmail.com Tue Jan 29 17:31:19 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 17:31:19 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Thank you Johanna, with the use of ft_defaults my script works now ! Cheers 2013/1/29 Johanna Zumer > Hello, > > This sounds like it could be a path issue. Is ft_selectdata_new in your > path? If you type 'which ft_selectdata_new' does it show up? If not, type > ft_defaults and then try again. > > If still a problem...I'll have to look closer. > > Cheers, > Johanna > > > 2013/1/29 Fanny > >> Dear fieldtrip users, >> >> I am trying to use the function* ft_selectdata_new * on my data. >> I have time-frequency data that come from ft_freqanalysis. >> >> I want to average my data over the frequency of interest (10-12Hz). >> >> ---------------------- >> Here is my script : >> >> cfg = [ ]; >> cfg.parameter = 'powspctrm'; >> cfg.frequency = [10 12]; >> cfg.avgoverfreq = 'yes'; >> cfg.latency = [-0.7 1]; >> cfg.avgovertime = 'no'; >> >> avg_10_12 = ft_selectdata_new (cfg,mydata); >> ------ >> >> This doesn't work : 'Undefined function 'ft_selectdata_new' for input >> arguments of type 'struct'. >> >> What should I change in my script in order for it to work ? >> (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); >> >> Thank you in advance ! >> >> -- >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Jan 29 19:46:47 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Jan 2013 13:46:47 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5107787A.5030309@wwu.de> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: Hi Andreas, The problem is that there are no cables or connecters used for the noise test study I did on the phantom. Just the phantom... It seems it has some magnetic contamination and creates a signal due to vibration. My next step is to clean thoroughly the phantom, inside and outside, and see will it help. Thanks, Inna On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink wrote: > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom >> (noisy), phantom with dipole removed (noisy), phantom with saline >> solution removed (noisy); dipole alone (good), saline alone (good). >> >> Below is the snapshot for Phantom with no saline solution or dipole: >> Thanks.Inline image 1 >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> >> > -- > > ==============================**==============================**========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > D-48149 Muenster mobil: +49-(0)160-98527553 > Germany fax: +49-(0)251-83-56874 > e-Mail: a.wollbrink at wwu.de > > ==============================**==============================**========== > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Wed Jan 30 11:27:32 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Wed, 30 Jan 2013 11:27:32 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: <5108F594.7000707@wwu.de> Hi Inna, did you detect the intefering signal in the reference channels as well? How do the MEG sensor signals behave for different noise balancing settings (different synthetic gradiometer orders)? Cheers, Andreas On 01/29/13 19:46, McGowin, Inna wrote: > Hi Andreas, > The problem is that there are no cables or connecters used for the noise > test study I did on the phantom. > Just the phantom... It seems it has some magnetic contamination and > creates a signal due to vibration. > My next step is to clean thoroughly the phantom, inside and outside, and > see will it help. > Thanks, > Inna > > On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink > wrote: > > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > -- > > ==============================__==============================__========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > > D-48149 Muenster mobil: +49-(0)160-98527553 > > Germany fax: +49-(0)251-83-56874 > > e-Mail: a.wollbrink at wwu.de > > > ==============================__==============================__========== > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > > > -- > Inna McGowin > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From singhharsimrat at gmail.com Wed Jan 30 18:26:46 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 30 Jan 2013 17:26:46 +0000 Subject: [FieldTrip] Reading events from a trigger channel Message-ID: Hi Fieldtrippers My data is in edf format but has a event marker channel in the form of pulse on channel 1. I have tried to use event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2,'detectflank','up'); But 'detectflank' doesn't seem to work. Is it particular for MEG data format (yokogawa). Can some one give me an idea how to define pulses on channel trials in define trial. The channel has same Fs as data channels. Thanks for your help in advance. Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.stoffers at gmail.com Thu Jan 3 19:39:37 2013 From: d.stoffers at gmail.com (Diederick Stoffers) Date: Thu, 3 Jan 2013 19:39:37 +0100 Subject: [FieldTrip] Brain imaging PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands. Message-ID: <21E5F1A0-241E-43B6-957B-18A7767A7B51@gmail.com> Dear all, Please find attached a description of PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands, that I am posting on behalf of my group leader. Relevant keywords for this project are sleep, emotion, arousal, high-density EEG, fMRI, insomnia and internet. Cheers, Diederick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VacancyPhDCandidateBrainImaging.pdf Type: application/pdf Size: 83310 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 3 23:02:29 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 3 Jan 2013 17:02:29 -0500 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data Message-ID: Hello All, I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on this board, i.e. to use ft_connectivityanlaysis, or using tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc >From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of coherence), since when plotting cross-spectra you would need a reference channel? Thanks Russell Port Upenn Neuroscience Graduate Group -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 4 09:38:08 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Jan 2013 09:38:08 +0100 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data In-Reply-To: References: Message-ID: Dear Russell, There's an important detail that you may have glossed over, and relates indeed to the difference between PLV and ITC. ITC can be defined within a single electrode (i.e. it is a univariate measure), and it quantifies the phase consistency across observations, of oscillations relative to an event of interest. PLC can only be defined across two electrodes (i.e. it is a bivariate measure), and it quantifies the phase difference consistency across observations, of oscillations (i.e. relative to one another). The reference electrode does not count as a second electrode in this case. In other words, it looks like you can only compute ITC. In order to visualize it, you can do something like this: freqnew = freq; freqnew = rmfield(freq, 'fourierspctrm'); freqnew.powspctrm = itc; cfg = ... (build the cfg according to your needs) figure;ft_singleplotER(cfg, freqnew); Best wishes, Jan-Mathijs On Jan 3, 2013, at 11:02 PM, Russell G Port wrote: > Hello All, > > I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal > electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 > corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which > would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets > and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking > value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on > this board, i.e. to use ft_connectivityanlaysis, or using > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as > ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of > coherence), since when plotting cross-spectra you would need a reference channel? > > Thanks > Russell Port > Upenn Neuroscience Graduate Group > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Jan 4 15:50:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Jan 2013 15:50:21 +0100 (CET) Subject: [FieldTrip] Question about cluster-based statistical testing (sum of t-stats or suprathreshold t-stats?) In-Reply-To: References: <50de2ca3.e90b320a.2720.73b5SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03ae01cdea8a$d4476e90$7cd64bb0$@maris@psych.ru.nl> Dear Artemy, Importantly, these constants also enter in the permutation distribution that is used to evaluated the significance of the maximum cluster-mass statistic, to the effect that the Bullmore-style and the Fieldtrip-style permutation distributions are shifted versions of each other. As a result, the p-values that roll out of the two approaches are identical. If I understand correctly, having the same resulting p-values could only be if the two methods assign the same rank-ordering to a given a set of clusters. But I don't think that is the case. Let's imagine that the t-statistic cutoff 'c' is equal to 1, and the data contains two suprathreshold clusters (let's say this is a spatial test and the clusters are composed of electrodes): - The first cluster has 10 electrodes, each one with a t-statistic equal to 1.1 - The second cluster has 2 electrodes, both with a t-statistic equal to 3 As I understand, Bullmore's method would assign cluster 1 a mass of 10*(1.1-1) = 1 and cluster 2 a mass of 2*(3-1)=4 , while your method would assign cluster 1 a mass of 10*1.1 = 11 and cluster 2 a mass of 2*3 = 6. Hence, given a null distribution, it should be possible to choose a cluster-based threshold that indicates as significant only cluster 1 under Bullmore's method, and only cluster 2 under yours. I think your reasoning is correct: when the data contain more than one suprathreshold cluster, my argument does not apply anymore. Your example shows that the Bullmore- and Fieldtrip-style cluster statistics have different sensitivities. Thank you for pointing this out. For every test statistic, the decisions based on the permutation p-value controls the type-I error rate, but the type-II error rate (the complement of sensitivity) depends on the exact test statistic. Thanks for confirming that up. I should note, though, that this is an issue even in data without multiple suprathreshold clusters. The same logic as above -- which shows that the two measures gives different ranks to same set of clusters -- also applies to the distribution of clusters under the null hypothesis. Thus one can imagine a single cluster in the data that would be judged significant under Fieldtrip's method and not significant under Bullmore, or vice-versa. I believe that generally, in comparison to Bullmore's method, Fieldtrip's method would tend to favor judging-as-significant large clusters (with many electrodes). Sure, it also applies to the distribution of clusters under the null hypothesis and, therefore, can result in different p-values for the Fieldtrip and the Bullmore style cluster statistics, even when there is only single cluster in the data. I should have made this more explicit in my reply, especially since the distribution of clusters under the null hypothesis is random (and therefore a focus on the single-cluster-in-the-data situation is not a very useful one). I personally think of the distinction not so much in terms of controlling sensitivity, but rather as concerning the definition of what counts as a cluster of interest. Though both methods look for spatiotemoprally contiguous regions of electrodes that exceed threshold, for Bullmore the cluster is the sum of suprathreshold statistic values , while for Fieldtrip it's the sum of the entire statistic values in the region. I'm quite interested in the question of which gives more justifiable/better results in real-world settings, though unfortunately I have not seen any work done on the matter. From what I have seen in my brief forays into the extensive analytic + numerical studies of cluster-based significance testing in the fMRI literature, in that field they always refer to Bullmore-style clusters. I do think that sensitivity is a crucial concept here. Neurobiological data are almost always high-dimensional (data arrays with dimensions space, time and/or frequency), but the statistical test only answers the question whether there is some direction in this high-dimensional space along which the experimental conditions differ. It is crucial that our test statistics are chosen such that they have a high sensitivity in the directions that are neurobiologically plausible. In a recent paper in Psychophysiology (2012), I took some time to explain this issue. Note that others in the field (e.g., Karl Friston) often put forward the claim that parametric statistical tests (e.g., the t-statistic) are always more sensitive than nonparametric statistical tests. This claim only holds for scalar observations (e.g., an electrical potential measured at one electrode and one post-stimulus time), which is not the type of data neurobiological studies are typically interested in. Thanks for your interest in this issue. You ask the right questions. Also, my apologies for my earlier sloppy replies. Eric Thanks again & happy holidays... -Artemy -------------- next part -------------- An HTML attachment was scrubbed... URL: From taherahlansari at hotmail.com Fri Jan 4 18:44:42 2013 From: taherahlansari at hotmail.com (Tahereh L. Ansari) Date: Fri, 4 Jan 2013 17:44:42 +0000 Subject: [FieldTrip] RealTime fMRI _ Problem with gui_Streamer In-Reply-To: References: Message-ID: Hi,I get this error (in the cmd window of the siemens_gui_streamer): "Warning: another change on file E:/IMAGE/...xxxxx.PixelData detected - ignoring" when i've ran one scan (e.g. structural) and am now running the second scan (e.g functional)! So it seems that if 'xxxx.PixelData' is detected in E:/IMAGE, gui_streamer will NOT send it to the buffer (even though this xxxx.PixelData belongs to a new scan session!) and gives the above warning!! restarting the gui_streamer does not help either! Please help! L -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertram0611 at pku.edu.cn Sat Jan 5 09:12:28 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) Subject: [FieldTrip] =?gbk?q?Questions_about_Cluster-based_permutation_tes?= =?gbk?q?ts_on_time-frequency_data?= Message-ID: <2121284504.247.1357373548881.JavaMail.root@bj-mail07.pku.edu.cn> Dear all, I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. Thanks in advance! -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From vitoria.piai at gmail.com Sat Jan 5 11:21:34 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:21:34 +0100 Subject: [FieldTrip] When to detrend/demean Message-ID: <50E7FEAE.3080103@gmail.com> Dear ftrippers, I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? As relevant background, our EEG datasets involve speech production on every trial. We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. But in the FT example 'Reading and pre-processing EEG data', the cfg is cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. Then, when calculating ERPs, I had both demean and detrend before timelocking. But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? - preprocess with default (so NO detrend and NO demean) - then demean and detrend for ft_timelockanalysis and ft_freqanalysis Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! Vitoria From vitoria.piai at gmail.com Sat Jan 5 11:38:54 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:38:54 +0100 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data (??) In-Reply-To: References: Message-ID: <50E802BE.7040005@gmail.com> Dear Lin, There have been previous posts on that matter, for example: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004260.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html Good luck! On 1/5/2013 11:21 AM, fieldtrip-request at science.ru.nl wrote: > > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! From politzerahless at gmail.com Sat Jan 5 11:54:53 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 18:54:53 +0800 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data Message-ID: Hello Lin, Hi Lin, Yes, it's definitely possible to use the cluster-based test for a 2x2 within-subjects design, by hard-coding the main effects and the interaction. See http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html Best, Steve Politzer-Ahles > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! > -- > Lin Cai > Department of Psychology, > Peking University, > Beijing 100871, P.R.China > -------------- next part -------------- > An embedded and charset-unspecified text was scrubbed... > Name: SpamAssassinReport.txt > URL: From politzerahless at gmail.com Sat Jan 5 12:07:09 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 19:07:09 +0800 Subject: [FieldTrip] When to detrend/demean Message-ID: Hi Vitoria, This is not exactly my area of expertise, but I just wanted to point out that in other speech production ERP research I'm familiar with (such as bereitschaftspotential experiments--e.g. McArdle et al., 2009, in Clinical Neuropsychology), a baseline period somewhere before the onset of motor activity is used. (For instance, that paper used [-3 -2.5] relative to the onset of articulator movement.) However, if you're using ICA, there is an argument that ICA does better when you use the whole epoch as the baseline (or at least use a pretty long baseline) or do no baseline correction at all (David Groppe has a paper on this, Groppe et al. 2009 in NeuroImage); see e.g. http://sccn.ucsd.edu/pipermail/eeglablist/2010/003539.html. Best, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://people.ku.edu/~sjpa/ > Message: 4 > Date: Sat, 05 Jan 2013 11:21:34 +0100 > From: Vit?ria Magalh?es Piai > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] When to detrend/demean > Message-ID: <50E7FEAE.3080103 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a lot, > I thought it would be my best chance to get a good answer: When should > we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials often > include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right next > time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria From inieuwenhuis at berkeley.edu Sun Jan 6 03:24:56 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Sat, 05 Jan 2013 18:24:56 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E7FEAE.3080103@gmail.com> References: <50E7FEAE.3080103@gmail.com> Message-ID: <50E8E078.1030407@berkeley.edu> Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From bertram0611 at pku.edu.cn Sun Jan 6 06:03:47 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sun, 6 Jan 2013 13:03:47 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAgV2hlbiB0byBkZXRyZW5k?= =?utf-8?q?/demean?= In-Reply-To: <50E8E078.1030407@berkeley.edu> Message-ID: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Hi Ingrid After having seen your explaination, I want to know the relationship between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the linear detrending can reduce a linear trend due to equipment drift over longer time just as you said before. But I think the highpass filter have the same function as detrending. Am I right? If I want to do a time-frequency analysis, must I filter my raw data? I hope you can give me some advice. I have been puzzled for a long time. Thanks! Lin ----- 原始邮件 ----- 发件人: Ingrid Nieuwenhuis 收件人: fieldtrip at science.ru.nl 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) 主题: Re: [FieldTrip] When to detrend/demean Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From ith at deakin.edu.au Mon Jan 7 04:31:38 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Mon, 7 Jan 2013 03:31:38 +0000 Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: From r.oostenveld at donders.ru.nl Mon Jan 7 09:54:21 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 7 Jan 2013 09:54:21 +0100 Subject: [FieldTrip] fieldtrip website down Message-ID: Dear FieldTrip users First of all a Happy New Year to all of you! The last year has seen a steadily growth in the number of users of FieldTrip and especially in the contributions to this email discussion list. I am really happy to see so many valuable contributions from people all over the world and hope that in 2013 we can further strenghen our community. However, for the server hosting the FieldTrip website the new year did not start that well: last Saturday it was hacked. Over the weekend you may have noticed that you were redirected to an obscure website in Togo. Also some other websites hosted on this server have been compromised. We are working on restoring the server and the FieldTrip website, you can expect it to be up and running again in a few hours. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- From jm.horschig at donders.ru.nl Mon Jan 7 11:49:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 07 Jan 2013 11:49:11 +0100 Subject: [FieldTrip] MEG-EMG coherence In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> Message-ID: <50EAA827.2030101@donders.ru.nl> Dear Bethel, I don't see any potential reason why to not use the same procedure for MEG-EMG as for EEG-EMG. FieldTrip regards any signal the same, and for most analysis it does not care if it is electrical or magnetical or anything else. Best, Jörn On 12/13/2012 12:39 AM, Bethel Osuagwu wrote: > Dear all, > I am new to FieldTrip. > Is FieldTrip limited to MEG-EMG coherence computation? > I want to use FieldTrip to compute EEG-EMG coherence. The EEG and EMG data was recorded with Biosig. > What procedure do I follow to obtain the coherence. Any help will be highly appreciated. > > Thank you very much > Bethel > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.vandermeij at donders.ru.nl Mon Jan 7 13:28:01 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:28:01 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E8E078.1030407@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: Hi Vitoria, I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. The FAQs have two great example on this: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. Hope it helps! All the best, Roemer On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < inieuwenhuis at berkeley.edu> wrote: > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different pro > and cons, so depending on your hypotheses and effects, what's good in one > setup can be bad in the next. So you have to think of what the measures do, > and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or indeed > whole trial) from all samples > detrending removes linear trend (you can also remove higher order trends, > just for completeness) > > For ERPs you generally do want to demean using the baseline window, so the > effect cancels out pre-stim. You don't want to detrend here, since often > the ERP can have late components, and the signal might not be back to > baseline yet. If you detrend in such a case, you will decrease the value > samples late in the trials and increase the values during baseline. You > will tilt the data (end down thus start up). But if you expect a linear > trend due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is noisy (high > amplitude noise) at the end (due to speach artifacts), detrending might be > dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, since > subtracting a constant does not change the frequency info in the signal. I > know people do tend to detrend before freq analysis (so I also tend to do > that), but I have to admit, I don't know why really. Maybe to get rid of > the drift, so it does not end up in the low frequencies. But again, the > effect of detrending (which freqs it affects) depends how long your time > window is, and which frequencies your interested in. If you are interested > in really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit >> unclear to us. Since I trust the knowledge going around here a lot, I >> thought it would be my best chance to get a good answer: When should we >> demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on >> every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do >> complete artefact rejection with ft_rejectartifact. The trials often >> include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, >> and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >> window because I don't want to correct the signal with a specific interval >> (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial >> (always towards the end), using demean here is not a good idea (the signal >> changes induced by moving the jaws, etc., are included in the calculation). >> Is this necessarily the case or can it be fixed with subsequent >> computations (see below)? Do I need to go through artefact rejection again? >> My guess would be that the damage caused by having demean here doesn't >> change that much where the eyeblinks are and I always take quite broad >> windows to mark the artefacts, so at least for the AR I should be safe, but >> I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before >> timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the >> ft_freqanalysis after the 2011 change (removing the first order linear >> trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and >> everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next >> time from the start (assuming that I'll always have EEG speech production >> data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Mon Jan 7 13:42:37 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:42:37 +0100 Subject: [FieldTrip] =?gb2312?b?u9i4tKO6IFJlOiBXaGVuIHRvIGRldHJlbmQvZGVt?= =?gb2312?b?ZWFu?= In-Reply-To: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> References: <50E8E078.1030407@berkeley.edu> <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Message-ID: Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Mon Jan 7 14:14:48 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Mon, 07 Jan 2013 14:14:48 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: Message-ID: <50EACA48.3050509@gmail.com> Thank you Roemer, Ingrid, and Stephen. Let me see if I can summarise it all and do a last check. So for the ERPs, it's better not to detrend, especially if the signal is noisy (high amplitude noise) at the end (due to speach artifacts). I know that using demean with a baseline window is "common sense" but I'm a bit against this in many cases. For example, in my data now, I have a whole semantic context building up towards one final word, which people have to produce overtly. I can expect (intuitively, theoretically, etc.) that anticipation will be going on, inducing changes in the signal. This is relevant cognitive stuff, not noise. Yet, it is in my "baseline period" (i.e., before people get the cue to say something). If I correct against this baseline, I'll not be doing justice to my signal in my opinion. What I did instead was to collect many trials (120 on average). So even without baseline correction, my waves across conditions are lying on top of each other until a certain point before the cue. I take this as an indication that I have a good SNR and if baseline correction is just to ensure that things are the same across conditions pre-stimulus, then it suffices for me if my waves are nicely on top of each other pre-stimulus (but deviating from each other before the onset of the cue). I'd like to hear your opinion on this issue, though, if you think this still is problematic. Indeed, Roemer, I had checked these FAQs before and concluded that my TFRs passed this specific sanity check as well, but thanx for pointing out. The question that still remains is regarding demean in the preprocessing. FT page shows two possibilities. Tutorial: ft_preprocessing default (no detrend/demean). EEG specific: cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; So the baseline correction is in there already at pre-processing. But this seems more specific for a ERP follow-up analysis to me, or isn't it? Having it as in the tutorial would be the most neutral/standard way, right? So maybe I could add a note to the page, if we agree on this. Finally, having a demean using the whole trial instead already at pre-processing does not seem to create effects across conditions in later ERP and TFR analyses (without ICA), I'd conclude from this discussion, but please point out if I'm wrong. Thanx a lot once more, Cheers, Vitoria On 1/7/2013 1:43 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: When to detrend/demean (Roemer van der Meij) > 2. Re: ??? Re: When to detrend/demean (Roemer van der Meij) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 7 Jan 2013 13:28:01 +0100 > From: Roemer van der Meij > To: FieldTrip discussion list > Subject: Re: [FieldTrip] When to detrend/demean > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For frequency > analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been > can bleed into all other frequency bins in a funny but patterned way. For > detrending, the same story applies. When not detrending, the power of the > center frequency of the linear trend (this frequency is very low), can > bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why this > is so is explained shortly in the first FAQ), although in principle the > issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < > inieuwenhuis at berkeley.edu> wrote: > >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in >> (hypothesis) and which methods you're using to analyze the data (ERP or >> frequanalysis, with our without ICA). All analysis steps have different pro >> and cons, so depending on your hypotheses and effects, what's good in one >> setup can be bad in the next. So you have to think of what the measures do, >> and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some >> common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed >> whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, >> just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the >> effect cancels out pre-stim. You don't want to detrend here, since often >> the ERP can have late components, and the signal might not be back to >> baseline yet. If you detrend in such a case, you will decrease the value >> samples late in the trials and increase the values during baseline. You >> will tilt the data (end down thus start up). But if you expect a linear >> trend due to equipment drift over longer time, that can muddle the ERP >> effect, then you might want to detrend. Also when the signal is noisy (high >> amplitude noise) at the end (due to speach artifacts), detrending might be >> dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since >> subtracting a constant does not change the frequency info in the signal. I >> know people do tend to detrend before freq analysis (so I also tend to do >> that), but I have to admit, I don't know why really. Maybe to get rid of >> the drift, so it does not end up in the low frequencies. But again, the >> effect of detrending (which freqs it affects) depends how long your time >> window is, and which frequencies your interested in. If you are interested >> in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vit?ria Magalh?es Piai wrote: >> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that is still a bit >>> unclear to us. Since I trust the knowledge going around here a lot, I >>> thought it would be my best chance to get a good answer: When should we >>> demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech production on >>> every trial. >>> We read in the data, use ft_databrowser to mark the artefacts and then do >>> complete artefact rejection with ft_rejectartifact. The trials often >>> include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is pretty simple, >>> and ft_preprocessing default has no detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >>> window because I don't want to correct the signal with a specific interval >>> (and I assume this will take the whole segment then). >>> Our concern is that, given that people speak during part of the trial >>> (always towards the end), using demean here is not a good idea (the signal >>> changes induced by moving the jaws, etc., are included in the calculation). >>> Is this necessarily the case or can it be fixed with subsequent >>> computations (see below)? Do I need to go through artefact rejection again? >>> My guess would be that the damage caused by having demean here doesn't >>> change that much where the eyeblinks are and I always take quite broad >>> windows to mark the artefacts, so at least for the AR I should be safe, but >>> I'd like to check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend before >>> timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm using the >>> ft_freqanalysis after the 2011 change (removing the first order linear >>> trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity checks and >>> everything is in place (like visual alpha and gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it right next >>> time from the start (assuming that I'll always have EEG speech production >>> data with ERPs and TFRs analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >>> Vitoria >>> >>> >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > From bertram0611 at pku.edu.cn Mon Jan 7 16:14:16 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Mon, 7 Jan 2013 23:14:16 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAJ5Zue5aSN77yaIFJlOiBX?= =?utf-8?q?hen_to_detrend/demean?= In-Reply-To: Message-ID: <503107254.817.1357571656960.JavaMail.root@bj-mail07.pku.edu.cn> Hi,Roemer, Thank you very much.I benefited a lot from your explainations. Lin ----- 原始邮件 ----- 发件人: Roemer van der Meij 收件人: FieldTrip discussion list 已发送邮件: Mon, 07 Jan 2013 20:42:37 +0800 (CST) 主题: Re: [FieldTrip] 回复: Re: When to detrend/demean Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From sherrykhan78 at gmail.com Mon Jan 7 20:23:09 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Mon, 7 Jan 2013 14:23:09 -0500 Subject: [FieldTrip] MEG/EEG Post-doc position at Martinos Center, MGH/ Harvard Medical School Message-ID: POST DOCTORAL Position available at the Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA: Studying the Neuroscience of Autism Using MEG. Responsibilities: The position will involve investigating sensory processing, functional connectivity, and other processing abnormalities in autism, using MEG. Our current projects use state of the art approaches for data analysis, and include analyses of coherence, local cross-frequency coupling, graph theory methods, and other approaches to mining MEG data. There is a range of possible projects to choose from within these categories, and new approaches and ideas are welcomed. The position requires working closely with other members of the Martinos center (in particular Dr. Matti Hamalainen), as well as with other lab members, to develop, explore, improve and apply various data analysis methodologies. Multiple paradigms are routinely used in the lab, each offering opportunities for different approaches and research directions. The position will also involve running the MEG and MRI sessions. Recruitment of subjects is carried out by other members (research coordinators) in the lab. A minimum commitment of two years is required. Salary will be competitive and commensurate with experience. Ideal start date would be summer or fall of 2013. Requirements: PhD (or prior post-doc experience) in MEG/EEG data analysis/methodology or other signal processing. Background in specific aspects of neuroscience or cognitive science is not required, but is a plus. Contact: Tal Kenet, tal at nmr.mgh.harvard.edu The Massachusetts General Hospital is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 20:31:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 11:31:59 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: <50EB22AF.7040509@berkeley.edu> Hi Roemer, Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) Cheers, Ingrid On 1/7/2013 4:28 AM, Roemer van der Meij wrote: > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For > frequency analysis, it's mostly a matter of noise. If you do not > demean, the 0Hz been can bleed into all other frequency bins in a > funny but patterned way. For detrending, the same story applies. When > not detrending, the power of the center frequency of the linear trend > (this frequency is very low), can bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why > this is so is explained shortly in the first FAQ), although in > principle the issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis > > wrote: > > Hi Vitoria, > > The problem with these things is, it depends on what your > interested in (hypothesis) and which methods you're using to > analyze the data (ERP or frequanalysis, with our without ICA). All > analysis steps have different pro and cons, so depending on your > hypotheses and effects, what's good in one setup can be bad in the > next. So you have to think of what the measures do, and how that > effects your data. > > But now for some answers :) I'm just using a lot of experience and > some common sense, maybe people can add in some refs and math if > they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline > window, so the effect cancels out pre-stim. You don't want to > detrend here, since often the ERP can have late components, and > the signal might not be back to baseline yet. If you detrend in > such a case, you will decrease the value samples late in the > trials and increase the values during baseline. You will tilt the > data (end down thus start up). But if you expect a linear trend > due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is > noisy (high amplitude noise) at the end (due to speach artifacts), > detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no > effect, since subtracting a constant does not change the frequency > info in the signal. I know people do tend to detrend before freq > analysis (so I also tend to do that), but I have to admit, I don't > know why really. Maybe to get rid of the drift, so it does not end > up in the low frequencies. But again, the effect of detrending > (which freqs it affects) depends how long your time window is, and > which frequencies your interested in. If you are interested in > really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is > still a bit unclear to us. Since I trust the knowledge going > around here a lot, I thought it would be my best chance to get > a good answer: When should we demean/detrend? > > As relevant background, our EEG datasets involve speech > production on every trial. > We read in the data, use ft_databrowser to mark the artefacts > and then do complete artefact rejection with > ft_rejectartifact. The trials often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty > simple, and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', > the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the > baseline window because I don't want to correct the signal > with a specific interval (and I assume this will take the > whole segment then). > Our concern is that, given that people speak during part of > the trial (always towards the end), using demean here is not a > good idea (the signal changes induced by moving the jaws, > etc., are included in the calculation). Is this necessarily > the case or can it be fixed with subsequent computations (see > below)? Do I need to go through artefact rejection again? My > guess would be that the damage caused by having demean here > doesn't change that much where the eyeblinks are and I always > take quite broad windows to mark the artefacts, so at least > for the AR I should be safe, but I'd like to check that with > you guys. > > Then, when calculating ERPs, I had both demean and detrend > before timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm > using the ft_freqanalysis after the 2011 change (removing the > first order linear trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity > checks and everything is in place (like visual alpha and > gamma, etc.)? > > And my last question, for once and for all, so that I get it > right next time from the start (assuming that I'll always have > EEG speech production data with ERPs and TFRs analysed). Is > this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and > ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best > for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:01:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:01:34 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <7454504B-42D8-4703-835D-C631A046015D@donders.ru.nl> Hi Ingrid, Please feel free to update the text in the FAQs ;-). You understand it perfectly so go ahead. Two tiny remarks from 'spuit elf', as we say in Dutch: - removing a polynomial of order 1 also takes out the constant term, so it also demeans. - actually, there is an error in the text of the FAQ, because FT's default behavior is to remove a zero-order polynomial, so it only demeans. If you want detrending, you should either do this in ft_preprocessing, or specify the appropriate option in ft_freqanalysis. Best wishes, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:07:49 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:07:49 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: Dear Ingrid and others, I forgot to mention, the default has changed one year ago, according to the following thread on the list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html Apologies for not having updated the FAQ. Ingrid, would you mind giving this a shot? Best, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 22:53:19 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 13:53:19 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <50EB43CF.3040705@berkeley.edu> Thanks JM, all clear now. FAQ updated: Done! Cheers, Ingrid On 1/7/2013 12:07 PM, jan-mathijs schoffelen wrote: > Dear Ingrid and others, > > I forgot to mention, the default has changed one year ago, according > to the following thread on the list: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html > > Apologies for not having updated the FAQ. Ingrid, would you mind > giving this a shot? > > Best, > > Jan-Mathijs > > > > On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > >> Hi Roemer, >> >> Thanks for pointing to these questions. I'm a little bit confused >> about the default behavior with cfg.polyremoval as described there. >> So it seems the default of polyremoval for ft_freqanalysis is 1, >> meaning detrending always happens unless you specify otherwise, >> correct? So that means you don't have to call preprocessing with >> cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = >> 'yes' in preprocessing? Or does removing the linear trend (which is >> the default) in ft_freqanalysis automatically also demean the data? >> From the text under the figure in >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it >> almost looks that way. Because it talks about cfg.polyremoval in the >> context of demeaning, not detrending. I don't find that text very >> clear by the way. Also, the title above the figure says "TFR before >> (left) and after (right) subtracting the DC component in the time >> domain", while when I look at the code it seems it should be "TFR of >> channel with large DC component (left) and channel without DC >> component (right) after ft_freqanalysis without demeaning". I'd be >> happy to update the FAQ, but first wanted to check whether I >> understand correctly :) >> >> Cheers, >> Ingrid >> >> >> On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >>> Hi Vitoria, >>> >>> I have only one thing to add to Ingrid's clear explanation. For >>> frequency analysis, it's mostly a matter of noise. If you do not >>> demean, the 0Hz been can bleed into all other frequency bins in a >>> funny but patterned way. For detrending, the same story applies. >>> When not detrending, the power of the center frequency of the linear >>> trend (this frequency is very low), can bleed into other bins. >>> >>> The FAQs have two great example on this: >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >>> >>> Both are specific for when using 'mtmconvol' as frequency method >>> (why this is so is explained shortly in the first FAQ), although in >>> principle the issues could also occur using the other methods. >>> >>> Hope it helps! >>> >>> All the best, >>> Roemer >>> >>> >>> >>> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis >>> > wrote: >>> >>> Hi Vitoria, >>> >>> The problem with these things is, it depends on what your >>> interested in (hypothesis) and which methods you're using to >>> analyze the data (ERP or frequanalysis, with our without ICA). >>> All analysis steps have different pro and cons, so depending on >>> your hypotheses and effects, what's good in one setup can be bad >>> in the next. So you have to think of what the measures do, and >>> how that effects your data. >>> >>> But now for some answers :) I'm just using a lot of experience >>> and some common sense, maybe people can add in some refs and >>> math if they know :) >>> Demeaning just subtracts the mean of the specified time window >>> (or indeed whole trial) from all samples >>> detrending removes linear trend (you can also remove higher >>> order trends, just for completeness) >>> >>> For ERPs you generally do want to demean using the baseline >>> window, so the effect cancels out pre-stim. You don't want to >>> detrend here, since often the ERP can have late components, and >>> the signal might not be back to baseline yet. If you detrend in >>> such a case, you will decrease the value samples late in the >>> trials and increase the values during baseline. You will tilt >>> the data (end down thus start up). But if you expect a linear >>> trend due to equipment drift over longer time, that can muddle >>> the ERP effect, then you might want to detrend. Also when the >>> signal is noisy (high amplitude noise) at the end (due to speach >>> artifacts), detrending might be dangerous. >>> >>> For frequency analysis, demeaning has (as far as I know) no >>> effect, since subtracting a constant does not change the >>> frequency info in the signal. I know people do tend to detrend >>> before freq analysis (so I also tend to do that), but I have to >>> admit, I don't know why really. Maybe to get rid of the drift, >>> so it does not end up in the low frequencies. But again, the >>> effect of detrending (which freqs it affects) depends how long >>> your time window is, and which frequencies your interested in. >>> If you are interested in really low frequencies, detrending >>> might change your effects. >>> >>> Hope this helps somewhat, >>> Ingrid >>> >>> >>> >>> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >>> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that >>> is still a bit unclear to us. Since I trust the knowledge >>> going around here a lot, I thought it would be my best >>> chance to get a good answer: When should we demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech >>> production on every trial. >>> We read in the data, use ft_databrowser to mark the >>> artefacts and then do complete artefact rejection with >>> ft_rejectartifact. The trials often include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is >>> pretty simple, and ft_preprocessing default has no >>> detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', >>> the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the >>> baseline window because I don't want to correct the signal >>> with a specific interval (and I assume this will take the >>> whole segment then). >>> Our concern is that, given that people speak during part of >>> the trial (always towards the end), using demean here is not >>> a good idea (the signal changes induced by moving the jaws, >>> etc., are included in the calculation). Is this necessarily >>> the case or can it be fixed with subsequent computations >>> (see below)? Do I need to go through artefact rejection >>> again? My guess would be that the damage caused by having >>> demean here doesn't change that much where the eyeblinks are >>> and I always take quite broad windows to mark the artefacts, >>> so at least for the AR I should be safe, but I'd like to >>> check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend >>> before timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm >>> using the ft_freqanalysis after the 2011 change (removing >>> the first order linear trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity >>> checks and everything is in place (like visual alpha and >>> gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it >>> right next time from the start (assuming that I'll always >>> have EEG speech production data with ERPs and TFRs >>> analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and >>> ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the >>> best for 2013! >>> Vitoria >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Roemer van der Meij M.Sc. >>> PhD Candidate >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3655932 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Jan 8 03:46:01 2013 From: octavian.lie at gmail.com (octavian lie) Date: Mon, 7 Jan 2013 20:46:01 -0600 Subject: [FieldTrip] Import Cartool & Brainstorm Message-ID: > > Dear All, > > > > I am new to Fieldtrip, Is there a way to import Cartool .eph files and .els channel files? Also, how about importing Brainstorm files (brainstorm typically exports files in .mat format, regardless of the data type (MRI, sensors, recording, source solutions, etc). Thank you, Octavian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Jan 9 01:39:22 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 9 Jan 2013 00:39:22 +0000 Subject: [FieldTrip] FW: Tutorial EEG data processing for ERP analysis In-Reply-To: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DCB3@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I was not sure whether this email reached everyone as the server has been down for a few days. So I am resending it. Could anyone please give me some suggestions on my queries? Thank you very much! Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of IMALI THANUJA HETTIARACHCHI Sent: Monday, 7 January 2013 2:32 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From Christos.Papadelis at childrens.harvard.edu Wed Jan 9 16:17:39 2013 From: Christos.Papadelis at childrens.harvard.edu (Papadelis, Christos) Date: Wed, 9 Jan 2013 15:17:39 +0000 Subject: [FieldTrip] Special Issue in FRONTIERS IN HUMAN NEUROSCIENCE Message-ID: <876E0E5B34DB6A4DBD0E65B9091B435010E0933E@CHEXMBX2A.CHBOSTON.ORG> In collaboration with Frontiers in Neurology, we are currently organizing a Research Topic, "Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development", and as host editors we think that your work could make an excellent contribution. The proposed structure of this Research Topic is provided below. Although MEG studies will be the main focus of the research topic, articles concerning studies that use other state-of-the-art neuroimaging methods for examining the normal and abnormal human brain development are also welcome. Host Specialty: Frontiers in Human Neuroscience (Impact Factor: 2.339) Research Topic Title: Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development Topic Editors: Christos Papadelis, Patricia Ellen Grant, Yoshio Okada, Hubert Preissl Description: Research on the human brain development has seen an upturn in the past years mostly due to novel neuroimaging tools that became available to study the anatomy and function of the developing brain. Magnetic Resonance Imaging (MRI) and Diffusion Tensor Imaging (DTI) are beginning to be used more frequently in children to determine the gross anatomy and structural connectivity of their brain. Functional MRI and Near-Infrared Spectroscopy (NIRS) determine the hemodynamics and electroencephalography (EEG) the electrophysiological functions of the developing human brain. Magnetoencephalography (MEG) complements EEG as the only other technique capable of directly measuring the developing brain electrophysiology. Although MEG is still being used relatively rarely in pediatric studies, the recent development in this technology is beginning to demonstrate its utility in both basic and clinical neurosciences. MEG seems to be quite attractive for pediatric use, since it measures the human brain activity in an entirely passive manner without possessing any conceivable risk to the developing tissue. MEG sessions generally require minimal patient preparation, and the recordings are extremely well tolerated from children. Biomagnetic techniques also offer an indirect way to assess the functional brain and heart activity of fetuses in humans in utero by measuring the magnetic field outside the maternal abdomen. Magnetic field produced by the electrical activity in the heart and brain of the fetus is not attenuated by the vernix, a waxy film covering its entire skin. A biomagnetic instrument specifically designed for fetal studies has been developed for this purpose. Fetal MEG studies using such a system have shown that both spontaneous brain activity and evoked cortical activity can be measured from outside the abdomen of pregnant mothers. Fetal MEG may become clinically very useful for implementation and evaluation of intervention programs in at-risk populations. Biomagnetic instruments have also been developed for specifically measuring the brain activity in newborns, infants and older children. MEG studies have shown the usefulness of MEG for localizing active regions in the brain and also for tracking the longitudinal maturation of various sensory systems. Studies of pediatric patients are beginning to show interesting functional pathology in autism spectrum disorder, cerebral palsy, epilepsy and other types of neurological and psychiatric disorders (Down syndrome, traumatic brain injury, Tourette syndrome, hearing deficits, childhood migraine). We propose to compile the state of the art MEG studies focused on pediatric population in both health and disease. Researchers either engaged with human brain development research, clinical applications of MEG with or without EEG, or methodological developments will be invited to submit original research articles, reviews, case reports, or opinion pieces. Articles concerning studies that use other neuroimaging methods for studying the normal and abnormal human brain development are also welcome. We believe a review of the recent studies of human brain development using MEG is quite timely, since we are witnessing advances not only in the instrumentation optimized for the pediatric population, but also in the research based on various types of MEG systems designed for both human fetuses in utero and neonates and older children. Abstract Submission Deadline: Jun 01, 2013 Article Submission Deadline: Oct 01, 2013 For more information about this topic and Frontiers in Human Neuroscience, please visit: http://www.frontiersin.org/Human_Neuroscience/researchtopics/Magnetoencephalography_an_emer/1351 Should you choose to participate, please confirm by sending us a quick email and then your abstract no later than Jun 01, 2013 using the following link: http://www.frontiersin.org/submissioninfo With best regards, CHRISTOS PAPADELIS Instructor of Neurology, Harvard Medical School, Boston Children's Hospital ELLEN GRANT Associate Professor of Radiology, Harvard Medical School, Boston Children's Hospital Founding Director, Fetal-Neonatal Neuroimaging & Developmental Science Center (FNNDSC) YOSHIO OKADA Clinical Professor of Neurology, Harvard Medical School Director, MEG Program, Boston Children's Hospital HUBERT PREISSL Assistant Professor, MEG-Center, University of Tubingen, Germany Research Associate Professor, Department of Obstetrics and Gynecology, University of Arkansas for Medical Sciences, Little Rock, USA From arno at cerco.ups-tlse.fr Thu Jan 10 08:08:05 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:08:05 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> Message-ID: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Hi Dave and Robert, By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) The issue is that the Windows 32 bit version uses read_eep_trg.dll to read triggers and that the 64 bit version uses read_eep_trg.m (programmed by Robert) now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. Just so you know, Arno On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > >> Thanks, Arno, >> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >> >> EEGLAB error in function loadeep() at line 75 >> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >> >> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >> >> Do you have any suggestions? >> -Dave >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>> Dear Dave, >>> >>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>> >>> Hope this helps. >>> Best wishes, >>> >>> Arno >>> >>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>> >>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>> >>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>> >>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>> >>>> Dave Britton >>>> City College of New York >>>> Psychology Dept. >>>> >>>> Here is the error message I get: >>>> >>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>> Invalid MEX-file >>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>> libeep.so.3: cannot open shared object file: No such file or directory >>>> >>>> Error in ft_read_header (line 627) >>>> hdr = read_eep_cnt(filename, 1, 1); >>>> >>>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 08:33:50 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 09:33:50 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: by the way, did anyone decode the .seg file? it has the beginning time of segments but it is in seconds since 1900 or so. thanks, yuval On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 > bit version of the software when importing events (scaling of time was in > second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to *delete read_eep_trg.dll*, which does not bring > much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. > Previous versions of the libraries and mex files were hard to compile, but > I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared > libraries. This is the best way for having them, because then you don't > have to bother with the shared library path. I guess that this would also > work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out > of the box again, so I will file this as bug (see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all > three common (win/linux/.osx) platforms and in 32 and 64 bit versions will > take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > > Thanks, Arno, > > I've installed the ant-eep import files into the EEGLAB plugin directory, > but EEGLAB gives me the same error message as I got with FieldTrip: > > > EEGLAB error in function loadeep() at line 75 > > Invalid MEX-file > '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': > libeep.so.3:cannot open shared object file:No such file or directory > > > The libeep.so.3 file is copied into the same directory as the > read_eep_cnt.mexa64 file. > > > Do you have any suggestions? > > -Dave > > > > On 12/18/2012 12:38 PM, Arnaud Delorme wrote: > > Dear Dave, > > > last time I have checked FileIO (the Fieldtrip data importer) will not > read ANT trigger files by default (it should read the raw data though - > Robert Oostenveld one of the main developer of Fieldtrip was interning at > ANT about 10 years ago and wrote the Matlab import function for them). > > The anteepimport1.09 is a plugin for the EEGLAB software. It can import > events (and then you can save the data in EEGLAB format and reload it in > Fieldtrip). You cannot recompile the ANT project (their source files are > proprietary and not included). > > > Hope this helps. > > Best wishes, > > > Arno > > > On 18 Dec 2012, at 08:59, Dave Britton wrote: > > > I am trying to process EEG data in .cnt files obtained from the ANT > system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have > installed the Linux 64 bit version of FieldTrip. > > > What is required to successfully process ANT eeg .cnt and .trg files? The > libraries that came with the FieldTrip download did not work as it came > from the download, and my investigations led me to what should be the > latest version of the ANT import library. I have downloaded the latest ANT > eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make > install, successfully, but MATLAB cannot find the shared object file it > should generate, even when I link the .so.3 file into the same directory as > the MATLAB m-file and the MATLAB current directory. > > > Initially the system was unable to read the cnt files, which is why I > attempted to reinstall the anteepimort library. Is there more to this > installation than the standard" configure, make, make install" process? Any > clues would be appreciated! > > > Dave Britton > > City College of New York > > Psychology Dept. > > > Here is the error message I get: > > > cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; > > cfg.hdr = ft_read_header(cfg.headerfile); > > Invalid MEX-file > > > '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': > > libeep.so.3: cannot open shared object file: No such file or directory > > > Error in ft_read_header (line 627) > > hdr = read_eep_cnt(filename, 1, 1); > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Thu Jan 10 08:42:10 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:42:10 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: I think the .seg file should not be used (it is internal to the ASA software). Only the .trg file should be used. If you modify the .trg file though (move events), you need to remove the .seg file or ASA will use the .seg file to set the events in its graphic interface. All based on memory so I could be wrong. Arno On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >>> Thanks, Arno, >>> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >>> >>> EEGLAB error in function loadeep() at line 75 >>> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >>> >>> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >>> >>> Do you have any suggestions? >>> -Dave >>> >>> >>> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>>> Dear Dave, >>>> >>>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>>> >>>> Hope this helps. >>>> Best wishes, >>>> >>>> Arno >>>> >>>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>>> >>>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>>> >>>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>>> >>>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>>> >>>>> Dave Britton >>>>> City College of New York >>>>> Psychology Dept. >>>>> >>>>> Here is the error message I get: >>>>> >>>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>>> Invalid MEX-file >>>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>>> libeep.so.3: cannot open shared object file: No such file or directory >>>>> >>>>> Error in ft_read_header (line 627) >>>>> hdr = read_eep_cnt(filename, 1, 1); >>>>> >>>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 09:40:06 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 10:40:06 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: If you don't use the seg file, how do you know where the data is segmented? it is important when filtering raw data for example, where you have traces which and at certain y value and continue at a very different one the next sample. reading the data with fieldtrip currently doesn't let you know where the data is segmented which can sometime develop into a serious headache. If anyone have overcome this issue before please share with us. On 10 January 2013 09:42, Arnaud Delorme wrote: > I think the .seg file should not be used (it is internal to the ASA > software). > Only the .trg file should be used. > If you modify the .trg file though (move events), you need to remove the > .seg file or ASA will use the .seg file to set the events in its graphic > interface. > All based on memory so I could be wrong. > > Arno > > On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or > so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > >> Hi Dave and Robert, >> >> By the way, after much research, we figured out there was a bug for the >> 32 bit version of the software when importing events (scaling of time was >> in second instead of milliseconds) >> The issue is that the Windows 32 bit version uses >> >> read_eep_trg.dll >> >> to read triggers and that the 64 bit version uses >> >> read_eep_trg.m >> >> (programmed by Robert) >> now I would suggest to *delete read_eep_trg.dll*, which does not bring >> much speed anyway. >> Just so you know, >> >> Arno >> >> On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: >> >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of >> libeep. Previous versions of the libraries and mex files were hard to >> compile, but I have just given it another try and after a few attempts I >> ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared >> libraries. This is the best way for having them, because then you don't >> have to bother with the shared library path. I guess that this would also >> work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out >> of the box again, so I will file this as bug (see >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all >> three common (win/linux/.osx) platforms and in 32 and 64 bit versions will >> take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >> Thanks, Arno, >> >> I've installed the ant-eep import files into the EEGLAB plugin directory, >> but EEGLAB gives me the same error message as I got with FieldTrip: >> >> >> EEGLAB error in function loadeep() at line 75 >> >> Invalid MEX-file >> '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': >> libeep.so.3:cannot open shared object file:No such file or directory >> >> >> The libeep.so.3 file is copied into the same directory as the >> read_eep_cnt.mexa64 file. >> >> >> Do you have any suggestions? >> >> -Dave >> >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >> >> Dear Dave, >> >> >> last time I have checked FileIO (the Fieldtrip data importer) will not >> read ANT trigger files by default (it should read the raw data though - >> Robert Oostenveld one of the main developer of Fieldtrip was interning at >> ANT about 10 years ago and wrote the Matlab import function for them). >> >> The anteepimport1.09 is a plugin for the EEGLAB software. It can import >> events (and then you can save the data in EEGLAB format and reload it in >> Fieldtrip). You cannot recompile the ANT project (their source files are >> proprietary and not included). >> >> >> Hope this helps. >> >> Best wishes, >> >> >> Arno >> >> >> On 18 Dec 2012, at 08:59, Dave Britton wrote: >> >> >> I am trying to process EEG data in .cnt files obtained from the ANT >> system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have >> installed the Linux 64 bit version of FieldTrip. >> >> >> What is required to successfully process ANT eeg .cnt and .trg files? The >> libraries that came with the FieldTrip download did not work as it came >> from the download, and my investigations led me to what should be the >> latest version of the ANT import library. I have downloaded the latest ANT >> eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make >> install, successfully, but MATLAB cannot find the shared object file it >> should generate, even when I link the .so.3 file into the same directory as >> the MATLAB m-file and the MATLAB current directory. >> >> >> Initially the system was unable to read the cnt files, which is why I >> attempted to reinstall the anteepimort library. Is there more to this >> installation than the standard" configure, make, make install" process? Any >> clues would be appreciated! >> >> >> Dave Britton >> >> City College of New York >> >> Psychology Dept. >> >> >> Here is the error message I get: >> >> >> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >> >> cfg.hdr = ft_read_header(cfg.headerfile); >> >> Invalid MEX-file >> >> >> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >> >> libeep.so.3: cannot open shared object file: No such file or directory >> >> >> Error in ft_read_header (line 627) >> >> hdr = read_eep_cnt(filename, 1, 1); >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdnewman at indiana.edu Thu Jan 10 15:23:43 2013 From: sdnewman at indiana.edu (sdnewman at indiana.edu) Date: Thu, 10 Jan 2013 09:23:43 -0500 Subject: [FieldTrip] matlab crashes Message-ID: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Hello fieldtrippers, I am trying again to read in data. I'm using a linux machine with Matlab 2009 installed and I have downloaded fieldtrip-20130107. Whenever I try to do anything matlab crashes and complains that an error was detected while a mex-file was running. I checked the frequently asked questions and I can't find the *.c files suggested to recompile. Please help me. Sharlene From polomacnenad at gmail.com Thu Jan 10 19:56:07 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 10 Jan 2013 19:56:07 +0100 Subject: [FieldTrip] induced activity Message-ID: Hi, I would like to calculate induced time frequency activity for my MEG data. I plan to do it as follows. First I calculate total time-frequency for every single trial. Second, I calculate evoked activity with ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from every trial total activity. And finally I average these differences. I believe this is correct way... My problem is how to subtract evoked.powspctrm(3-D matrix) from total.powspctrm(4-D matrix). Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From sherrykhan78 at gmail.com Thu Jan 10 20:59:02 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Thu, 10 Jan 2013 14:59:02 -0500 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: Dear Nenad please use repmat evoked.powspctrm(3-D matrix) to match dimension of epochs in total.powspctrm(4-D matrix). Some thing like this TF_mean=repmat(evoked.powspctrm,[ 1 1 1 nEpochs]); TF_mean=permute(TF_mean,[4 1 2 3]); TF_induced=total.powspctrm-TF_mean; Induced=(squeeze(mean(abs(TF_induced)))); *This will only work if you have complex TF matrices* Sheraz Martinos Center Induced=(squeeze(mean(abs(TF_induced)))); On Thu, Jan 10, 2013 at 1:56 PM, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG data. > I plan to do it as follows. First I calculate total time-frequency for > every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from > every trial total activity. And finally I average these differences. I > believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Thu Jan 10 21:22:51 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Thu, 10 Jan 2013 23:22:51 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi I have a question on EEG preprocessing. The sampling rate of my 64 channel EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz.My question is, i it advisable to low-pass filter the data first (70 Hz) and then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing effect or should I down-sample first and then band-pass filter the data (0.5-70 Hz) ? Or does the sequence really matter ?I am new to EEG data analysis so this question might be really basic, but any help is highly appreciated! ThanksSubbu -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 10 22:39:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 10 Jan 2013 22:39:45 +0100 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: <50EF3521.20003@uni-leipzig.de> On 10/01/2013 19:56, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG > data. I plan to do it as follows. First I calculate total time-frequency > for every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity > from every trial total activity. And finally I average these > differences. I believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > Hi Nenad, Another common approach is to first compute the ERP/ERF and then subtract it from each trial before performing the time-frequency transformations. This seems to be the more common approach I see in the literature, at least in a lot of EEG gamma band studies. Personally, I've found that doing the subtraction in the frequency domain (i.e. subtracting the power spectrum of the evoked activity from each trial) can give some odd looking results. There tends not to be a whole lot of difference between total and induced (ERP-subtracted) in my experience, so I stick with total rather than worry about subtracting something *into* the data. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From david.m.groppe at gmail.com Fri Jan 11 04:36:44 2013 From: david.m.groppe at gmail.com (David Groppe) Date: Thu, 10 Jan 2013 22:36:44 -0500 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: You need to low-pass filter the data before downsaple to avoid aliasing. The matlab function decimate.m can do this for you. cheers, -David On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: > Hi > > I have a question on EEG preprocessing. The sampling rate of my 64 channel > EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. > My question is, i it advisable to low-pass filter the data first (70 Hz) and > then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing > effect or should I down-sample first and then band-pass filter the data > (0.5-70 Hz) ? Or does the sequence really matter ? > I am new to EEG data analysis so this question might be really basic, but > any help is highly appreciated! > > Thanks > Subbu > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/ From jm.horschig at donders.ru.nl Fri Jan 11 08:37:23 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 11 Jan 2013 08:37:23 +0100 Subject: [FieldTrip] matlab crashes In-Reply-To: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> References: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Message-ID: <50EFC133.2000206@donders.ru.nl> Dear Sharlene, I'd first try to download FieldTrip again to verify that it's not just some corrupt file. Most of the source code is in the src/ subfolder, maybe have a look there again. If the source code is not in FieldTrip, then the mex file must be in some external toolbox that we cannot take care of. In any case, if the error persists after downloading FT again, it might be wise to tell us precisely what kind of data you want to read it (otherwise we don't know what file you are talking about). Best, Jörn On 1/10/2013 3:23 PM, sdnewman at indiana.edu wrote: > Hello fieldtrippers, > > I am trying again to read in data. I'm using a linux machine with > Matlab 2009 installed and I have downloaded fieldtrip-20130107. > Whenever I try to do anything matlab crashes and complains that an > error was detected while a mex-file was running. I checked the > frequently asked questions and I can't find the *.c files suggested to > recompile. Please help me. > > Sharlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Jan 11 09:37:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Jan 2013 09:37:35 +0100 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298@donders.ru.nl> Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > David Groppe, Ph.D. > Postdoctoral Researcher > North Shore LIJ Health System > New Hyde Park, New York > http://www.cogsci.ucsd.edu/~dgroppe/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Fri Jan 11 12:35:32 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Fri, 11 Jan 2013 14:35:32 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi Jan-Mathijs and David Thanks for the reply. I will low-pass filter first and the do the down-sampling.Thanks again! Date: Fri, 11 Jan 2013 09:37:35 +0100 From: jan-mathijs schoffelen To: FieldTrip discussion list Subject: Re: [FieldTrip] EEG preprocessing Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.curado at yahoo.com.br Fri Jan 11 14:00:14 2013 From: marco.curado at yahoo.com.br (Marco Curado) Date: Fri, 11 Jan 2013 05:00:14 -0800 (PST) Subject: [FieldTrip] MNI grid alignment in subjects for group comparison Message-ID: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Dear Fieldtrip experts, I have a question on MNI aligned grids for subjects head prior to source reconstruction. In my experimental design, there are three experimental conditions (A, B and C) I want to compare in one group of subjects at the source level. To be able to compare source activity (by LCMV beamforming) among them, I use the MNI grid warped in every subject's head (to allow comparison at the source level) as stated in the tutorial "Create MNI-aligned grids in individual head-space": http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Up to now, everything is ok. But as I am naive in beamforming, I am a bit confused on the last sentence of this tutorial, where it is stated: "You can use these single subjects' MNI grids in source analysis. After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." My question (indeed very basic) is what is exactly referred as the subject's source? Is it the final source localization after LCMV? I.e., do I need to insert such template_grid parameters in subject's parameter as last step after all source localization? Summing up: The procedure would be to use the .grid from the subject (already warped with MNI grid) for source localization with LCMV and after it I include these parameters from the template-grid? Thanks a lot for your comprehension and attention to my question - I hope I was clear in my issue. My best wishes of an excellent year to everybody, Marco Curado -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Fri Jan 11 14:21:02 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 11 Jan 2013 14:21:02 +0100 Subject: [FieldTrip] induced activity Message-ID: Dear Sheraz and Matt, Thank you for your answers! I think I will use Matt's suggestion. The only thing I would like to know is when you subtract ERF from single trial, do you use baseline corrected ERF or not? All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Fri Jan 11 17:50:32 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Fri, 11 Jan 2013 17:50:32 +0100 Subject: [FieldTrip] MNI grid alignment in subjects for group comparison In-Reply-To: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> References: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Message-ID: Dear Marco, I agree that sentence is not phrased ideally. It is refering to the source data structure, i.e. the output of ft_sourceanalysis. Specifically, copy the template_grid.pos to source.pos and then this updated source data structure can be used in ft_sourcegrandaverage. Likewise,it can be overlaid on the MNI brain. I'm not sure if the other fields are necessary, if they are, maybe someone else can comment. Best, Johanna 2013/1/11 Marco Curado > Dear Fieldtrip experts, > > I have a question on MNI aligned grids for subjects head prior to source > reconstruction. > > In my experimental design, there are three experimental conditions (A, B > and C) I want to compare in one group of subjects at the source level. To > be able to compare source activity (by LCMV beamforming) among them, I use > the MNI grid warped in every subject's head (to allow comparison at the > source level) as stated in the tutorial "Create MNI-aligned grids in > individual head-space": > > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Up to now, everything is ok. But as I am naive in beamforming, I am a bit > confused on the last sentence of this tutorial, where it is stated: > > "You can use these single subjects' MNI grids in source analysis. After > that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the > template_grid onto the subjects's source, which is thereby in MNI > coordinates." > > My question (indeed very basic) is what is exactly referred as the > subject's source? Is it the final source localization after LCMV? I.e., do > I need to insert such template_grid parameters in subject's parameter as > last step after all source localization? > Summing up: The procedure would be to use the .grid from the subject > (already warped with MNI grid) for source localization with LCMV and after > it I include these parameters from the template-grid? > > Thanks a lot for your comprehension and attention to my question - I hope > I was clear in my issue. > My best wishes of an excellent year to everybody, > Marco Curado > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Sat Jan 12 01:22:03 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 11 Jan 2013 18:22:03 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity Message-ID: Dear fieldtrip experts, I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. thanks Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Jan 14 21:14:23 2013 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 14 Jan 2013 20:14:23 +0000 Subject: [FieldTrip] Electrode location structure Message-ID: Dear FieldTrip users, I would like to define the positions of the EEG electrodes myself. I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. I’m trying to use the ft_prepare_layout() function. Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. Many thanks, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Mon Jan 14 21:43:26 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Mon, 14 Jan 2013 22:43:26 +0200 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <50F46DEE.6010802@tut.fi> On 14/01/2013 22:14, Emma Holmes wrote: > > Dear FieldTrip users, > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. > > I'm trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > > Here, I'm referring to the part of the documentation 'cfg.elec: > structure with electrode positions', but can't seem to find any > explanation of what the layout of this structure should be. > > Many thanks, > > Emma > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Hello First create a structure called elec with two fields in int elec.pnt -> N x 3 matrix -> electrode positions elec.label - > 1 x N cell -> electrode label Then you can write the following script cfg = [] cfg.elec = elec; lay = ft_prepare_layout(cfg, data); where data is as provided by ft_preprocessing etc Hope this works. -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Jan 14 21:47:26 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A.) Date: Mon, 14 Jan 2013 21:47:26 +0100 (CET) Subject: [FieldTrip] Electrode location structure In-Reply-To: Message-ID: <1557461731.474785.1358196446162.JavaMail.root@sculptor.zimbra.ru.nl> Dear Emma, FieldTrip is moving towards layouts that are based on an image  (for reference) and that are stored in a .mat file . For some examples, see: http://fieldtrip.fcdonders.nl/template/layout The layout structure stored in those .mat files contains fields that describe the position (.pos), the width (.width), and the height (.height), and the naming (.label) of the electrodes. Furthermore, it contains fields that describe the topographic interpolation boundaries (.mask) and the outlines of the 'head' (.outline). Previous, and still supported, layout files (with a  .lay extension) typically contain a data matrix consisting of 5 columns. The first two columns describe the position of each electrode whereas the third, fourth, and fifth column describe the width, height, and label (i.e. number/name) for each electrode respectively. If you have a bitmap image, I'd recommend to create a layout variable and to store it in a .mat file. Try using  the following commands:   cfg.img = '*.bmp'  lay = ft_prepare_layout(cfg, []) Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Emma Holmes" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 14 januari 2013 21:14:23 > Onderwerp: [FieldTrip] Electrode location structure > Dear FieldTrip users, >   > I would like to define the positions of the EEG electrodes myself. > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. >   > I’m trying to use the ft_prepare_layout() function. > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > Here, I’m referring to the part of the documentation ‘cfg.elec:  > structure with electrode positions’, but can’t seem to find any > explanation of what the layout of this structure should be. >   > Many thanks, > Emma > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 14 22:46:21 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 14 Jan 2013 13:46:21 -0800 Subject: [FieldTrip] normalizing EEG power Message-ID: <50F47CAD.7010803@berkeley.edu> Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From pgoodin at swin.edu.au Tue Jan 15 06:00:28 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Tue, 15 Jan 2013 05:00:28 +0000 Subject: [FieldTrip] Running sensor space stats then source? Message-ID: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Jan 15 09:36:19 2013 From: f.roux at bcbl.eu (Frederic Roux) Date: Tue, 15 Jan 2013 09:36:19 +0100 (CET) Subject: [FieldTrip] normalizing EEG power In-Reply-To: <50F47CAD.7010803@berkeley.edu> Message-ID: <1e9ab1ac-1a4d-4a6d-ab2b-f34a03bee311@thalamus_p> Hi Ingrid, if the shapes of your power spectra look qualitatively similar and are simply shifted up or down, you could normalize the power on a frequency by frequenyc basis by computing z-scores for each individual within their respective gender according to: z(i,f) = (x(i,f) - x_males(f))./sd_males(f); % for males z(i,f) = (x(i,f) - x_females(f))./sd_females(f); % for females with x(i,f) being the individual power spectrum, x_males(f) and x_females(f) being the group mean power spectra for males and females, and sd_males(f) and sd_females(f) being the standard deviations of the power spectra for each group. At least this should help to get rid of gender specific differences and you wouldn't have to normalize your values using total power etc. Best, Fred ----- Original Message ----- From: "Ingrid Nieuwenhuis" To: "FieldTrip discussion list" Sent: Monday, January 14, 2013 10:46:21 PM Subject: [FieldTrip] normalizing EEG power Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Wed Jan 16 09:40:55 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 16 Jan 2013 09:40:55 +0100 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <61157CED-8EDB-48A4-881A-ABD1F414CB53@donders.ru.nl> Hi Emma Narayan and Arjen already pointed you in the appropriate direction. Just to clarify their emails, FieldTrip uses a layout structure for 2-D plotting of data, and the electrode structure for a 3-D representation. The electrode structure can be converted to a 2-D layout, but can also be used for source reconstruction, for which the layout is useless. Please see http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described and pointers to other documentation therein. Also these new pages http://fieldtrip.fcdonders.nl/template/electrode http://fieldtrip.fcdonders.nl/template/layout might help. best Robert On 14 Jan 2013, at 21:14, Emma Holmes wrote: > Dear FieldTrip users, > > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. > > > I’m trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. > > Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. > > > Many thanks, > > Emma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sangita.dandekar at gmail.com Wed Jan 16 22:06:44 2013 From: sangita.dandekar at gmail.com (Sangita Dandekar) Date: Wed, 16 Jan 2013 16:06:44 -0500 Subject: [FieldTrip] defining phase and axial to planar conversion Message-ID: Hi fieldtrippers, I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? My current procedure: 1. Apply megplanar to get the dH and dV components 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately Is there a better way to do this? If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? Thanks in advance for any help! Sangita -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Thu Jan 17 11:11:42 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Thu, 17 Jan 2013 11:11:42 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 05:20:02 2013 From: dave at davebritton.com (Dave Britton) Date: Thu, 17 Jan 2013 23:20:02 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing Message-ID: <50F8CD72.80507@davebritton.com> What is the structure required for the 'data' argument to "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? I am not getting meaningful results from passing the output of [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that appears in the resulting figure is the names of the channels, with no graphs of trial epochs appearing below them as it should be. What ft_preprocessing returns is: data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} fsample: NaN cfg: [1x1 struct] sampleinfo: [132x2 double] where I have 128 electrodes and 132 trials of 238 samples each. When this is passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels of the 128 electrodes, but there is no graph under each label showing the EEG data. What I am passing into ft_preprocessing may be incorrectly structured, I suspect. This is data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} (specifically, why are these all cells instead of arrays? What is the structure of data.time, and of data.trial?) where label is the cell array of strings of electrode names, time is a cell array of the 132 trials' starting times in the .cnt EEG data file, and trial is a cell array containing the 132 cell arrays of the corresponding {128 x 283} EEG samples. Where am I going wrong? What does ft_rejectvisual(data) expect to have as the structure for "data"? -Dave From jan.schoffelen at donders.ru.nl Fri Jan 18 07:55:17 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 07:55:17 +0100 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Hi Jun, If you want to test whether within a subject the PLV across conditions is significantly different (in some statistical sense), you would either do a statistical test along the lines described in "Nonparametric statistical testing of coherence differences, E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 (1), 161-175" or "Comparing spectra and coherences for groups of unequal size, H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of neuroscience methods 159 (2), 337-345". This functionality is not supported in ft_connectivityanalysis. For the former way of statistical testing, you should use ft_freqstatistics, in combination with an adjusted version of statfun_indepsamplesZcoh in order for it to compute differential PLV, rather than Z-transformed coherence difference. Alternatively, you could ask ft_connectivity to compute a jackknife estimate of the variance of the PLV, which could be used in a traditional t-test. Best, Jan-Mathijs On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > Dear fieldtrip experts, > I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Jan 18 09:46:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 18 Jan 2013 09:46:24 +0100 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: <50F8CD72.80507@davebritton.com> References: <50F8CD72.80507@davebritton.com> Message-ID: Dear Dave, You are correct in assuming that label, time, and trial are the three minimally required fields for a FT-style raw data structure. Label is a cell array, because channel names can have varying lengths. Time and trial are cell arrays, because also trials can have variable lengths. Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. For more details, you might want to have a look at http://fieldtrip.fcdonders.nl/faq/how_are_the_various_data_structures_defined . Hope this helps! Best, Eelke On 18 January 2013 05:20, Dave Britton wrote: > What is the structure required for the 'data' argument to > "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? > I am not getting meaningful results from passing the output of > [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that > appears in the resulting figure is the names of the channels, with no graphs > of trial epochs appearing below them as it should be. > > What ft_preprocessing returns is: > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > fsample: NaN > cfg: [1x1 struct] > sampleinfo: [132x2 double] > > where I have 128 electrodes and 132 trials of 238 samples each. When this is > passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels > of the 128 electrodes, but there is no graph under each label showing the > EEG data. > What I am passing into ft_preprocessing may be incorrectly structured, I > suspect. This is > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > > (specifically, why are these all cells instead of arrays? What is the > structure of data.time, and of data.trial?) > > where label is the cell array of strings of electrode names, time is a cell > array of the 132 trials' starting times in the .cnt EEG data file, and trial > is a cell array containing the 132 cell arrays of the corresponding {128 x > 283} EEG samples. > > Where am I going wrong? What does ft_rejectvisual(data) expect to have as > the structure for "data"? > > -Dave > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From caspervanheck at gmail.com Fri Jan 18 15:53:11 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Fri, 18 Jan 2013 15:53:11 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: Dear Fieldtrippers, I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: *Attempted to access dim(3); index out of bounds because numel(dim)=2.* *Error in ==> cornerpoints at 11 * *Error in ==> ft_plot_slice at 157 * So, I tried the surf-option, which gave me this: *Undefined function or variable "val".* *Error in ==> ft_sourceplot at 1174 * And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): *Out of memory* Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB Or, the mildly disconcerting: *Matlab has encountered an internal error and has to close* Which seems to have been caused by a so-called *"Segmentation violation" * Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. Sincerely, Casper van Heck On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:35:05 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:35:05 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <7180B46C-356A-456A-8C3B-66E9F94D9DAE@donders.ru.nl> Hi Casper, Looks like a lowlevel error to me. The function complains about the dim not having the number of elements it expects (should be 3). Thus it looks as if the input to the plotting function (thus the output to ft_sourceinterpolate) is unexpected. Best, Jan-Mathijs On Jan 18, 2013, at 3:53 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:40:37 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:40:37 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: > Dear all, > > I am trying to beam single trials into source space using a DICS filter and the following code. > > cfg=[]; > cfg.method='dics'; > cfg.grid=grid_ind; > cfg.vol=hdm; > cfg.grid.filter=alldics.avg.filter;% common filter > cfg.dics.lambda='5%'; > cfg.channel=channs; > cfg.frequency=13; > cfg.grad=data.grad; > cfg.keeptrials='yes'; > cfg.rawtrial='yes'; > dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) > > I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). > > However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? > > Thanks for any advice! > > Best, > Nadia > > Dr. Nadia Müller > CIMeC - Center for Mind/Brain Sciences > Università degli Studi di Trento > via delle Regole, 101 > Mattarello (TN) - ITALY > e-mail nadia.muller at unitn.it > http://sites.google.com/site/obobcimec > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Fri Jan 18 16:43:25 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 18 Jan 2013 16:43:25 +0100 (CET) Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Hi Casper, I think it is really difficult to figure only from the error message what the problem is. I think it would be also useful to see the inputs (cfg, and your data) of ft_sourceplot. Could you just send me how your cfg and your data-structure looks like? (I mean that you do not need to send the actual data, just the screen output of disp(data) and disp(cfg)). Best, Lilla > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical > reasons, or the people who actually understand what's happening here were > on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result > other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > wrote: > >> Dear Fieldtrippers, >> >> I've been trying to do a source analysis on a dataset with two >> conditions, >> mostly following the tutorials and examples from the Fieldtrip site, and >> come upon a problem; it won't plot. While the source analysis is not an >> essential component of the analysis of this dataset (it's more along the >> lines of "let's see if I can do this"), and I don't expect any result >> other >> than something like "there might be a source in the left hemisphere", >> I'd >> still would like to found out why it's not working. >> >> Essentially, I create a standard headmodel cause I don't have individual >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> to find sources based on individual EEG-datasets using ft_freqanalysis >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> surface. Initially I tried to get the ortho-option to work, but this >> gave >> the following error: >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> *Error in ==> cornerpoints at 11 >> * >> *Error in ==> ft_plot_slice at 157 >> * >> >> So, I tried the surf-option, which gave me this: >> *Undefined function or variable "val".* >> *Error in ==> ft_sourceplot at 1174 >> * >> >> And finally, I tried the slice-option, which gave one of two errors >> (which >> seems to be based on how many slices I requested): >> *Out of memory* >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> topping of at 40GB >> Or, the mildly disconcerting: >> *Matlab has encountered an internal error and has to close* >> Which seems to have been caused by a so-called *"Segmentation violation" >> * >> >> Can anyone offer any insight in these errors? I think I'm doing >> something >> wrong pretty early on, but have no idea what it is. >> >> Sincerely, >> >> Casper van Heck >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Jan 18 16:55:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:55:33 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: References: Message-ID: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 17:05:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 17:05:45 +0100 Subject: [FieldTrip] defining phase and axial to planar conversion In-Reply-To: References: Message-ID: <43CF52FF-6D8B-4888-9A4E-A7E549D3B8E6@donders.ru.nl> Hi Sangita, > I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. Good. > I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? > > My current procedure: > 1. Apply megplanar to get the dH and dV components > 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) > 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately > > Is there a better way to do this? > > If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? I wouldn't do the dH and dV analysis separately, and then combine. One of the reasons is indeed that it would be strange if there is a phase shift between the dV and dH gradients. Another reason is that the actual direction of dH and dV is rather arbitrary. One could consider an oscillatory source to yield a time-varying gradient oriented exactly along the dH-axis, exactly along the dV-axis, but also somewhere in between. In the first case, the source of interest is not visible along the dV-axis (and the phases estimated from the dV are actually rubbish, so introduces a lot of non-specific variance on your feature of interest), in the second case the situation is reversed (dH picks up nothing relevant), and in the in between situation both pick up a bit. What I would do is to do a PCA on each dH-dV combination, and then go for the first PCA-component that will be used for the phase computation. This approach is implemented in ft_combineplanar, but only for frequency domain data. The order of the steps would be: cfg = []; cfg.planarmethod = 'sincos'; dataplanar = ft_megplanar(cfg, data); cfg = []; cfg.method = 'mtmconvol'/'mtmfft' cfg.output = 'fourier'; cfg.taper = 'hanning'; freqplanar = ft_freqanalysis(cfg, dataplanar); cfg = []; cfg.method = 'svd'; % which is equivalent to PCA freqcombined = ft_combineplanar(cfg, freqplanar); freqplanar.fourierspctrm should now contain phase information, estimated at the gradient orientation yielding the maximum power (assuming a fixed orientation over time and trials, but different across frequencies). Alternatively, you can do the analysis in the time domain, but this will require some code of your own. Best wishes, Jan-Mathijs > > Thanks in advance for any help! > Sangita > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Fri Jan 18 17:32:10 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Fri, 18 Jan 2013 17:32:10 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> References: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Message-ID: <61DABECF-9193-429E-8C27-11C8580531BA@unitn.it> Hi Jan-Mathijs, That makes completely sense and you were right I used a vector beamformer. By taking only one orientation (cfg.fixedori='yes') I could solve the problem: Now the values are exactly the same. Could it be that this 'problem' also exists for the example code in the 'Common Filters Beamformer Tutorial' (http://fieldtrip.fcdonders.nl/example/common_filters_in_beamforming)? Should I include the line (cfg.fixedori='yes') also there? Thanks a lot for your very helpful response, Best, Nadia On Jan 18, 2013, at 4:40 PM, jan-mathijs schoffelen wrote: Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Fri Jan 18 18:09:41 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 18 Jan 2013 11:09:41 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Thanks, Jan-Mathijs. This is really helpful, I will check the papers you referred. Jun On Fri, Jan 18, 2013 at 12:55 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Jun, > > If you want to test whether within a subject the PLV across conditions is > significantly different (in some statistical sense), you would either do a > statistical test along the lines described in "Nonparametric statistical > testing of coherence differences > , E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 > (1), 161-175" or "Comparing spectra and coherences for groups of unequal > size > , H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of > neuroscience methods 159 (2), 337-345". > > This functionality is not supported in ft_connectivityanalysis. For the > former way of statistical testing, you should use ft_freqstatistics, in > combination with an adjusted version of statfun_indepsamplesZcoh in order > for it to compute differential PLV, rather than Z-transformed coherence > difference. Alternatively, you could ask ft_connectivity to compute a > jackknife estimate of the variance of the PLV, which could be used in a > traditional t-test. > > Best, > > Jan-Mathijs > > > On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > > Dear fieldtrip experts, > I have a question regarding to test the plv output from > ft_connectivityanalysis. How can I check the significance with a > statistical test based on surrogate data. the plv output didn't have the > magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 21:24:28 2013 From: dave at davebritton.com (Dave Britton) Date: Fri, 18 Jan 2013 15:24:28 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: References: <50F8CD72.80507@davebritton.com> Message-ID: <50F9AF7C.1060302@davebritton.com> On 01/18/2013 03:46 AM, Eelke Spaak wrote: Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. Thanks, this is very helpful. It seems that data.sampleinfo is also important for raw data, and needs to be in the reverse order, i.e. NumSamplesx1. -Dave From naran.kutt at gmail.com Sat Jan 19 07:00:06 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 01:00:06 -0500 Subject: [FieldTrip] source level statistics on one data set. Message-ID: Dear All, I had a question regarding across subject source level statistics using fieldtrip. For 15 subjects I have two conditions conA and conB. For each subject I then 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. sincerely Naran -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Jan 19 08:08:32 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 19 Jan 2013 08:08:32 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: Message-ID: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Hi Naran, It seems you're almost there! What I would do is the following: Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. The final step would be something like this: cfg = []; cfg ... stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; cfg.ivar = 2; cfg.uvar = 1; cfg.statistic = 'depsamplesT'; In this case you will perform a paired T-test between the 2 conditions. Best, Jan-Mathijs On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > Dear All, > > I had a question regarding across subject source level statistics using fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From naran.kutt at gmail.com Sat Jan 19 10:17:51 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 04:17:51 -0500 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: Hi Jan, Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest 1. would the bias be still there, or will it be taken care of? 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects Thank you again! best, Naran On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 > conditions separate. Then, srcA and srcB (for all subjects) are ready to > enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. > Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = > 'no', you'll only get an average across subjects, so that's not useful for > doing statistics to begin with. Alternatively, you could call > ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a > redundant step. Moreover, it is a bit silly, because in that case no > 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on > source level data, but you may get some inspiration from the tutorials that > deal with sensor-level data. Instead of using ft_timelockanalysis you > should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, > srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and > likewise for B. It now boils down to informing ft_sourcestatistics with the > appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > > Dear All, > > I had a question regarding across subject source level statistics using > fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I > then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. > (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate > and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage > with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are > significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another > program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sun Jan 20 03:23:51 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 20 Jan 2013 02:23:51 +0000 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: , <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thank you very much for the thoughts on the issue. I do hope to hear what others have to say also. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: Saturday, 19 January 2013 2:55 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Running sensor space stats then source? Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun Jan 20 09:15:36 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sun, 20 Jan 2013 09:15:36 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: <47B5264C-3D58-4AA1-8C21-0A0CC0C06C07@donders.ru.nl> Hi Naran, Usually the statistical contrast takes care of the depth bias. Alternatively, you could test the difference of the log10 of the power (i.e. take the log10 of srcX.avg.pow); this is equivalent to testing the log10 of the ratio. Indeed you can correct for multiple comparisons using the cluster-based test statistic. Best, Jan-Mathijs On Jan 19, 2013, at 10:17 AM, Narayanan Kutty wrote: > Hi Jan, > > Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest > > 1. would the bias be still there, or will it be taken care of? > > 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here > http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects > > Thank you again! > > best, > Naran > > On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > >> Dear All, >> >> I had a question regarding across subject source level statistics using fieldtrip. >> >> For 15 subjects I have two conditions conA and conB. For each subject I then >> >> 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) >> >> 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) >> >> 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) >> >> After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. >> >> What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). >> >> How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. >> >> sincerely >> Naran >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Mon Jan 21 12:18:58 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Mon, 21 Jan 2013 12:18:58 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: Everyone, While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: First I create a pre-post contrast as shown in the beamformer tutorial. Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); * *mri = ft_volumereslice([], mri);* Then: *[data] = ft_sourceinterpolate(cfg, data, mri); * where cfg contains: *cfg.parameter: 'avg.pow'* *cfg.downsample: 4* and I add the anatomy: *data.anatomy = mri.anatomy; clear mri* And finally, I call ft_sourceplot using these options: cfg.*parameter: 'avg.pow'* *cfg.downsample: 4* with one of these three methods: 1) *cfg.method = 'surface';* * cfg.surffile = 'surface_l4_both.mat';* * cfg.surfdownsample = 4;* * cfg.projmethod = 'nearest';* 2) *cfg.method = 'ortho';* 3) *cfg.method = 'slice';* * cfg.nslices = 20;* Which leads to the errors shown earlier. At this point, disp(data) yields: *K>> disp(data)* * avg: [1x1 struct]* * pos: [16777216x3 double]* * dim: [256 256 256]* * inside: [1x16777216 double]* * outside: [1x0 double]* * coordsys: 'ctf'* * unit: 'mm'* * cfg: [1x1 struct]* * anatomy: [256x256x256 double]* * * I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model * * * *% segment the template brain and construct a volume conduction model (i.e. head model)* *cfg = [];* *cfg.output = {'brain' 'scalp' 'skull'};* *cfg.downsample = 2;* *t_seg = ft_volumesegment(cfg, mri);* * * *% create head model* *cfg = [];* *cfg.method = 'singlesphere';* *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* *cfg.elec = ft_read_sens('standard_1020.elc');* *t_vol = ft_prepare_headmodel(cfg, t_seg);* *clear template_seg* * * *% construct the dipole grid in the template brain coordinates* *cfg = [];* *cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION* *cfg.vol = t_vol;* *t_grid = ft_prepare_sourcemodel(cfg);* * * After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* * * Anyone seeing anything obviously stupid? Sincerely, Casper On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two > conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors > (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Jan 22 09:49:16 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Jan 2013 09:49:16 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Hi intersect(everyone, casper) > Everyone, > > While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > mri = ft_volumereslice([], mri); > > Then: > [data] = ft_sourceinterpolate(cfg, data, mri); > where cfg contains: > cfg.parameter: 'avg.pow' > cfg.downsample: 4 > > and I add the anatomy: > data.anatomy = mri.anatomy; clear mri Putting mri.anatomy into data.anatomy is probably not what you want to do: the whole point about ft_sourceinterpolate is to get the functional and anatomical data in the same 'pixel-space'; this is the only way that ft_sourceplot (as of yet) can deal with it. The reason is that now the functional data is sampled once every 4 voxels, relative to the anatomy. I guess that this causes your problem in ft_sourceplot. Best wishes, Jan-Mathijs > And finally, I call ft_sourceplot using these options: > cfg.parameter: 'avg.pow'; > cfg.downsample: 4 > with one of these three methods: > 1) cfg.method = 'surface'; > cfg.surffile = 'surface_l4_both.mat'; > cfg.surfdownsample = 4; > cfg.projmethod = 'nearest'; > 2) cfg.method = 'ortho'; > 3) cfg.method = 'slice'; > cfg.nslices = 20; > Which leads to the errors shown earlier. At this point, disp(data) yields: > K>> disp(data) > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > anatomy: [256x256x256 double] > > I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model > > % segment the template brain and construct a volume conduction model (i.e. head model) > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > cfg.downsample = 2; > t_seg = ft_volumesegment(cfg, mri); > > % create head model > cfg = []; > cfg.method = 'singlesphere'; > cfg.hdmfile = strcat(h.subject,'Subject01.hdm'); > cfg.elec = ft_read_sens('standard_1020.elc'); > t_vol = ft_prepare_headmodel(cfg, t_seg); > clear template_seg > > % construct the dipole grid in the template brain coordinates > cfg = []; > cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION > cfg.vol = t_vol; > t_grid = ft_prepare_sourcemodel(cfg); > > After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): > source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid); > > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Jan 23 09:26:36 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 23 Jan 2013 09:26:36 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Peter, I think your question was aimed at asking: is it, by running the same stats on transformed data, double-dipping to use the same time window, for example? I don't think so in this case of sensor versus source because, as Jan-Mathijs already mentioned, it's not just a transform of each sensor to a given source location, but rather a linear mixture, and this linear mixture may pull out different effects, even when using cluster stats at the sensor level. I also don't think that it is double dipping if you first find the optimal time window in sensor data, and then simply want to ask: where is the most likely location of the underlying neural source? Then you are asking a spatial/where question, not a presence/if question. Although, see previous paragraph as to why you may find a different set of significant findings in source versus sensor space. Cheers, Johanna 2013/1/18 jan-mathijs schoffelen > Hi Peter, > > I don't have a definite answer to your question, but note that analysing > the data at the level of the sources is something a bit more involved than > just taking the log-transform... > > Here are some pseudo-random thoughts: > > Essentially, sensor level signals present themselves as a linear mixture > of the underlying sources of interest, and the source modelling attempts to > unmix the sensor signals using biophysical (and additional) constraints. > In general, source level analysis will allow for a 'cleaner' > interpretation of the possible location of the sources, where one should > always account for the fact that the spatial resolution of EEG/MEG source > reconstruction is not typically very high. In addition, the more relevant > reason to try to unmix the sensor-level data, is to get a cleaner account > of the temporal structure in and between the underlying neural generators, > allowing for less problematic interpretation of univariate and > bi/multivariate (connectivity) quantities estimated from the data. As a > result of the source reconstruction, it could be that results are uncovered > which are not easily visible from the sensor data alone. > > It is perfectly valid to constrain yourself to sensor-level analysis, if > this allows you to make your scientific point. Also, once you manage to > reject your null-hypothesis (allowing you to speculate about the > alternative hypothesis in your discussion section of your paper), there is > no need to go to the source level. > > I guess that to some extent it is also a matter of taste, familiarity with > the methods, and opportunity which drives researchers to choose for one or > the other approach. > > These are just my thoughts and ideas, and it could be that other people on > this forum have more sensible things to say about it. > > Best, > > Jan-Mathijs > > > > > > On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit > of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using > the cluster based tests in fieldtrip to examine for significant differences > between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be > using the same time window, just in a different (more assumption filled) > space. In my head it's like running a t-test on "raw" data then doing it > again transformed (eg, log transform) numbers, removing any assumption of > independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those > that use both don't make any discussion regarding it. Can anyone point me > in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Wed Jan 23 10:55:54 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Wed, 23 Jan 2013 10:55:54 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Since ft_sourceplot complained about not having anatomy (or functional) parameter, and it seems to default to a field named '*data.anatomy'*, I assumed adding *mri.anatomy* in *data.anatomy* would suffice. But, without this, ft_sourceplot would again require an anatomy parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' in the cfg I feed to ft_sourceplot, where 'mri' is the result from ft_volumereslice. However, ft_sourceplot then says "*do not understand cfg.anaparameter*", and thus it is not plotting "*anatomy*". After looking back to the plotting tutorial where I read "The anatomy can be read with ft_read_mri", I'm not quite sure what's going wrong. Sincerely, Casper On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi intersect(everyone, casper) > > Everyone, > > While the whole script is way too convoluted to put up here, but luckily > the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed > through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using > cfg.outputfile), where the data is fed as a cell array (which seems to work > properly), I go over to a source-comparison script. This script works as > follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and > reslice this data: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > * > *mri = ft_volumereslice([], mri);* > > Then: > *[data] = ft_sourceinterpolate(cfg, data, mri); > * > where cfg contains: > *cfg.parameter: 'avg.pow'* > *cfg.downsample: 4* > > and I add the anatomy: > *data.anatomy = mri.anatomy; clear mri* > > > Putting mri.anatomy into data.anatomy is probably not what you want to do: > the whole point about ft_sourceinterpolate is to get the functional and > anatomical data in the same 'pixel-space'; this is the only way that > ft_sourceplot (as of yet) can deal with it. The reason is that now the > functional data is sampled once every 4 voxels, relative to the anatomy. I > guess that this causes your problem in ft_sourceplot. > > > > Best wishes, > > Jan-Mathijs > > > > And finally, I call ft_sourceplot using these options: > > cfg.*parameter: 'avg.pow';* > > *cfg.downsample: 4* > > * > * > > with one of these three methods: > 1) *cfg.method = 'surface';* > * cfg.surffile = 'surface_l4_both.mat';* > * cfg.surfdownsample = 4;* > * cfg.projmethod = 'nearest';* > 2) *cfg.method = 'ortho';* > 3) *cfg.method = 'slice';* > * cfg.nslices = 20;* > Which leads to the errors shown earlier. At this point, disp(data) yields: > *K>> disp(data)* > * avg: [1x1 struct]* > * pos: [16777216x3 double]* > * dim: [256 256 256]* > * inside: [1x16777216 double]* > * outside: [1x0 double]* > * coordsys: 'ctf'* > * unit: 'mm'* > * cfg: [1x1 struct]* > * anatomy: [256x256x256 double]* > * > * > I'm guessing it has something to do with the 'inside' and 'outside' > elements, so my 'standard head model'. I think I made this using the > following code: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' > anatomical model > * > * > * > *% segment the template brain and construct a volume conduction model > (i.e. head model)* > *cfg = [];* > *cfg.output = {'brain' 'scalp' 'skull'};* > *cfg.downsample = 2;* > *t_seg = ft_volumesegment(cfg, mri);* > * * > *% create head model* > *cfg = [];* > *cfg.method = 'singlesphere';* > *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* > *cfg.elec = ft_read_sens('standard_1020.elc');* > *t_vol = ft_prepare_headmodel(cfg, t_seg);* > *clear template_seg* > * > * > *% construct the dipole grid in the template brain coordinates* > *cfg = [];* > *cfg.normalize = 'no'; % no normalization, since we're comparing two > conditions THAT'S RIGHT I DID PAY ATTENTION* > *cfg.vol = t_vol;* > *t_grid = ft_prepare_sourcemodel(cfg);* > * > * > After which I use this on all subjects, using this (note that I store all > data in a single massive structure, to make saving to disk and selecting > data etc. easier): > *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* > * > * > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > >> Hi Casper, >> >> I think it is really difficult to figure only from the error message what >> the problem is. I think it would be also useful to see the inputs (cfg, >> and your data) of ft_sourceplot. Could you just send me how your cfg and >> your data-structure looks like? (I mean that you do not need to send the >> actual data, just the screen output of disp(data) and disp(cfg)). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrippers, >> > >> > I've asked this question earlier, but either it got lost due to >> technical >> > reasons, or the people who actually understand what's happening here >> were >> > on vacation, so here it is again: >> > >> > I've been trying to do a source analysis on a dataset with two >> conditions, >> > mostly following the tutorials and examples from the Fieldtrip site, and >> > come upon a problem; it won't plot. While the source analysis is not an >> > essential component of the analysis of this dataset (it's more along the >> > lines of "let's see if I can do this"), and I don't expect any result >> > other >> > than something like "there might be a source in the left hemisphere", >> I'd >> > still would like to found out why it's not working. >> > >> > Essentially, I create a standard headmodel cause I don't have individual >> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> > to find sources based on individual EEG-datasets using ft_freqanalysis >> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> > After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> > >> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> > surface. Initially I tried to get the ortho-option to work, but this >> gave >> > the following error: >> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> > *Error in ==> cornerpoints at 11 >> > * >> > *Error in ==> ft_plot_slice at 157 >> > * >> > >> > So, I tried the surf-option, which gave me this: >> > *Undefined function or variable "val".* >> > *Error in ==> ft_sourceplot at 1174 >> > * >> > >> > And finally, I tried the slice-option, which gave one of two errors >> (which >> > seems to be based on how many slices I requested): >> > *Out of memory* >> > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> > topping of at 40GB >> > Or, the mildly disconcerting: >> > *Matlab has encountered an internal error and has to close* >> > Which seems to have been caused by a so-called *"Segmentation violation" >> > * >> > >> > Can anyone offer any insight in these errors? I think I'm doing >> something >> > wrong pretty early on, but have no idea what it is. >> > >> > Sincerely, >> > >> > Casper van Heck >> > >> > >> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >> > wrote: >> > >> >> Dear Fieldtrippers, >> >> >> >> I've been trying to do a source analysis on a dataset with two >> >> conditions, >> >> mostly following the tutorials and examples from the Fieldtrip site, >> and >> >> come upon a problem; it won't plot. While the source analysis is not an >> >> essential component of the analysis of this dataset (it's more along >> the >> >> lines of "let's see if I can do this"), and I don't expect any result >> >> other >> >> than something like "there might be a source in the left hemisphere", >> >> I'd >> >> still would like to found out why it's not working. >> >> >> >> Essentially, I create a standard headmodel cause I don't have >> individual >> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> >> Fieldtrip >> >> to find sources based on individual EEG-datasets using ft_freqanalysis >> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> >> average >> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> >> surface. Initially I tried to get the ortho-option to work, but this >> >> gave >> >> the following error: >> >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> >> *Error in ==> cornerpoints at 11 >> >> * >> >> *Error in ==> ft_plot_slice at 157 >> >> * >> >> >> >> So, I tried the surf-option, which gave me this: >> >> *Undefined function or variable "val".* >> >> *Error in ==> ft_sourceplot at 1174 >> >> * >> >> >> >> And finally, I tried the slice-option, which gave one of two errors >> >> (which >> >> seems to be based on how many slices I requested): >> >> *Out of memory* >> >> Which is pretty damn impressive since I've got 8GB of RAM and a >> pagefile >> >> topping of at 40GB >> >> Or, the mildly disconcerting: >> >> *Matlab has encountered an internal error and has to close* >> >> Which seems to have been caused by a so-called *"Segmentation >> violation" >> >> * >> >> >> >> Can anyone offer any insight in these errors? I think I'm doing >> >> something >> >> wrong pretty early on, but have no idea what it is. >> >> >> >> Sincerely, >> >> >> >> Casper van Heck >> >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Wed Jan 23 12:19:37 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Wed, 23 Jan 2013 12:19:37 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Hi Casper, The cfg.anaparameter should then be 'anatomy'. It refers to the field (in data) in which the anatomy can be found, in your case: data.anatomy. Hope this helps, Hanneke Op 23 jan. 2013 10:57 schreef "Casper van Heck" het volgende: > Dear Jan-Mathijs, > > Since ft_sourceplot complained about not having anatomy (or functional) > parameter, and it seems to default to a field named '*data.anatomy'*, I > assumed adding *mri.anatomy* in *data.anatomy* would suffice. > > But, without this, ft_sourceplot would again require an anatomy parameter, > so that would mean that I need to ut '*cfg.anaparameter = mri*' in the > cfg I feed to ft_sourceplot, where 'mri' is the result from > ft_volumereslice. > However, ft_sourceplot then says "*do not understand cfg.anaparameter*", > and thus it is not plotting "*anatomy*". After looking back to the > plotting tutorial where I read "The anatomy can be read with ft_read_mri", > I'm not quite sure what's going wrong. > > Sincerely, > > Casper > > > > On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi intersect(everyone, casper) >> >> Everyone, >> >> While the whole script is way too convoluted to put up here, but luckily >> the relevant steps are quite simple >> Input is simply raw data, read with ft_preprocessing, which is passed >> through functions as shown in my previous email. >> >> After passing the data to ft_sourcegrandaverage (only using >> cfg.outputfile), where the data is fed as a cell array (which seems to work >> properly), I go over to a source-comparison script. This script works as >> follows: >> First I create a pre-post contrast as shown in the beamformer tutorial. >> >> Next, I read some MRI-data using ft_read_mri from a standard folder, and >> reslice this data: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >> * >> *mri = ft_volumereslice([], mri);* >> >> Then: >> *[data] = ft_sourceinterpolate(cfg, data, mri); >> * >> where cfg contains: >> *cfg.parameter: 'avg.pow'* >> *cfg.downsample: 4* >> >> and I add the anatomy: >> *data.anatomy = mri.anatomy; clear mri* >> >> >> Putting mri.anatomy into data.anatomy is probably not what you want to >> do: the whole point about ft_sourceinterpolate is to get the functional and >> anatomical data in the same 'pixel-space'; this is the only way that >> ft_sourceplot (as of yet) can deal with it. The reason is that now the >> functional data is sampled once every 4 voxels, relative to the anatomy. I >> guess that this causes your problem in ft_sourceplot. >> >> >> >> Best wishes, >> >> Jan-Mathijs >> >> >> >> And finally, I call ft_sourceplot using these options: >> >> cfg.*parameter: 'avg.pow';* >> >> *cfg.downsample: 4* >> >> * >> * >> >> with one of these three methods: >> 1) *cfg.method = 'surface';* >> * cfg.surffile = 'surface_l4_both.mat';* >> * cfg.surfdownsample = 4;* >> * cfg.projmethod = 'nearest';* >> 2) *cfg.method = 'ortho';* >> 3) *cfg.method = 'slice';* >> * cfg.nslices = 20;* >> Which leads to the errors shown earlier. At this point, disp(data) yields: >> *K>> disp(data)* >> * avg: [1x1 struct]* >> * pos: [16777216x3 double]* >> * dim: [256 256 256]* >> * inside: [1x16777216 double]* >> * outside: [1x0 double]* >> * coordsys: 'ctf'* >> * unit: 'mm'* >> * cfg: [1x1 struct]* >> * anatomy: [256x256x256 double]* >> * >> * >> I'm guessing it has something to do with the 'inside' and 'outside' >> elements, so my 'standard head model'. I think I made this using the >> following code: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' >> anatomical model >> * >> * >> * >> *% segment the template brain and construct a volume conduction model >> (i.e. head model)* >> *cfg = [];* >> *cfg.output = {'brain' 'scalp' 'skull'};* >> *cfg.downsample = 2;* >> *t_seg = ft_volumesegment(cfg, mri);* >> * * >> *% create head model* >> *cfg = [];* >> *cfg.method = 'singlesphere';* >> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >> *cfg.elec = ft_read_sens('standard_1020.elc');* >> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >> *clear template_seg* >> * >> * >> *% construct the dipole grid in the template brain coordinates* >> *cfg = [];* >> *cfg.normalize = 'no'; % no normalization, since we're comparing two >> conditions THAT'S RIGHT I DID PAY ATTENTION* >> *cfg.vol = t_vol;* >> *t_grid = ft_prepare_sourcemodel(cfg);* >> * >> * >> After which I use this on all subjects, using this (note that I store all >> data in a single massive structure, to make saving to disk and selecting >> data etc. easier): >> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >> * >> * >> Anyone seeing anything obviously stupid? >> >> Sincerely, >> >> Casper >> >> >> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >> >>> Hi Casper, >>> >>> I think it is really difficult to figure only from the error message what >>> the problem is. I think it would be also useful to see the inputs (cfg, >>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>> your data-structure looks like? (I mean that you do not need to send the >>> actual data, just the screen output of disp(data) and disp(cfg)). >>> >>> Best, >>> Lilla >>> >>> >>> > Dear Fieldtrippers, >>> > >>> > I've asked this question earlier, but either it got lost due to >>> technical >>> > reasons, or the people who actually understand what's happening here >>> were >>> > on vacation, so here it is again: >>> > >>> > I've been trying to do a source analysis on a dataset with two >>> conditions, >>> > mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> > come upon a problem; it won't plot. While the source analysis is not an >>> > essential component of the analysis of this dataset (it's more along >>> the >>> > lines of "let's see if I can do this"), and I don't expect any result >>> > other >>> > than something like "there might be a source in the left hemisphere", >>> I'd >>> > still would like to found out why it's not working. >>> > >>> > Essentially, I create a standard headmodel cause I don't have >>> individual >>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> Fieldtrip >>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>> average >>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> > >>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> > surface. Initially I tried to get the ortho-option to work, but this >>> gave >>> > the following error: >>> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >>> > *Error in ==> cornerpoints at 11 >>> > * >>> > *Error in ==> ft_plot_slice at 157 >>> > * >>> > >>> > So, I tried the surf-option, which gave me this: >>> > *Undefined function or variable "val".* >>> > *Error in ==> ft_sourceplot at 1174 >>> > * >>> > >>> > And finally, I tried the slice-option, which gave one of two errors >>> (which >>> > seems to be based on how many slices I requested): >>> > *Out of memory* >>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> > topping of at 40GB >>> > Or, the mildly disconcerting: >>> > *Matlab has encountered an internal error and has to close* >>> > Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> > * >>> > >>> > Can anyone offer any insight in these errors? I think I'm doing >>> something >>> > wrong pretty early on, but have no idea what it is. >>> > >>> > Sincerely, >>> > >>> > Casper van Heck >>> > >>> > >>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>> > wrote: >>> > >>> >> Dear Fieldtrippers, >>> >> >>> >> I've been trying to do a source analysis on a dataset with two >>> >> conditions, >>> >> mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> >> come upon a problem; it won't plot. While the source analysis is not >>> an >>> >> essential component of the analysis of this dataset (it's more along >>> the >>> >> lines of "let's see if I can do this"), and I don't expect any result >>> >> other >>> >> than something like "there might be a source in the left hemisphere", >>> >> I'd >>> >> still would like to found out why it's not working. >>> >> >>> >> Essentially, I create a standard headmodel cause I don't have >>> individual >>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> >> Fieldtrip >>> >> to find sources based on individual EEG-datasets using ft_freqanalysis >>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>> >> average >>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> >> >>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> >> surface. Initially I tried to get the ortho-option to work, but this >>> >> gave >>> >> the following error: >>> >> *Attempted to access dim(3); index out of bounds because >>> numel(dim)=2.* >>> >> *Error in ==> cornerpoints at 11 >>> >> * >>> >> *Error in ==> ft_plot_slice at 157 >>> >> * >>> >> >>> >> So, I tried the surf-option, which gave me this: >>> >> *Undefined function or variable "val".* >>> >> *Error in ==> ft_sourceplot at 1174 >>> >> * >>> >> >>> >> And finally, I tried the slice-option, which gave one of two errors >>> >> (which >>> >> seems to be based on how many slices I requested): >>> >> *Out of memory* >>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> >> topping of at 40GB >>> >> Or, the mildly disconcerting: >>> >> *Matlab has encountered an internal error and has to close* >>> >> Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> >> * >>> >> >>> >> Can anyone offer any insight in these errors? I think I'm doing >>> >> something >>> >> wrong pretty early on, but have no idea what it is. >>> >> >>> >> Sincerely, >>> >> >>> >> Casper van Heck >>> >> >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Jan 23 18:21:17 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 23 Jan 2013 12:21:17 -0500 Subject: [FieldTrip] CTF MEG data anonymization Message-ID: Hello, Does anybody know *how to anonymize CTF MEG scans* (all patient's info must be removed from the file)? I have tools for the DICOM format but not for CTF formats. Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Wed Jan 23 19:01:22 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Wed, 23 Jan 2013 13:01:22 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: Message-ID: <51002572.9090908@kurage.nimh.nih.gov> Use the CTF tool newDs with the -anon option. McGowin, Inna wrote: > Hello, > > Does anybody know *how to anonymize CTF MEG scans* (all patient's info > must be removed from the file)? > I have tools for the DICOM format but not for CTF formats. > > Thanks! > -- > Inna > > > ------------------------------------------------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- The white knight is talking backwards. From a.stolk8 at gmail.com Wed Jan 23 19:08:19 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 23 Jan 2013 19:08:19 +0100 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: <51002572.9090908@kurage.nimh.nih.gov> References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Hi Inna, Have a look here http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset Yours, Arjen 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > Use the CTF tool newDs with the -anon option. > > McGowin, Inna wrote: > >> Hello, >> >> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >> must be removed from the file)? >> >> I have tools for the DICOM format but not for CTF formats. >> >> Thanks! >> -- >> Inna >> >> >> ------------------------------**------------------------------** >> ------------ >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > The white knight is talking backwards. > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 02:59:58 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 01:59:58 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment Message-ID: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Thu Jan 24 07:38:15 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Thu, 24 Jan 2013 07:38:15 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From pgoodin at swin.edu.au Thu Jan 24 10:11:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 09:11:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From julian.keil at gmail.com Thu Jan 24 11:13:11 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 24 Jan 2013 11:13:11 +0100 Subject: [FieldTrip] =?iso-8859-1?q?PhD=2E_Position_at_the_Department_of_P?= =?iso-8859-1?q?sychiatry_and_Psychotherapy=2C_Charit=E9?= Message-ID: <78950AEB-FEFC-4E59-A4E0-9A969D9AA224@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A Starting Grant of the European Research Council (ERC) will fund the currently open position (initially 24 months). The main objective of this ERC research program is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes. The studies within this program include EEG and other neuroimaging methods. Studies will be conducted in healthy subjects and patients with schizophrenia. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as some German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until February 03, 2013, electronically to: daniel.senkowski at charite.de Regards, Daniel Senkowski --------------------------------------------------------------- Daniel Senkowski, Ph.D. Professor of Clinical Neuropsychology Department of Psychiatry and Psychotherapy Charité, University Medicine Berlin St. Hedwig Hospital, Große Hamburger Str. 5-11 10115 Berlin, Germany www.danielsenkowski.com http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianpaolo.demarchi at unitn.it Thu Jan 24 11:13:49 2013 From: gianpaolo.demarchi at unitn.it (Demarchi, Gianpaolo) Date: Thu, 24 Jan 2013 11:13:49 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 13:05:48 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 12:05:48 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , Message-ID: Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrysa.lithari at gmail.com Thu Jan 24 16:33:56 2013 From: chrysa.lithari at gmail.com (Chrysa Lithari) Date: Thu, 24 Jan 2013 16:33:56 +0100 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Message-ID: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:42:43 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:42:43 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:44:17 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:44:17 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CF@nki-mail.NKI.rfmh.org> I forgot to mention - this doesn't change it to fieldtrip format, just to matlab format. But once it's in matlab, it shouldn't be too hard to convert it to a fieldtrip structure. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Epstein, Michael Sent: Thursday, January 24, 2013 10:43 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] read tfcs from BESA in Fieldtrip My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From ninja78278 at aol.com Thu Jan 24 17:11:33 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Thu, 24 Jan 2013 11:11:33 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter Message-ID: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Dear Fieldtrip-Users, I am trying to do lcmv beamform sourceanalysis with a common filter for all conditions (same session, different trials defined with ft_preprocessing belong to different conditions,sequence of conditions randomly intermixed for each block). However if I use the common filter calculated from one block (consisting of 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each condition separately without common filters it is working). Here is how I proceed: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK cfg = []; cfg.channel='MEG'; cfg.keeptrials='yes'; cfg.blc='yes'; cfg.blcwindow = [-0.2 0] data = ft_timelockanalysis(cfg,data); cfg = []; cfg.channel = 'MEG' cfg.covariance ='yes'; cfg.covariancewindow = [0 0.2]; cfg.removemean = 'no'; cfg.keeptrials = 'yes'; timelock_post = ft_timelockanalysis(cfg,data); cfg.covariancewindow = [-0.2 0]; timelock_pre = ft_timelockanalysis(cfg,data); %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.vol = vol.vol; cfg.grad = grad.grad; cfg.keeptrials='yes'; cfg.lcmv.lamda = '5%'; cfg.lcmv.keepfilter = 'yes'; source_post = ft_sourceanalysis(cfg,timelock_post); source_pre = ft_sourceanalysis(cfg,timelock_pre); source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS cfg = []; cfg.trials=cond1; %this picks out the trials belonging to condition1 cfg.channel ='MEG'; cfg.keeptrials='yes'; cfg.blc = 'yes'; cfg.blcwindow = [-02 0]; data=ft_timelockanalysis(cfg,data); cfg =[]; cfg.channel='MEG'; cfg.covariance='yes'; cfg.covariancewindow=[0 0.2]; cfg.removemean ='no'; cfg.keeptrials='yes'; timelock_post_cond1 = ft_timelockanalysis(cfg,data); timelock_pre_cond1 = ft_timelockanalysis(cfg,data); %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE BLOCK cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.grid.filter=source_post.avg.filter; cfg.lcmv.keepfilter='no'; cfg.keeptrials = 'yes'; cfg.vol = vol.vol; cfg.grad=grad.grad; cfg.lcmv.lambda='5%'; source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); source_post_cond1.avg.nai = source_post_cond1.avg.pow./source_pre_cond1.avg.pow; %PLOT source_post_cond1.pos = template.pos; source_post_cond1.dim = template.dim; source_post_cond1.xgrid = template.xgrid; source_post_cond1.ygrid = template.ygrid; source_post_cond1.zgrid = template.zgrid; cfg = []; cfg.parameter =' avg.nai'; interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); cfg = []; cfg.funparameter = 'nai'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.funcolorlim = [1.5 2.0]; ft_sourceplot (cfg,interp_cond1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I also tried it using rawtrials, but with the same outcome (no activation visible in sourceplot). As I said, doing the same thing for cond1 without using the common filter works perfectly fine. Does anybody have an idea what might be my mistake?. Thank you a lot for your help! Ninja -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Jan 24 17:29:09 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 24 Jan 2013 17:29:09 +0100 Subject: [FieldTrip] postdoc and PhD position in comp neuroscience & MEG/EEG methods, Jena, Germany References: <2059450434.7696.1358875351785.JavaMail.root@zimbra> Message-ID: Begin forwarded message: > Dear FieldTrip community, > > We are inviting applications for a postdoctoral and a PhD student position in the Computational Neuroscience & Magnetoencephalography group at the Biomagnetic Centre (http://www.biomag.uni-jena.de), Friedrich-Schiller-University of Jena, Germany. > > The successful candidates will develop novel analysis methods for Magneto- and Electroencephalography (MEG/EEG) such as connectivity analysis, source reconstruction and advanced single trial analysis. The positions are devoted to research only without any teaching or administrative duties. The work will be done in collaboration with the MEG and theoretical neuroscience groups at the Wellcome Trust Centre for Neuroimaging in London, UK. These positions are ideal for candidates with a computational/theoretical background and a strong interest in collaborating with experimental researchers in neuroimaging. > > The lab runs a 306 channels MEG (Neuromag Vectorview) with 128 integrated EEG sensors, a high-density EEG system, and high-performing compute servers. In addition the group has access to a research-only 3T MRI-scanner. All experimental facilities (MEG, EEG, MRI) are supported by experienced physics and IT staff. > > The applicants should have worked in neuroscience before and be motivated to work in a multidisciplinary team (e.g. mathematicians, engineers, psychologists, physicians). > > The postdoc applicant must have a PhD (or equivalent) in computational neuroscience, physics, or a related field and should, ideally, have expertise in EEG or MEG and nonlinear dynamical systems. The PhD student should have a mathematically oriented background in computational neuroscience, physics, or a related field but students with a cognitive neuroscience, psychology, or related background will be considered as well. > > The starting dates for both positions are flexible. Salary is based on German Public service regulations (postdoc TV-L E13, PhD student TV-L E13 65%). The postdoc position is initially for two years with possible extension; the PhD position is for three years with one year possible extension. > > Interested candidates are encouraged to get in touch at their earliest convenience. Applications are considered until 15th of March 2013 but reviewing of the applications will start immediately. > > For questions or an informal discussion about these positions please contact Prof. Stefan Kiebel (skiebel at biomag.uni-jena.de). > > The following documents should be included in the application in a single PDF-file and sent by email to skiebel at biomag.uni-jena.de: A cover letter including a brief description of personal qualifications and future research interests, curriculum vitae, and contact details of two personal references. > > > -- > Prof. Dr. Stefan Kiebel > Biomagnetic Center > Hans Berger Dept of Neurology > Jena University Hospital, Germany > Tel.: +49 (0) 3641 9325770 > http://www.biomag.uni-jena.de From johanna.zumer at donders.ru.nl Thu Jan 24 17:30:35 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Thu, 24 Jan 2013 17:30:35 +0100 Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> References: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Message-ID: Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 24 22:03:05 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 16:03:05 -0500 Subject: [FieldTrip] evoked power greater than total power Message-ID: Hi All, I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? Cheers - Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 22:45:04 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 14:45:04 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From russgport at gmail.com Thu Jan 24 23:07:35 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 17:07:35 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don wrote: > Russ, > > It might help if you posted a bit of your script so that we could see how > you are deriving the measures. But, the relationship you state is true only > given a couple of assumptions. First it depends on how you define induced > power. For some, induced power is the total signal, phase-locked and > non-phase-locked, i.e., the average in the frequency domain. So in that > sense, induced = total. If you are going with the notion that induced = > total - evoked, then yes, you would expect that evoked power would always > necessarily be less than or equal to total power. But second, that > relationship only holds up if you do not baseline correct the power > estimates you are comparing, which is often done in time-frequency > analyses. As far as I recall, in ft_freqanalysis there is no particular > option to return only induced or evoked power in the way that you mention > it, but certainly it could be calculated from the output of that function. > So if you let us know what your cfg options were and subsequent > calculations, it might be more helpful. > > Best, > > Don > ----------------------- > Don Rojas, Ph.D. > UCD Magnetoencephalography Lab > University of Colorado Denver Anschutz Medical Campus > 13001 E. 17th Pl F546 > Aurora, CO 80045 > USA > > > On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > > > Hi All, > > > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both in-vivo > EEG recordings in animals and MEG in children, through freqanalysis. I have > the strange result though that my total power (in either mV^2 or nAm^2) is > less than my evoked power. How can this be, if total=evoked+induced. I am > assuming that something that I have done while handling the data is causing > this error, but I have check my work very carefully. Has anyone ever seen > anything like this before, or can suggest what I am doing to help point me > in the right direction? > > > > Cheers - Russ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 23:17:45 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 15:17:45 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <28BB4648-B4D2-42EA-8E9D-19201531EE49@ucdenver.edu> Yes, I think it is the baseline correction you are doing. Try the comparison without the correction and see if that makes more sense. If there is still a non-trivial difference, then it might be a more interesting problem. On Jan 24, 2013, at 3:07 PM, Russell G Port wrote: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don > wrote: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab 13001 E. 17th Pl F546 Aurora, CO 80045 303-724-4994 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 24 23:24:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 24 Jan 2013 23:24:45 +0100 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <5101B4AD.30901@uni-leipzig.de> On 24/01/2013 22:03, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both > in-vivo EEG recordings in animals and MEG in children, through > freqanalysis. I have the strange result though that my total power (in > either mV^2 or nAm^2) is less than my evoked power. How can this be, if > total=evoked+induced. I am assuming that something that I have done > while handling the data is causing this error, but I have check my work > very carefully. Has anyone ever seen anything like this before, or can > suggest what I am doing to help point me in the right direction? > > Cheers - Russ > Hi Russ, I'm guessing you mean after baseline correction. Evoked and total have very different baselines: with evoked power, pre-stim-onset power is usually pretty much 0, since there shouldn't really be anything time/phase-locked in this period. That's not the case for total power. If you're doing relative measures of change from baseline this difference can be ENORMOUS - for example, I often see evoked power 500 times greater than baseline compared to, say, a 20% increase in total power (this is in the gamma band range). On the single trial level, the evoked, such as it is, contributes very little to the overall signal - averaging out the noise/background/non-phase-locked activity is what makes it stand out. one way people sometimes isolate induced activity is to remove the ERP from each trial before doing the TF; if you do it that way and compare it to total power, you should see that it makes very little difference (which is one reason why I prefer not to do it, another being that it rests on a faulty assumption - that the ERP is stationary and the same on each trial). Basically, there's nothing wrong here. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From caulveil at gmail.com Thu Jan 24 23:32:56 2013 From: caulveil at gmail.com (Jacob Martin) Date: Thu, 24 Jan 2013 17:32:56 -0500 Subject: [FieldTrip] Realtime problems with intensive computations and data loss due to buffer expiration Message-ID: Hello, I have written a Matlab StreamExtractor Class that reads data from the Fieldtrip buffer and then "notifies" various other Matlab component classes that new BCI data is available so that the class can analyze it (e.g. a Signal Viewer component could show the data so far, a Classifier component could classify the newest data, etc). The problem I am having is that since Matlab is single threaded, when the notify method is called, and the notified component does a computationally intense operation (e.g. building a classifier), then by the time that the notify() method returns to the StreamExtractor, many data samples can be lost. It is as if I am limited to very short operations that will return "in time" to catch all the samples that are in the buffer. I have thought to use parallel processing to allow "notify" to return quickly, but that strategy is made difficult with GUIs because pmode processes in Matlab do not have access to graphics. More imporantly, there is some overhead due to launching the parallel processes and executing many notify commands, which may ultimately cause the StreamExtractor class to again miss data if too many classes are listening and being notified by the StreamExtractor. I could "live downsample" the data (currently using 2048hz), but I would prefer to keep 2048hz and just increase the buffer size if possible so that all events will be recorded, regardless of how much time each component takes to return. Is there a way to increase the default buffer size in Fieldtrip so that I will not lose data due to computationally intense operations being executed intermittently during the stream? Does anyone have any other ideas? I'm almost at a loss here... Best wishes, Jacob From mcgoiv0 at wfu.edu Fri Jan 25 01:55:54 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 24 Jan 2013 19:55:54 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Thanks Tom and Arjen! I used -anon with newDs, it works fine. Thanks, Inna Thanks, Inna On Wed, Jan 23, 2013 at 1:08 PM, Arjen Stolk wrote: > Hi Inna, > > Have a look here > > http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset > > Yours, > Arjen > > 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > > Use the CTF tool newDs with the -anon option. >> >> McGowin, Inna wrote: >> >>> Hello, >>> >>> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >>> must be removed from the file)? >>> >>> I have tools for the DICOM format but not for CTF formats. >>> >>> Thanks! >>> -- >>> Inna >>> >>> >>> ------------------------------**------------------------------** >>> ------------ >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> >> -- >> The white knight is talking backwards. >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Jan 25 02:57:37 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 20:57:37 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: <5101B4AD.30901@uni-leipzig.de> References: <5101B4AD.30901@uni-leipzig.de> Message-ID: thanks everyone, I was starting to get a little nervous On Thu, Jan 24, 2013 at 5:24 PM, Matt Craddock wrote: > On 24/01/2013 22:03, Russell G Port wrote: > >> Hi All, >> >> I am currently trying to understand something and I think fieldtrip >> people will already know whats going on. I run my data, from both >> in-vivo EEG recordings in animals and MEG in children, through >> freqanalysis. I have the strange result though that my total power (in >> either mV^2 or nAm^2) is less than my evoked power. How can this be, if >> total=evoked+induced. I am assuming that something that I have done >> while handling the data is causing this error, but I have check my work >> very carefully. Has anyone ever seen anything like this before, or can >> suggest what I am doing to help point me in the right direction? >> >> Cheers - Russ >> >> > Hi Russ, > > I'm guessing you mean after baseline correction. Evoked and total have > very different baselines: with evoked power, pre-stim-onset power is > usually pretty much 0, since there shouldn't really be anything > time/phase-locked in this period. That's not the case for total power. If > you're doing relative measures of change from baseline this difference can > be ENORMOUS - for example, I often see evoked power 500 times greater than > baseline compared to, say, a 20% increase in total power (this is in the > gamma band range). On the single trial level, the evoked, such as it is, > contributes very little to the overall signal - averaging out the > noise/background/non-phase-**locked activity is what makes it stand out. > one way people sometimes isolate induced activity is to remove the ERP from > each trial before doing the TF; if you do it that way and compare it to > total power, you should see that it makes very little difference (which is > one reason why I prefer not to do it, another being that it rests on a > faulty assumption - that the ERP is stationary and the same on each trial). > Basically, there's nothing wrong here. > > Cheers, > Matt > -- > Dr. Matt Craddock > > Post-doctoral researcher, > Institute of Psychology, > University of Leipzig, > Seeburgstr. 14-20, > 04103 Leipzig, Germany > Phone: +49 341 973 95 44 > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ninja78278 at aol.com Fri Jan 25 09:25:34 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Fri, 25 Jan 2013 03:25:34 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: References: Message-ID: <8CFC8ECAE12D748-1708-DAE2@webmail-m001.sysops.aol.com> Hi Johanna, yes, of course, that was my mistake! Thank you :-)!!! Now it is working! 'nai' as cfg.funparameter is working fine. I think I also tried 'avg.nai' in the beginning and got an error. All the best, Ninja -----Original Message----- From: fieldtrip-request To: fieldtrip Sent: Thu, Jan 24, 2013 5:32 pm Subject: fieldtrip Digest, Vol 26, Issue 35 ------------------------------ Message: 3 Date: Thu, 24 Jan 2013 17:30:35 +0100 From: Johanna Zumer To: FieldTrip discussion list Subject: Re: [FieldTrip] lcmv beamform with common filter Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 26, Issue 35 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Jan 26 12:42:10 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 26 Jan 2013 11:42:10 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , , Message-ID: Hi Gianpaolo (or anyone else that can help me out again), Again, thank you very much for putting me onto mne_ex_read_write_raw.m. Unfortunately I am still having problems. Because I appear to have been not too forthcoming in my original email, the problem is with the triggering in our neuromag triux (306 channel) system, I'm having triggers add onto each other and others fail to register with the trigger channels. I've written a script to read in the trigger information from my stimuli presentation software and want to write the accurate data to the main trigger channel (STI101), then save as a new fiff file. By adding code from mne_ex_read_write_raw.m to my overall script (reading the entire data set into memory at once), I'm able to replace the questionable STI101 data with that obtained from my stim software, but have a problem when writing the new fiff file. The size of the input file is ~2gb but when writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of redundant data, but am unable to open the new file, even on a machine running 16gb RAM. I've attached the script and would be extremely grateful for any advice that could be given. Thanks again to everyone on the mailing list whose helped me out so far, Peter. _________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Peter Goodin [pgoodin at swin.edu.au] Sent: Thursday, 24 January 2013 11:05 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: trigchange.m URL: From caspervanheck at gmail.com Sat Jan 26 17:05:28 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Sat, 26 Jan 2013 17:05:28 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Hanneke, But data.anatomy doesn't exist; I added it through the line *data.anatomy = mri.anatomy; clear mri*, but originally it does not have any. I'm going to take a look at earlier steps to find out why this field isn't there in the first place (assuming it should be). Sincerely, Casper On Wed, Jan 23, 2013 at 12:19 PM, Hanneke van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Hi Casper, > > The cfg.anaparameter should then be 'anatomy'. It refers to the field (in > data) in which the anatomy can be found, in your case: data.anatomy. > > Hope this helps, > > Hanneke > Op 23 jan. 2013 10:57 schreef "Casper van Heck" > het volgende: > > Dear Jan-Mathijs, >> >> Since ft_sourceplot complained about not having anatomy (or functional) >> parameter, and it seems to default to a field named '*data.anatomy'*, I >> assumed adding *mri.anatomy* in *data.anatomy* would suffice. >> >> But, without this, ft_sourceplot would again require an anatomy >> parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' >> in the cfg I feed to ft_sourceplot, where 'mri' is the result from >> ft_volumereslice. >> However, ft_sourceplot then says "*do not understand cfg.anaparameter*", >> and thus it is not plotting "*anatomy*". After looking back to the >> plotting tutorial where I read "The anatomy can be read with ft_read_mri", >> I'm not quite sure what's going wrong. >> >> Sincerely, >> >> Casper >> >> >> >> On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi intersect(everyone, casper) >>> >>> Everyone, >>> >>> While the whole script is way too convoluted to put up here, but luckily >>> the relevant steps are quite simple >>> Input is simply raw data, read with ft_preprocessing, which is passed >>> through functions as shown in my previous email. >>> >>> After passing the data to ft_sourcegrandaverage (only using >>> cfg.outputfile), where the data is fed as a cell array (which seems to work >>> properly), I go over to a source-comparison script. This script works as >>> follows: >>> First I create a pre-post contrast as shown in the beamformer tutorial. >>> >>> Next, I read some MRI-data using ft_read_mri from a standard folder, and >>> reslice this data: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >>> * >>> *mri = ft_volumereslice([], mri);* >>> >>> Then: >>> *[data] = ft_sourceinterpolate(cfg, data, mri); >>> * >>> where cfg contains: >>> *cfg.parameter: 'avg.pow'* >>> *cfg.downsample: 4* >>> >>> and I add the anatomy: >>> *data.anatomy = mri.anatomy; clear mri* >>> >>> >>> Putting mri.anatomy into data.anatomy is probably not what you want to >>> do: the whole point about ft_sourceinterpolate is to get the functional and >>> anatomical data in the same 'pixel-space'; this is the only way that >>> ft_sourceplot (as of yet) can deal with it. The reason is that now the >>> functional data is sampled once every 4 voxels, relative to the anatomy. I >>> guess that this causes your problem in ft_sourceplot. >>> >>> >>> >>> Best wishes, >>> >>> Jan-Mathijs >>> >>> >>> >>> And finally, I call ft_sourceplot using these options: >>> >>> cfg.*parameter: 'avg.pow';* >>> >>> *cfg.downsample: 4* >>> >>> * >>> * >>> >>> with one of these three methods: >>> 1) *cfg.method = 'surface';* >>> * cfg.surffile = 'surface_l4_both.mat';* >>> * cfg.surfdownsample = 4;* >>> * cfg.projmethod = 'nearest';* >>> 2) *cfg.method = 'ortho';* >>> 3) *cfg.method = 'slice';* >>> * cfg.nslices = 20;* >>> Which leads to the errors shown earlier. At this point, disp(data) >>> yields: >>> *K>> disp(data)* >>> * avg: [1x1 struct]* >>> * pos: [16777216x3 double]* >>> * dim: [256 256 256]* >>> * inside: [1x16777216 double]* >>> * outside: [1x0 double]* >>> * coordsys: 'ctf'* >>> * unit: 'mm'* >>> * cfg: [1x1 struct]* >>> * anatomy: [256x256x256 double]* >>> * >>> * >>> I'm guessing it has something to do with the 'inside' and 'outside' >>> elements, so my 'standard head model'. I think I made this using the >>> following code: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load >>> 'standard' anatomical model >>> * >>> * >>> * >>> *% segment the template brain and construct a volume conduction model >>> (i.e. head model)* >>> *cfg = [];* >>> *cfg.output = {'brain' 'scalp' 'skull'};* >>> *cfg.downsample = 2;* >>> *t_seg = ft_volumesegment(cfg, mri);* >>> * * >>> *% create head model* >>> *cfg = [];* >>> *cfg.method = 'singlesphere';* >>> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >>> *cfg.elec = ft_read_sens('standard_1020.elc');* >>> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >>> *clear template_seg* >>> * >>> * >>> *% construct the dipole grid in the template brain coordinates* >>> *cfg = [];* >>> *cfg.normalize = 'no'; % no normalization, since we're comparing two >>> conditions THAT'S RIGHT I DID PAY ATTENTION* >>> *cfg.vol = t_vol;* >>> *t_grid = ft_prepare_sourcemodel(cfg);* >>> * >>> * >>> After which I use this on all subjects, using this (note that I store >>> all data in a single massive structure, to make saving to disk and >>> selecting data etc. easier): >>> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >>> * >>> * >>> Anyone seeing anything obviously stupid? >>> >>> Sincerely, >>> >>> Casper >>> >>> >>> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >>> >>>> Hi Casper, >>>> >>>> I think it is really difficult to figure only from the error message >>>> what >>>> the problem is. I think it would be also useful to see the inputs (cfg, >>>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>>> your data-structure looks like? (I mean that you do not need to send the >>>> actual data, just the screen output of disp(data) and disp(cfg)). >>>> >>>> Best, >>>> Lilla >>>> >>>> >>>> > Dear Fieldtrippers, >>>> > >>>> > I've asked this question earlier, but either it got lost due to >>>> technical >>>> > reasons, or the people who actually understand what's happening here >>>> were >>>> > on vacation, so here it is again: >>>> > >>>> > I've been trying to do a source analysis on a dataset with two >>>> conditions, >>>> > mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> > come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> > essential component of the analysis of this dataset (it's more along >>>> the >>>> > lines of "let's see if I can do this"), and I don't expect any result >>>> > other >>>> > than something like "there might be a source in the left hemisphere", >>>> I'd >>>> > still would like to found out why it's not working. >>>> > >>>> > Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> Fieldtrip >>>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> average >>>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> > >>>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>>> > surface. Initially I tried to get the ortho-option to work, but this >>>> gave >>>> > the following error: >>>> > *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> > *Error in ==> cornerpoints at 11 >>>> > * >>>> > *Error in ==> ft_plot_slice at 157 >>>> > * >>>> > >>>> > So, I tried the surf-option, which gave me this: >>>> > *Undefined function or variable "val".* >>>> > *Error in ==> ft_sourceplot at 1174 >>>> > * >>>> > >>>> > And finally, I tried the slice-option, which gave one of two errors >>>> (which >>>> > seems to be based on how many slices I requested): >>>> > *Out of memory* >>>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> > topping of at 40GB >>>> > Or, the mildly disconcerting: >>>> > *Matlab has encountered an internal error and has to close* >>>> > Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> > * >>>> > >>>> > Can anyone offer any insight in these errors? I think I'm doing >>>> something >>>> > wrong pretty early on, but have no idea what it is. >>>> > >>>> > Sincerely, >>>> > >>>> > Casper van Heck >>>> > >>>> > >>>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>>> > wrote: >>>> > >>>> >> Dear Fieldtrippers, >>>> >> >>>> >> I've been trying to do a source analysis on a dataset with two >>>> >> conditions, >>>> >> mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> >> come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> >> essential component of the analysis of this dataset (it's more along >>>> the >>>> >> lines of "let's see if I can do this"), and I don't expect any result >>>> >> other >>>> >> than something like "there might be a source in the left hemisphere", >>>> >> I'd >>>> >> still would like to found out why it's not working. >>>> >> >>>> >> Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> >> Fieldtrip >>>> >> to find sources based on individual EEG-datasets using >>>> ft_freqanalysis >>>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> >> average >>>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> >> >>>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, >>>> and >>>> >> surface. Initially I tried to get the ortho-option to work, but this >>>> >> gave >>>> >> the following error: >>>> >> *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> >> *Error in ==> cornerpoints at 11 >>>> >> * >>>> >> *Error in ==> ft_plot_slice at 157 >>>> >> * >>>> >> >>>> >> So, I tried the surf-option, which gave me this: >>>> >> *Undefined function or variable "val".* >>>> >> *Error in ==> ft_sourceplot at 1174 >>>> >> * >>>> >> >>>> >> And finally, I tried the slice-option, which gave one of two errors >>>> >> (which >>>> >> seems to be based on how many slices I requested): >>>> >> *Out of memory* >>>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> >> topping of at 40GB >>>> >> Or, the mildly disconcerting: >>>> >> *Matlab has encountered an internal error and has to close* >>>> >> Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> >> * >>>> >> >>>> >> Can anyone offer any insight in these errors? I think I'm doing >>>> >> something >>>> >> wrong pretty early on, but have no idea what it is. >>>> >> >>>> >> Sincerely, >>>> >> >>>> >> Casper van Heck >>>> >> >>>> > _______________________________________________ >>>> > fieldtrip mailing list >>>> > fieldtrip at donders.ru.nl >>>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Sun Jan 27 10:49:56 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Sun, 27 Jan 2013 10:49:56 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex From dave at davebritton.com Sun Jan 27 22:21:17 2013 From: dave at davebritton.com (Dave Britton) Date: Sun, 27 Jan 2013 16:21:17 -0500 Subject: [FieldTrip] cfg.viewmode='reject' throws databrowser error Message-ID: <51059A4D.2050702@davebritton.com> In the following preprocessing, reject_visual and databrowse sequence, ft_reject_visual sets viewmode to 'reject' as a default (line 176), then when ft_databrowser is run, it throws an error upon finding viewmode='reject'. (from main routine semattn.m:) data = ft_preprocessing(cfg); cfg.layout='butterfly'; [data2] = ft_rejectvisual(cfg, data); data2.cfg.layout=cfg.layout; cfg = ft_databrowser(data2.cfg,data2); >> Error using ft_databrowser>redraw_cb (line 1713) unknown viewmode "remove" Error in ft_databrowser (line 685) redraw_cb(h); Error in semattn_main (line 76) cfg = ft_databrowser(data2.cfg,data2); Am I doing something wrong or is this a bug? -Dave From pgoodin at swin.edu.au Sun Jan 27 23:36:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 27 Jan 2013 22:36:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Thanks for letting me know! I'll try changing the precision and see how it goes! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Sunday, 27 January 2013 8:49 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Mon Jan 28 13:07:08 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Mon, 28 Jan 2013 12:07:08 +0000 Subject: [FieldTrip] How to use ft_average_sens? Message-ID: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Hello Fieldtrippers, I get an error message when using ft_average_sens and couldn't find the solution on the ft homepage. Here is my short code: grad_01 = ft_read_sens('Run_01.ds') grad_02 = ft_read_sens('Run_02.ds') AvgGrad = ft_average_sens(grad_01, grad_02) And that's error message: ??? Error using ==> ft_getopt the first input should contain key-value pairs Anyone who can help me there? Thanks and best regards, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Mon Jan 28 13:11:10 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 28 Jan 2013 12:11:10 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Jan 28 13:20:58 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Jan 2013 13:20:58 +0100 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tkietzma at uos.de Mon Jan 28 17:03:47 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Jan 2013 17:03:47 +0100 Subject: [FieldTrip] Problems with Dipole Fitting Message-ID: Dear Mailing List, I am currently trying to use the ft_dipolefitting function to localize the source of a visually evoked response, and to use the dipole time-course to test for effects in source space. Along the way, however, a few questions and problems arose, which I was not yet able to solve despite excessive trying, reading and googling. Some of the questions are technical, others are more general. Please note that I am new to fieldtrip and source localization, so please excuse the potentially stupid ones. The general setup is that we have collected data using a CTF275 system, looking at visually evoked responses (we are showing drawings of faces). The data is cleaned already and we have a structural MRI scan for every subject, which we can use for individual headmodels (I use singleshell, and the models look perfectly fine). As every trial also contained a button-press I first fitted dipoles locked to this button-press as a sanity check. This worked nicely for all subjects. However, I am now looking into the visually evoked responses. This has given me a lot of trouble (see below). Here is the code I use for the actual fit: cfg=[]; cfg.numdipoles =2; cfg.symmetry = 'y'; %I use this, as I expect bilateral visual activations cfg.latency = [.1 .12]; cfg.vol = subvol_singleshell; %volume conduction model for the subject cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, ERF_all); Question 1: Dipole Time Courses To look at the individual time-courses of the dipoles I follow http://mailman.science.ru.nl/pipermail/fieldtrip/2011-April/003690.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-May/005215.html. The returned dipole information in dip.pos is 2x3 (two dipoles, three dimensions), so I can easily pick the position of each of the two dipoles. The dip.mom, however has size 6x13. Is it correct that the first three values of source.dip.mom correspond to the first dipole, and 4:6 to the second dipole? That is, to show the two activations, can I do the following? dip_select=1; dip = source.dip.pos(dip_select,:); [u,s,v] = svd(source.dip.mom((1:3)+(dip_select-1)*3,:)); [vol, grad] = ft_prepare_vol_sens(subvol_singleshell, ERF_all.grad, 'channel', ERF_all.label); L = ft_compute_leadfield(dip, grad,vol,'reducerank',2); % leadfield Li = pinv(L); % pseudoinverse of L %check which orientation the dipole is in orientation_vector = u(:,1)'; Qn = double(orientation_vector/norm(orientation_vector)); % normed orientation vector Qn = repmat(Qn,length(Li),1)'; % make Qn the same size as Li W = dot(Li,Qn)'; % weights for projection to source space waveform = dot(ERF_all.avg,repmat(W,1,size(ERF_all.avg,2))); % source waveform Given this is correct, I noticed in the resulting waveforms that only one of the two dipoles shows a clear activation, whereas the other seems to cover mostly remaining noise. However, based on the perfectly symmetric topography of the activation and given this is a visual response (the M100), I would expect both hemispheres (and therefore both dipoles) to be activated. In fitting the dipole location and moment, is there some sort of regularization, which prefers one strong dipole over two equally active dipoles? Any ideas on this? Question 2: ICA topographies as basis for the fit Given I had quite some problems with the reliability of the fits when using the sensor data, I also tried fitting the dipoles to selected ICA components (namely the ones which explain most of the variance across sensors at a given time-point, the comp structure is given as is from ft_componentanalysis). This, however, lead to the following warning/error: cfg=[]; cfg.numdipoles =1; cfg.component = [17]; cfg.vol = subvol_singleshell;%volume conduction model cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, comp); the input is component data with 271 components and 271 original channels using headmodel specified in the configuration using gradiometers specified in the data computing surface normals selected 0 channels selected 1 topographies Warning: not enough channels to perform a dipole fit I am sure this is a simple mistake, but could not yet successfully solve it. Could it have to do with the fact that the comp structure has a comp.topolabel the original sensor labels, and as comp.label the ICA labels ('runica001' ..)? Question 3: Sensor Averaging Since all else failed, I wanted to use the average gradient position across subjects together with the MNI standard brain to find the dipoles based on the Grand Average activation. Here, I would like to use the ft_average_sens function. However, I have the problem that different subjects were recorded with slightly different numbers of sensors (some with 271 sensors, some with 273). Because of this, the ft_average_sens function throws an error. Is there a way to select a subset of sensors from the grad structure such that I only use the sensors which were present for all subjects? Question 4: Stability of the Fit The toughest and most general question at last: I noticed that the solutions I get from ft_dipolefitting are not very robust. For instance, I get vastly different dipole locations with only subtle changes in the selected time-points. Moreover, although subjects show a clear M100 in sensor space, the dipole locations for some of them are extremely far off (if not to say in the middle of nowhere). Are there certain methods, tricks or tutorials I can look into to get things more robust? I am truly sorry to have so many questions, but any help is highly appreciated! I look very much forward to hearing from you Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 17:55:50 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 11:55:50 -0500 Subject: [FieldTrip] GE MRI platform 12.0 scans don't import into CTF MRIViewer Message-ID: Hello, We have an MRI research scan, GE MRI platform 12.0, that produces scans with some DICOM header fields missing. These fields are required in order to import the scan into CTF MRIViewer or DICOM_Viewer or some other software. Does anybody know if these missing fields can be somehow added to the DICOM header? Maybe in Matlab or through some conversion method? Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 18:01:06 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 12:01:06 -0500 Subject: [FieldTrip] CTF MEG current phantom Message-ID: Hello, Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. It's made of plastic and suppose to be non-magnetic. Thanks, -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Mon Jan 28 18:30:50 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 28 Jan 2013 10:30:50 -0700 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: Message-ID: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> We don't use that phantom, but the 4D MEG phantom is similar in nature. If it is electrically disconnected, then perhaps the mounting of it is coupling in some vibration that is being picked up by your sensors due to some weakly magnetic component to the phantom or phantom mount. Are you certain that the origin of the signal is the phantom? On Jan 28, 2013, at 10:01 AM, "McGowin, Inna" wrote: > Hello, > Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? > If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. > > It's made of plastic and suppose to be non-magnetic. > Thanks, > -- > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Jan 28 19:59:34 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 13:59:34 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: Yes, I run all kind of scans: noise test (good), disconnected phantom (noisy), phantom with dipole removed (noisy), phantom with saline solution removed (noisy); dipole alone (good), saline alone (good). Below is the snapshot for Phantom with no saline solution or dipole: Thanks.[image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 61830 bytes Desc: not available URL: From mushfa.yousuf at googlemail.com Mon Jan 28 20:20:31 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Mon, 28 Jan 2013 20:20:31 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction Message-ID: Hello Fieldtrippers, I am currently doing source analysis using beamformer method in fieldtrip. The data i work on is a simultaneous measurement of MEG (306) with EEG (128) on PD patients. I was successful in calculating the sources for both the modalities alone. I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation of the lead field. But, then when i want to use the created vol for the source analysis i have two structures one for EEG and the second one for MEG. Now, i can only define only one to estimate the sources. How to use this for both the modalities? Any help would be appreciated. With regards Mushfa -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Mon Jan 28 20:44:43 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 28 Jan 2013 14:44:43 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5106D52B.5050203@kurage.nimh.nih.gov> With no fluid I would hazard a guess that you are seeing building vibration. Try just putting a stiff wire under the helmet and see what kind of vibration you get. McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). -- The white knight is talking backwards. From mcgoiv0 at wfu.edu Tue Jan 29 01:28:07 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 19:28:07 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5106D52B.5050203@kurage.nimh.nih.gov> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5106D52B.5050203@kurage.nimh.nih.gov> Message-ID: Thanks, I will try that. It seems like the plastic material of the phantom is contaminated with some magnetic impurities... Inna On Mon, Jan 28, 2013 at 2:44 PM, Tom Holroyd (NIH/NIMH) [E] < tomh at kurage.nimh.nih.gov> wrote: > With no fluid I would hazard a guess that you are seeing building > vibration. Try just putting a stiff wire under the helmet and see what kind > of vibration you get. > > > McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom (noisy), >> phantom with dipole removed (noisy), phantom with saline solution removed >> (noisy); dipole alone (good), saline alone (good). >> > > -- > The white knight is talking backwards. > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Tue Jan 29 08:21:30 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Tue, 29 Jan 2013 08:21:30 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5107787A.5030309@wwu.de> Hi Inna, did you fixate the cables and connectors of the Current Phantom? Are the cables twisted? Andreas On 01/28/13 19:59, McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From patrick.jung at esi-frankfurt.de Tue Jan 29 09:52:37 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:52:37 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309B6@UM-EXCDAG-A01.um.gwdg.de> Thanks, Eelke, that works fine. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: 28 January 2013 13:21 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Tue Jan 29 09:54:12 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:54:12 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309C2@UM-EXCDAG-A01.um.gwdg.de> Thanks, Vladimir, that works. I did not understand that I have to concatenate the arrays. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Vladimir Litvak Sent: 28 January 2013 13:11 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From andrea.brovelli at univ-amu.fr Tue Jan 29 17:16:05 2013 From: andrea.brovelli at univ-amu.fr (andrea brovelli) Date: Tue, 29 Jan 2013 17:16:05 +0100 Subject: [FieldTrip] Error in prepare_freq_matrices.m ? Message-ID: <20130129171605.176164iln90u72f4@wmelperso1.univmed.fr> Dear all, I have an error while running ft_sourceanalysis. I am analysing a data set over a frequency range which includes 100 frequencies and 60 trials. I get an error due to the definition of the variable Ntrials, which as far as I understand, it is done in prepare_freq_matrices.m at lines 76 -> 85: ------------------------------------------------- % the time-frequency latency has already been squeezed away (see above) if strcmp(freq.dimord, 'chan_freq') Ntrials = 1; elseif strcmp(freq.dimord, 'rpt_chan_freq') Ntrials = length(freq.cumtapcnt); elseif strcmp(freq.dimord, 'rpttap_chan_freq') Ntrials = length(freq.cumtapcnt); else error('unrecognized dimord for frequency data'); end ------------------------------------------------- If the number of trials is less than the number of frequencies, Ntrials = length(freq.cumtapcnt) should be replaced by Ntrials = size(freq.cumtapcnt,1); It is the case ? Thanks a lot Andrea From fanny.lachat at gmail.com Tue Jan 29 16:56:20 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 16:56:20 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? Message-ID: Dear fieldtrip users, I am trying to use the function* ft_selectdata_new * on my data. I have time-frequency data that come from ft_freqanalysis. I want to average my data over the frequency of interest (10-12Hz). ---------------------- Here is my script : cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.frequency = [10 12]; cfg.avgoverfreq = 'yes'; cfg.latency = [-0.7 1]; cfg.avgovertime = 'no'; avg_10_12 = ft_selectdata_new (cfg,mydata); ------ This doesn't work : 'Undefined function 'ft_selectdata_new' for input arguments of type 'struct'. What should I change in my script in order for it to work ? (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); Thank you in advance ! -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Tue Jan 29 17:23:22 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Tue, 29 Jan 2013 17:23:22 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hi Fanny, Thats a matlab error when it cant find the function (ft_selectdata_new) since its probably in a private folder. Try ft_selectdata (it will figure out if you're using it in the old (key-value pairs) or new (cfg,data) way). Cheers, Stephen On 29 January 2013 16:56, Fanny wrote: > Dear fieldtrip users, > > I am trying to use the function ft_selectdata_new on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From johanna.zumer at gmail.com Tue Jan 29 17:23:15 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 29 Jan 2013 17:23:15 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hello, This sounds like it could be a path issue. Is ft_selectdata_new in your path? If you type 'which ft_selectdata_new' does it show up? If not, type ft_defaults and then try again. If still a problem...I'll have to look closer. Cheers, Johanna 2013/1/29 Fanny > Dear fieldtrip users, > > I am trying to use the function* ft_selectdata_new * on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanny.lachat at gmail.com Tue Jan 29 17:31:19 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 17:31:19 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Thank you Johanna, with the use of ft_defaults my script works now ! Cheers 2013/1/29 Johanna Zumer > Hello, > > This sounds like it could be a path issue. Is ft_selectdata_new in your > path? If you type 'which ft_selectdata_new' does it show up? If not, type > ft_defaults and then try again. > > If still a problem...I'll have to look closer. > > Cheers, > Johanna > > > 2013/1/29 Fanny > >> Dear fieldtrip users, >> >> I am trying to use the function* ft_selectdata_new * on my data. >> I have time-frequency data that come from ft_freqanalysis. >> >> I want to average my data over the frequency of interest (10-12Hz). >> >> ---------------------- >> Here is my script : >> >> cfg = [ ]; >> cfg.parameter = 'powspctrm'; >> cfg.frequency = [10 12]; >> cfg.avgoverfreq = 'yes'; >> cfg.latency = [-0.7 1]; >> cfg.avgovertime = 'no'; >> >> avg_10_12 = ft_selectdata_new (cfg,mydata); >> ------ >> >> This doesn't work : 'Undefined function 'ft_selectdata_new' for input >> arguments of type 'struct'. >> >> What should I change in my script in order for it to work ? >> (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); >> >> Thank you in advance ! >> >> -- >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Jan 29 19:46:47 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Jan 2013 13:46:47 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5107787A.5030309@wwu.de> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: Hi Andreas, The problem is that there are no cables or connecters used for the noise test study I did on the phantom. Just the phantom... It seems it has some magnetic contamination and creates a signal due to vibration. My next step is to clean thoroughly the phantom, inside and outside, and see will it help. Thanks, Inna On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink wrote: > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom >> (noisy), phantom with dipole removed (noisy), phantom with saline >> solution removed (noisy); dipole alone (good), saline alone (good). >> >> Below is the snapshot for Phantom with no saline solution or dipole: >> Thanks.Inline image 1 >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> >> > -- > > ==============================**==============================**========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > D-48149 Muenster mobil: +49-(0)160-98527553 > Germany fax: +49-(0)251-83-56874 > e-Mail: a.wollbrink at wwu.de > > ==============================**==============================**========== > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Wed Jan 30 11:27:32 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Wed, 30 Jan 2013 11:27:32 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: <5108F594.7000707@wwu.de> Hi Inna, did you detect the intefering signal in the reference channels as well? How do the MEG sensor signals behave for different noise balancing settings (different synthetic gradiometer orders)? Cheers, Andreas On 01/29/13 19:46, McGowin, Inna wrote: > Hi Andreas, > The problem is that there are no cables or connecters used for the noise > test study I did on the phantom. > Just the phantom... It seems it has some magnetic contamination and > creates a signal due to vibration. > My next step is to clean thoroughly the phantom, inside and outside, and > see will it help. > Thanks, > Inna > > On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink > wrote: > > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > -- > > ==============================__==============================__========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > > D-48149 Muenster mobil: +49-(0)160-98527553 > > Germany fax: +49-(0)251-83-56874 > > e-Mail: a.wollbrink at wwu.de > > > ==============================__==============================__========== > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > > > -- > Inna McGowin > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From singhharsimrat at gmail.com Wed Jan 30 18:26:46 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 30 Jan 2013 17:26:46 +0000 Subject: [FieldTrip] Reading events from a trigger channel Message-ID: Hi Fieldtrippers My data is in edf format but has a event marker channel in the form of pulse on channel 1. I have tried to use event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2,'detectflank','up'); But 'detectflank' doesn't seem to work. Is it particular for MEG data format (yokogawa). Can some one give me an idea how to define pulses on channel trials in define trial. The channel has same Fs as data channels. Thanks for your help in advance. Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.stoffers at gmail.com Thu Jan 3 19:39:37 2013 From: d.stoffers at gmail.com (Diederick Stoffers) Date: Thu, 3 Jan 2013 19:39:37 +0100 Subject: [FieldTrip] Brain imaging PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands. Message-ID: <21E5F1A0-241E-43B6-957B-18A7767A7B51@gmail.com> Dear all, Please find attached a description of PhD trainee project available at the Netherlands Institute for Neuroscience, Amsterdam, The Netherlands, that I am posting on behalf of my group leader. Relevant keywords for this project are sleep, emotion, arousal, high-density EEG, fMRI, insomnia and internet. Cheers, Diederick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VacancyPhDCandidateBrainImaging.pdf Type: application/pdf Size: 83310 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 3 23:02:29 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 3 Jan 2013 17:02:29 -0500 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data Message-ID: Hello All, I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on this board, i.e. to use ft_connectivityanlaysis, or using tmpdat = freq.fourierspctrm; tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; itc = abs(mean(tmpdat)); % this will give the itc >From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of coherence), since when plotting cross-spectra you would need a reference channel? Thanks Russell Port Upenn Neuroscience Graduate Group -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 4 09:38:08 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Jan 2013 09:38:08 +0100 Subject: [FieldTrip] calculating the ITC or PLV from animal EEG data In-Reply-To: References: Message-ID: Dear Russell, There's an important detail that you may have glossed over, and relates indeed to the difference between PLV and ITC. ITC can be defined within a single electrode (i.e. it is a univariate measure), and it quantifies the phase consistency across observations, of oscillations relative to an event of interest. PLC can only be defined across two electrodes (i.e. it is a bivariate measure), and it quantifies the phase difference consistency across observations, of oscillations (i.e. relative to one another). The reference electrode does not count as a second electrode in this case. In other words, it looks like you can only compute ITC. In order to visualize it, you can do something like this: freqnew = freq; freqnew = rmfield(freq, 'fourierspctrm'); freqnew.powspctrm = itc; cfg = ... (build the cfg according to your needs) figure;ft_singleplotER(cfg, freqnew); Best wishes, Jan-Mathijs On Jan 3, 2013, at 11:02 PM, Russell G Port wrote: > Hello All, > > I was hoping someone could lend me a hand with an issue I have. I have animal EEG sets, which I have processed with fieldtrip. Each animal had 1 hippocampal > electrode and one reference electrode, and were run in a CED system. From the way it was setup in the past; each animal was listed as a channel. I.E. channel 1 > corresponded to animal 1, etc etc. When I read it into fieldtrip,as would be correct normally each channel is again an animal and each run it a data set (which > would normally be a subject). This is fine, since I have found ways to work around this, and can also separate each animal's data into seperate data sets > and rename their channel "electrode 1". What interests me though is computing the phase-locking value over trials, and/or making grand averages of the phase-locking > value over certain conditions (a certain subset of mice), I think another name for this phase-locking value would be intertrial coherence..? I am found useful things on > this board, i.e. to use ft_connectivityanlaysis, or using > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); ; % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > From reading other messages I know that everyone on this board is knowledgeable. How would other people compute this PLV for the kind of data I have? Is it the same as > ITC? I assume theres critical details that I am glossing over. Lastly is there a way using ft_singleplotERS, to plot this PLV measure (or atleast measure of > coherence), since when plotting cross-spectra you would need a reference channel? > > Thanks > Russell Port > Upenn Neuroscience Graduate Group > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at psych.ru.nl Fri Jan 4 15:50:21 2013 From: e.maris at psych.ru.nl (Eric Maris) Date: Fri, 4 Jan 2013 15:50:21 +0100 (CET) Subject: [FieldTrip] Question about cluster-based statistical testing (sum of t-stats or suprathreshold t-stats?) In-Reply-To: References: <50de2ca3.e90b320a.2720.73b5SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03ae01cdea8a$d4476e90$7cd64bb0$@maris@psych.ru.nl> Dear Artemy, Importantly, these constants also enter in the permutation distribution that is used to evaluated the significance of the maximum cluster-mass statistic, to the effect that the Bullmore-style and the Fieldtrip-style permutation distributions are shifted versions of each other. As a result, the p-values that roll out of the two approaches are identical. If I understand correctly, having the same resulting p-values could only be if the two methods assign the same rank-ordering to a given a set of clusters. But I don't think that is the case. Let's imagine that the t-statistic cutoff 'c' is equal to 1, and the data contains two suprathreshold clusters (let's say this is a spatial test and the clusters are composed of electrodes): - The first cluster has 10 electrodes, each one with a t-statistic equal to 1.1 - The second cluster has 2 electrodes, both with a t-statistic equal to 3 As I understand, Bullmore's method would assign cluster 1 a mass of 10*(1.1-1) = 1 and cluster 2 a mass of 2*(3-1)=4 , while your method would assign cluster 1 a mass of 10*1.1 = 11 and cluster 2 a mass of 2*3 = 6. Hence, given a null distribution, it should be possible to choose a cluster-based threshold that indicates as significant only cluster 1 under Bullmore's method, and only cluster 2 under yours. I think your reasoning is correct: when the data contain more than one suprathreshold cluster, my argument does not apply anymore. Your example shows that the Bullmore- and Fieldtrip-style cluster statistics have different sensitivities. Thank you for pointing this out. For every test statistic, the decisions based on the permutation p-value controls the type-I error rate, but the type-II error rate (the complement of sensitivity) depends on the exact test statistic. Thanks for confirming that up. I should note, though, that this is an issue even in data without multiple suprathreshold clusters. The same logic as above -- which shows that the two measures gives different ranks to same set of clusters -- also applies to the distribution of clusters under the null hypothesis. Thus one can imagine a single cluster in the data that would be judged significant under Fieldtrip's method and not significant under Bullmore, or vice-versa. I believe that generally, in comparison to Bullmore's method, Fieldtrip's method would tend to favor judging-as-significant large clusters (with many electrodes). Sure, it also applies to the distribution of clusters under the null hypothesis and, therefore, can result in different p-values for the Fieldtrip and the Bullmore style cluster statistics, even when there is only single cluster in the data. I should have made this more explicit in my reply, especially since the distribution of clusters under the null hypothesis is random (and therefore a focus on the single-cluster-in-the-data situation is not a very useful one). I personally think of the distinction not so much in terms of controlling sensitivity, but rather as concerning the definition of what counts as a cluster of interest. Though both methods look for spatiotemoprally contiguous regions of electrodes that exceed threshold, for Bullmore the cluster is the sum of suprathreshold statistic values , while for Fieldtrip it's the sum of the entire statistic values in the region. I'm quite interested in the question of which gives more justifiable/better results in real-world settings, though unfortunately I have not seen any work done on the matter. From what I have seen in my brief forays into the extensive analytic + numerical studies of cluster-based significance testing in the fMRI literature, in that field they always refer to Bullmore-style clusters. I do think that sensitivity is a crucial concept here. Neurobiological data are almost always high-dimensional (data arrays with dimensions space, time and/or frequency), but the statistical test only answers the question whether there is some direction in this high-dimensional space along which the experimental conditions differ. It is crucial that our test statistics are chosen such that they have a high sensitivity in the directions that are neurobiologically plausible. In a recent paper in Psychophysiology (2012), I took some time to explain this issue. Note that others in the field (e.g., Karl Friston) often put forward the claim that parametric statistical tests (e.g., the t-statistic) are always more sensitive than nonparametric statistical tests. This claim only holds for scalar observations (e.g., an electrical potential measured at one electrode and one post-stimulus time), which is not the type of data neurobiological studies are typically interested in. Thanks for your interest in this issue. You ask the right questions. Also, my apologies for my earlier sloppy replies. Eric Thanks again & happy holidays... -Artemy -------------- next part -------------- An HTML attachment was scrubbed... URL: From taherahlansari at hotmail.com Fri Jan 4 18:44:42 2013 From: taherahlansari at hotmail.com (Tahereh L. Ansari) Date: Fri, 4 Jan 2013 17:44:42 +0000 Subject: [FieldTrip] RealTime fMRI _ Problem with gui_Streamer In-Reply-To: References: Message-ID: Hi,I get this error (in the cmd window of the siemens_gui_streamer): "Warning: another change on file E:/IMAGE/...xxxxx.PixelData detected - ignoring" when i've ran one scan (e.g. structural) and am now running the second scan (e.g functional)! So it seems that if 'xxxx.PixelData' is detected in E:/IMAGE, gui_streamer will NOT send it to the buffer (even though this xxxx.PixelData belongs to a new scan session!) and gives the above warning!! restarting the gui_streamer does not help either! Please help! L -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertram0611 at pku.edu.cn Sat Jan 5 09:12:28 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) Subject: [FieldTrip] =?gbk?q?Questions_about_Cluster-based_permutation_tes?= =?gbk?q?ts_on_time-frequency_data?= Message-ID: <2121284504.247.1357373548881.JavaMail.root@bj-mail07.pku.edu.cn> Dear all, I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. Thanks in advance! -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SpamAssassinReport.txt URL: From vitoria.piai at gmail.com Sat Jan 5 11:21:34 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:21:34 +0100 Subject: [FieldTrip] When to detrend/demean Message-ID: <50E7FEAE.3080103@gmail.com> Dear ftrippers, I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? As relevant background, our EEG datasets involve speech production on every trial. We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. But in the FT example 'Reading and pre-processing EEG data', the cfg is cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. Then, when calculating ERPs, I had both demean and detrend before timelocking. But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? - preprocess with default (so NO detrend and NO demean) - then demean and detrend for ft_timelockanalysis and ft_freqanalysis Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! Vitoria From vitoria.piai at gmail.com Sat Jan 5 11:38:54 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Sat, 05 Jan 2013 11:38:54 +0100 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data (??) In-Reply-To: References: Message-ID: <50E802BE.7040005@gmail.com> Dear Lin, There have been previous posts on that matter, for example: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004260.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html Good luck! On 1/5/2013 11:21 AM, fieldtrip-request at science.ru.nl wrote: > > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! From politzerahless at gmail.com Sat Jan 5 11:54:53 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 18:54:53 +0800 Subject: [FieldTrip] Questions about Cluster-based permutation tests on time-frequency data Message-ID: Hello Lin, Hi Lin, Yes, it's definitely possible to use the cluster-based test for a 2x2 within-subjects design, by hard-coding the main effects and the interaction. See http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html Best, Steve Politzer-Ahles > Message: 3 > Date: Sat, 5 Jan 2013 16:12:28 +0800 (CST) > From: ?? > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Questions about Cluster-based permutation tests > on time-frequency data > Message-ID: > <2121284504.247.1357373548881.JavaMail.root at bj-mail07.pku.edu.cn> > Content-Type: text/plain; charset="utf-8" > > Dear all, > I have an emergency questions. Could FieldTrip toolbox analyse data from a 2*2 full-factors experiment instead of repeated-mesured ANOVA. I want to find the significant effects in different frequecy band, different time window, different electrodes. Because I prefer the interaction to each single condition. > > Thanks in advance! > -- > Lin Cai > Department of Psychology, > Peking University, > Beijing 100871, P.R.China > -------------- next part -------------- > An embedded and charset-unspecified text was scrubbed... > Name: SpamAssassinReport.txt > URL: From politzerahless at gmail.com Sat Jan 5 12:07:09 2013 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 5 Jan 2013 19:07:09 +0800 Subject: [FieldTrip] When to detrend/demean Message-ID: Hi Vitoria, This is not exactly my area of expertise, but I just wanted to point out that in other speech production ERP research I'm familiar with (such as bereitschaftspotential experiments--e.g. McArdle et al., 2009, in Clinical Neuropsychology), a baseline period somewhere before the onset of motor activity is used. (For instance, that paper used [-3 -2.5] relative to the onset of articulator movement.) However, if you're using ICA, there is an argument that ICA does better when you use the whole epoch as the baseline (or at least use a pretty long baseline) or do no baseline correction at all (David Groppe has a paper on this, Groppe et al. 2009 in NeuroImage); see e.g. http://sccn.ucsd.edu/pipermail/eeglablist/2010/003539.html. Best, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://people.ku.edu/~sjpa/ > Message: 4 > Date: Sat, 05 Jan 2013 11:21:34 +0100 > From: Vit?ria Magalh?es Piai > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] When to detrend/demean > Message-ID: <50E7FEAE.3080103 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a lot, > I thought it would be my best chance to get a good answer: When should > we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials often > include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right next > time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria From inieuwenhuis at berkeley.edu Sun Jan 6 03:24:56 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Sat, 05 Jan 2013 18:24:56 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E7FEAE.3080103@gmail.com> References: <50E7FEAE.3080103@gmail.com> Message-ID: <50E8E078.1030407@berkeley.edu> Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From bertram0611 at pku.edu.cn Sun Jan 6 06:03:47 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Sun, 6 Jan 2013 13:03:47 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAgV2hlbiB0byBkZXRyZW5k?= =?utf-8?q?/demean?= In-Reply-To: <50E8E078.1030407@berkeley.edu> Message-ID: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Hi Ingrid After having seen your explaination, I want to know the relationship between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the linear detrending can reduce a linear trend due to equipment drift over longer time just as you said before. But I think the highpass filter have the same function as detrending. Am I right? If I want to do a time-frequency analysis, must I filter my raw data? I hope you can give me some advice. I have been puzzled for a long time. Thanks! Lin ----- 原始邮件 ----- 发件人: Ingrid Nieuwenhuis 收件人: fieldtrip at science.ru.nl 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) 主题: Re: [FieldTrip] When to detrend/demean Hi Vitoria, The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples detrending removes linear trend (you can also remove higher order trends, just for completeness) For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. Hope this helps somewhat, Ingrid On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > Dear ftrippers, > > I'm having a discussion with a colleague on something that is still a > bit unclear to us. Since I trust the knowledge going around here a > lot, I thought it would be my best chance to get a good answer: When > should we demean/detrend? > > As relevant background, our EEG datasets involve speech production on > every trial. > We read in the data, use ft_databrowser to mark the artefacts and then > do complete artefact rejection with ft_rejectartifact. The trials > often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty simple, > and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > window because I don't want to correct the signal with a specific > interval (and I assume this will take the whole segment then). > Our concern is that, given that people speak during part of the trial > (always towards the end), using demean here is not a good idea (the > signal changes induced by moving the jaws, etc., are included in the > calculation). Is this necessarily the case or can it be fixed with > subsequent computations (see below)? Do I need to go through artefact > rejection again? My guess would be that the damage caused by having > demean here doesn't change that much where the eyeblinks are and I > always take quite broad windows to mark the artefacts, so at least for > the AR I should be safe, but I'd like to check that with you guys. > > Then, when calculating ERPs, I had both demean and detrend before > timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm using the > ft_freqanalysis after the 2011 change (removing the first order linear > trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity checks and > everything is in place (like visual alpha and gamma, etc.)? > > And my last question, for once and for all, so that I get it right > next time from the start (assuming that I'll always have EEG speech > production data with ERPs and TFRs analysed). Is this the best way to > do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From ith at deakin.edu.au Mon Jan 7 04:31:38 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Mon, 7 Jan 2013 03:31:38 +0000 Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: From r.oostenveld at donders.ru.nl Mon Jan 7 09:54:21 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 7 Jan 2013 09:54:21 +0100 Subject: [FieldTrip] fieldtrip website down Message-ID: Dear FieldTrip users First of all a Happy New Year to all of you! The last year has seen a steadily growth in the number of users of FieldTrip and especially in the contributions to this email discussion list. I am really happy to see so many valuable contributions from people all over the world and hope that in 2013 we can further strenghen our community. However, for the server hosting the FieldTrip website the new year did not start that well: last Saturday it was hacked. Over the weekend you may have noticed that you were redirected to an obscure website in Togo. Also some other websites hosted on this server have been compromised. We are working on restoring the server and the FieldTrip website, you can expect it to be up and running again in a few hours. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- From jm.horschig at donders.ru.nl Mon Jan 7 11:49:11 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 07 Jan 2013 11:49:11 +0100 Subject: [FieldTrip] MEG-EMG coherence In-Reply-To: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> References: <7AB2A399CAFFA442A6262BF9939AC33B5BDE8CD003@CMS07.campus.gla.ac.uk> Message-ID: <50EAA827.2030101@donders.ru.nl> Dear Bethel, I don't see any potential reason why to not use the same procedure for MEG-EMG as for EEG-EMG. FieldTrip regards any signal the same, and for most analysis it does not care if it is electrical or magnetical or anything else. Best, Jörn On 12/13/2012 12:39 AM, Bethel Osuagwu wrote: > Dear all, > I am new to FieldTrip. > Is FieldTrip limited to MEG-EMG coherence computation? > I want to use FieldTrip to compute EEG-EMG coherence. The EEG and EMG data was recorded with Biosig. > What procedure do I follow to obtain the coherence. Any help will be highly appreciated. > > Thank you very much > Bethel > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.vandermeij at donders.ru.nl Mon Jan 7 13:28:01 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:28:01 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50E8E078.1030407@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: Hi Vitoria, I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. The FAQs have two great example on this: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. Hope it helps! All the best, Roemer On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < inieuwenhuis at berkeley.edu> wrote: > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different pro > and cons, so depending on your hypotheses and effects, what's good in one > setup can be bad in the next. So you have to think of what the measures do, > and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or indeed > whole trial) from all samples > detrending removes linear trend (you can also remove higher order trends, > just for completeness) > > For ERPs you generally do want to demean using the baseline window, so the > effect cancels out pre-stim. You don't want to detrend here, since often > the ERP can have late components, and the signal might not be back to > baseline yet. If you detrend in such a case, you will decrease the value > samples late in the trials and increase the values during baseline. You > will tilt the data (end down thus start up). But if you expect a linear > trend due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is noisy (high > amplitude noise) at the end (due to speach artifacts), detrending might be > dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, since > subtracting a constant does not change the frequency info in the signal. I > know people do tend to detrend before freq analysis (so I also tend to do > that), but I have to admit, I don't know why really. Maybe to get rid of > the drift, so it does not end up in the low frequencies. But again, the > effect of detrending (which freqs it affects) depends how long your time > window is, and which frequencies your interested in. If you are interested > in really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit >> unclear to us. Since I trust the knowledge going around here a lot, I >> thought it would be my best chance to get a good answer: When should we >> demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on >> every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do >> complete artefact rejection with ft_rejectartifact. The trials often >> include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, >> and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >> window because I don't want to correct the signal with a specific interval >> (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial >> (always towards the end), using demean here is not a good idea (the signal >> changes induced by moving the jaws, etc., are included in the calculation). >> Is this necessarily the case or can it be fixed with subsequent >> computations (see below)? Do I need to go through artefact rejection again? >> My guess would be that the damage caused by having demean here doesn't >> change that much where the eyeblinks are and I always take quite broad >> windows to mark the artefacts, so at least for the AR I should be safe, but >> I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before >> timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the >> ft_freqanalysis after the 2011 change (removing the first order linear >> trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and >> everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next >> time from the start (assuming that I'll always have EEG speech production >> data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.vandermeij at donders.ru.nl Mon Jan 7 13:42:37 2013 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Mon, 7 Jan 2013 13:42:37 +0100 Subject: [FieldTrip] =?gb2312?b?u9i4tKO6IFJlOiBXaGVuIHRvIGRldHJlbmQvZGVt?= =?gb2312?b?ZWFu?= In-Reply-To: <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> References: <50E8E078.1030407@berkeley.edu> <123593681.121.1357448627073.JavaMail.root@bj-mail07.pku.edu.cn> Message-ID: Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitoria.piai at gmail.com Mon Jan 7 14:14:48 2013 From: vitoria.piai at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Magalh=E3es_Piai?=) Date: Mon, 07 Jan 2013 14:14:48 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: Message-ID: <50EACA48.3050509@gmail.com> Thank you Roemer, Ingrid, and Stephen. Let me see if I can summarise it all and do a last check. So for the ERPs, it's better not to detrend, especially if the signal is noisy (high amplitude noise) at the end (due to speach artifacts). I know that using demean with a baseline window is "common sense" but I'm a bit against this in many cases. For example, in my data now, I have a whole semantic context building up towards one final word, which people have to produce overtly. I can expect (intuitively, theoretically, etc.) that anticipation will be going on, inducing changes in the signal. This is relevant cognitive stuff, not noise. Yet, it is in my "baseline period" (i.e., before people get the cue to say something). If I correct against this baseline, I'll not be doing justice to my signal in my opinion. What I did instead was to collect many trials (120 on average). So even without baseline correction, my waves across conditions are lying on top of each other until a certain point before the cue. I take this as an indication that I have a good SNR and if baseline correction is just to ensure that things are the same across conditions pre-stimulus, then it suffices for me if my waves are nicely on top of each other pre-stimulus (but deviating from each other before the onset of the cue). I'd like to hear your opinion on this issue, though, if you think this still is problematic. Indeed, Roemer, I had checked these FAQs before and concluded that my TFRs passed this specific sanity check as well, but thanx for pointing out. The question that still remains is regarding demean in the preprocessing. FT page shows two possibilities. Tutorial: ft_preprocessing default (no detrend/demean). EEG specific: cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 0]; So the baseline correction is in there already at pre-processing. But this seems more specific for a ERP follow-up analysis to me, or isn't it? Having it as in the tutorial would be the most neutral/standard way, right? So maybe I could add a note to the page, if we agree on this. Finally, having a demean using the whole trial instead already at pre-processing does not seem to create effects across conditions in later ERP and TFR analyses (without ICA), I'd conclude from this discussion, but please point out if I'm wrong. Thanx a lot once more, Cheers, Vitoria On 1/7/2013 1:43 PM, fieldtrip-request at science.ru.nl wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: When to detrend/demean (Roemer van der Meij) > 2. Re: ??? Re: When to detrend/demean (Roemer van der Meij) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 7 Jan 2013 13:28:01 +0100 > From: Roemer van der Meij > To: FieldTrip discussion list > Subject: Re: [FieldTrip] When to detrend/demean > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For frequency > analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been > can bleed into all other frequency bins in a funny but patterned way. For > detrending, the same story applies. When not detrending, the power of the > center frequency of the linear trend (this frequency is very low), can > bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why this > is so is explained shortly in the first FAQ), although in principle the > issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis < > inieuwenhuis at berkeley.edu> wrote: > >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in >> (hypothesis) and which methods you're using to analyze the data (ERP or >> frequanalysis, with our without ICA). All analysis steps have different pro >> and cons, so depending on your hypotheses and effects, what's good in one >> setup can be bad in the next. So you have to think of what the measures do, >> and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some >> common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed >> whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, >> just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the >> effect cancels out pre-stim. You don't want to detrend here, since often >> the ERP can have late components, and the signal might not be back to >> baseline yet. If you detrend in such a case, you will decrease the value >> samples late in the trials and increase the values during baseline. You >> will tilt the data (end down thus start up). But if you expect a linear >> trend due to equipment drift over longer time, that can muddle the ERP >> effect, then you might want to detrend. Also when the signal is noisy (high >> amplitude noise) at the end (due to speach artifacts), detrending might be >> dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since >> subtracting a constant does not change the frequency info in the signal. I >> know people do tend to detrend before freq analysis (so I also tend to do >> that), but I have to admit, I don't know why really. Maybe to get rid of >> the drift, so it does not end up in the low frequencies. But again, the >> effect of detrending (which freqs it affects) depends how long your time >> window is, and which frequencies your interested in. If you are interested >> in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vit?ria Magalh?es Piai wrote: >> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that is still a bit >>> unclear to us. Since I trust the knowledge going around here a lot, I >>> thought it would be my best chance to get a good answer: When should we >>> demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech production on >>> every trial. >>> We read in the data, use ft_databrowser to mark the artefacts and then do >>> complete artefact rejection with ft_rejectartifact. The trials often >>> include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is pretty simple, >>> and ft_preprocessing default has no detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline >>> window because I don't want to correct the signal with a specific interval >>> (and I assume this will take the whole segment then). >>> Our concern is that, given that people speak during part of the trial >>> (always towards the end), using demean here is not a good idea (the signal >>> changes induced by moving the jaws, etc., are included in the calculation). >>> Is this necessarily the case or can it be fixed with subsequent >>> computations (see below)? Do I need to go through artefact rejection again? >>> My guess would be that the damage caused by having demean here doesn't >>> change that much where the eyeblinks are and I always take quite broad >>> windows to mark the artefacts, so at least for the AR I should be safe, but >>> I'd like to check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend before >>> timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm using the >>> ft_freqanalysis after the 2011 change (removing the first order linear >>> trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity checks and >>> everything is in place (like visual alpha and gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it right next >>> time from the start (assuming that I'll always have EEG speech production >>> data with ERPs and TFRs analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >>> Vitoria >>> >>> >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > From bertram0611 at pku.edu.cn Mon Jan 7 16:14:16 2013 From: bertram0611 at pku.edu.cn (=?utf-8?B?6JSh5p6X?=) Date: Mon, 7 Jan 2013 23:14:16 +0800 (CST) Subject: [FieldTrip] =?utf-8?b?5Zue5aSN77yaIFJlOiAJ5Zue5aSN77yaIFJlOiBX?= =?utf-8?q?hen_to_detrend/demean?= In-Reply-To: Message-ID: <503107254.817.1357571656960.JavaMail.root@bj-mail07.pku.edu.cn> Hi,Roemer, Thank you very much.I benefited a lot from your explainations. Lin ----- 原始邮件 ----- 发件人: Roemer van der Meij 收件人: FieldTrip discussion list 已发送邮件: Mon, 07 Jan 2013 20:42:37 +0800 (CST) 主题: Re: [FieldTrip] 回复: Re: When to detrend/demean Hi Lin, You are right, up to some extent they are the same. Removing the linear trend can also be achieved by using a high-pass filter. The 'center frequency' of the linear trend depends on the length of the trial, a high-pass filter of a sufficiently high frequency will also remove the linear trend, and everything below it in terms of frequency as well. What 'sufficiently high' is, depends on which type of filter you are using and at which order. A butterworth filter of order 4 and with a cutt-off at (1/trial-length)*2 should in most cases be enough (do note that most filters become very unstable when the cutt-off frequency is too low). On frequency-analysis, please see my reply to Vitoria where I explain a little bit why you should at least demean and detrend your raw-data (the FAQs I link to are more verbose). Other filtering I would suggest is to filter out line-noise. This kind of noise is most common at 50 or 60 Hz depending on which continent you live, but can also occur at other frequencies. A bandstop butterworth filter of order 4 and a bin of 1 Hz surrounding it (e.g 49.5 <-> 50.5) will be fine most of the time. You can also opt not to filter this out and only look at frequencies away from the line-spectra, but keep in mind that the bleeding will always occur at all frequencies. Distance will decrease it, but if the noise is sufficiently strong it will bleed in (whether a channel is any good if it has humongous line-noise is another thing). Hope it helps, Roemer On Sun, Jan 6, 2013 at 6:03 AM, 蔡林 wrote: > Hi Ingrid > > After having seen your explaination, I want to know the relationship > between highpass filter(eg.0.01 or 0.1Hz)and linear detrending. I think the > linear detrending can reduce a linear trend due to equipment drift over > longer time just as you said before. But I think the highpass filter have > the same function as detrending. Am I right? > If I want to do a time-frequency analysis, must I filter my raw data? I > hope you can give me some advice. I have been puzzled for a long time. > Thanks! > > Lin > ----- 原始邮件 ----- > 发件人: Ingrid Nieuwenhuis > 收件人: fieldtrip at science.ru.nl > 已发送邮件: Sun, 06 Jan 2013 10:24:56 +0800 (CST) > 主题: Re: [FieldTrip] When to detrend/demean > > Hi Vitoria, > > The problem with these things is, it depends on what your interested in > (hypothesis) and which methods you're using to analyze the data (ERP or > frequanalysis, with our without ICA). All analysis steps have different > pro and cons, so depending on your hypotheses and effects, what's good > in one setup can be bad in the next. So you have to think of what the > measures do, and how that effects your data. > > But now for some answers :) I'm just using a lot of experience and some > common sense, maybe people can add in some refs and math if they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline window, so > the effect cancels out pre-stim. You don't want to detrend here, since > often the ERP can have late components, and the signal might not be back > to baseline yet. If you detrend in such a case, you will decrease the > value samples late in the trials and increase the values during > baseline. You will tilt the data (end down thus start up). But if you > expect a linear trend due to equipment drift over longer time, that can > muddle the ERP effect, then you might want to detrend. Also when the > signal is noisy (high amplitude noise) at the end (due to speach > artifacts), detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no effect, > since subtracting a constant does not change the frequency info in the > signal. I know people do tend to detrend before freq analysis (so I also > tend to do that), but I have to admit, I don't know why really. Maybe to > get rid of the drift, so it does not end up in the low frequencies. But > again, the effect of detrending (which freqs it affects) depends how > long your time window is, and which frequencies your interested in. If > you are interested in really low frequencies, detrending might change > your effects. > > Hope this helps somewhat, > Ingrid > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > > > I'm having a discussion with a colleague on something that is still a > > bit unclear to us. Since I trust the knowledge going around here a > > lot, I thought it would be my best chance to get a good answer: When > > should we demean/detrend? > > > > As relevant background, our EEG datasets involve speech production on > > every trial. > > We read in the data, use ft_databrowser to mark the artefacts and then > > do complete artefact rejection with ft_rejectartifact. The trials > > often include speech (onset). > > I see in the tutorial that the cfg for preprocessing is pretty simple, > > and ft_preprocessing default has no detrend/demean. > > But in the FT example 'Reading and pre-processing EEG data', the cfg is > > > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 0]; > > > > > > In my data, I used cfg.demean = 'yes'; with no cfg for the baseline > > window because I don't want to correct the signal with a specific > > interval (and I assume this will take the whole segment then). > > Our concern is that, given that people speak during part of the trial > > (always towards the end), using demean here is not a good idea (the > > signal changes induced by moving the jaws, etc., are included in the > > calculation). Is this necessarily the case or can it be fixed with > > subsequent computations (see below)? Do I need to go through artefact > > rejection again? My guess would be that the damage caused by having > > demean here doesn't change that much where the eyeblinks are and I > > always take quite broad windows to mark the artefacts, so at least for > > the AR I should be safe, but I'd like to check that with you guys. > > > > Then, when calculating ERPs, I had both demean and detrend before > > timelocking. > > But for the TFRs, I didn't do any of these (dunno why). I'm using the > > ft_freqanalysis after the 2011 change (removing the first order linear > > trend from the time domain data). > > Do I need to redo my TFRs or is it enough if I do sanity checks and > > everything is in place (like visual alpha and gamma, etc.)? > > > > And my last question, for once and for all, so that I get it right > > next time from the start (assuming that I'll always have EEG speech > > production data with ERPs and TFRs analysed). Is this the best way to > > do it? > > - preprocess with default (so NO detrend and NO demean) > > - then demean and detrend for ft_timelockanalysis and ft_freqanalysis > > > > Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! > > Vitoria > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Lin Cai > Department of Psychology, Peking University, Beijing 100871, P.R.China > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -- Lin Cai Department of Psychology, Peking University, Beijing 100871, P.R.China From sherrykhan78 at gmail.com Mon Jan 7 20:23:09 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Mon, 7 Jan 2013 14:23:09 -0500 Subject: [FieldTrip] MEG/EEG Post-doc position at Martinos Center, MGH/ Harvard Medical School Message-ID: POST DOCTORAL Position available at the Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA: Studying the Neuroscience of Autism Using MEG. Responsibilities: The position will involve investigating sensory processing, functional connectivity, and other processing abnormalities in autism, using MEG. Our current projects use state of the art approaches for data analysis, and include analyses of coherence, local cross-frequency coupling, graph theory methods, and other approaches to mining MEG data. There is a range of possible projects to choose from within these categories, and new approaches and ideas are welcomed. The position requires working closely with other members of the Martinos center (in particular Dr. Matti Hamalainen), as well as with other lab members, to develop, explore, improve and apply various data analysis methodologies. Multiple paradigms are routinely used in the lab, each offering opportunities for different approaches and research directions. The position will also involve running the MEG and MRI sessions. Recruitment of subjects is carried out by other members (research coordinators) in the lab. A minimum commitment of two years is required. Salary will be competitive and commensurate with experience. Ideal start date would be summer or fall of 2013. Requirements: PhD (or prior post-doc experience) in MEG/EEG data analysis/methodology or other signal processing. Background in specific aspects of neuroscience or cognitive science is not required, but is a plus. Contact: Tal Kenet, tal at nmr.mgh.harvard.edu The Massachusetts General Hospital is an Equal Opportunity/Affirmative Action Employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 20:31:59 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 11:31:59 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> Message-ID: <50EB22AF.7040509@berkeley.edu> Hi Roemer, Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) Cheers, Ingrid On 1/7/2013 4:28 AM, Roemer van der Meij wrote: > Hi Vitoria, > > I have only one thing to add to Ingrid's clear explanation. For > frequency analysis, it's mostly a matter of noise. If you do not > demean, the 0Hz been can bleed into all other frequency bins in a > funny but patterned way. For detrending, the same story applies. When > not detrending, the power of the center frequency of the linear trend > (this frequency is very low), can bleed into other bins. > > The FAQs have two great example on this: > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii > > Both are specific for when using 'mtmconvol' as frequency method (why > this is so is explained shortly in the first FAQ), although in > principle the issues could also occur using the other methods. > > Hope it helps! > > All the best, > Roemer > > > > On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis > > wrote: > > Hi Vitoria, > > The problem with these things is, it depends on what your > interested in (hypothesis) and which methods you're using to > analyze the data (ERP or frequanalysis, with our without ICA). All > analysis steps have different pro and cons, so depending on your > hypotheses and effects, what's good in one setup can be bad in the > next. So you have to think of what the measures do, and how that > effects your data. > > But now for some answers :) I'm just using a lot of experience and > some common sense, maybe people can add in some refs and math if > they know :) > Demeaning just subtracts the mean of the specified time window (or > indeed whole trial) from all samples > detrending removes linear trend (you can also remove higher order > trends, just for completeness) > > For ERPs you generally do want to demean using the baseline > window, so the effect cancels out pre-stim. You don't want to > detrend here, since often the ERP can have late components, and > the signal might not be back to baseline yet. If you detrend in > such a case, you will decrease the value samples late in the > trials and increase the values during baseline. You will tilt the > data (end down thus start up). But if you expect a linear trend > due to equipment drift over longer time, that can muddle the ERP > effect, then you might want to detrend. Also when the signal is > noisy (high amplitude noise) at the end (due to speach artifacts), > detrending might be dangerous. > > For frequency analysis, demeaning has (as far as I know) no > effect, since subtracting a constant does not change the frequency > info in the signal. I know people do tend to detrend before freq > analysis (so I also tend to do that), but I have to admit, I don't > know why really. Maybe to get rid of the drift, so it does not end > up in the low frequencies. But again, the effect of detrending > (which freqs it affects) depends how long your time window is, and > which frequencies your interested in. If you are interested in > really low frequencies, detrending might change your effects. > > Hope this helps somewhat, > Ingrid > > > > On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: > > Dear ftrippers, > > I'm having a discussion with a colleague on something that is > still a bit unclear to us. Since I trust the knowledge going > around here a lot, I thought it would be my best chance to get > a good answer: When should we demean/detrend? > > As relevant background, our EEG datasets involve speech > production on every trial. > We read in the data, use ft_databrowser to mark the artefacts > and then do complete artefact rejection with > ft_rejectartifact. The trials often include speech (onset). > I see in the tutorial that the cfg for preprocessing is pretty > simple, and ft_preprocessing default has no detrend/demean. > But in the FT example 'Reading and pre-processing EEG data', > the cfg is > > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 0]; > > > In my data, I used cfg.demean = 'yes'; with no cfg for the > baseline window because I don't want to correct the signal > with a specific interval (and I assume this will take the > whole segment then). > Our concern is that, given that people speak during part of > the trial (always towards the end), using demean here is not a > good idea (the signal changes induced by moving the jaws, > etc., are included in the calculation). Is this necessarily > the case or can it be fixed with subsequent computations (see > below)? Do I need to go through artefact rejection again? My > guess would be that the damage caused by having demean here > doesn't change that much where the eyeblinks are and I always > take quite broad windows to mark the artefacts, so at least > for the AR I should be safe, but I'd like to check that with > you guys. > > Then, when calculating ERPs, I had both demean and detrend > before timelocking. > But for the TFRs, I didn't do any of these (dunno why). I'm > using the ft_freqanalysis after the 2011 change (removing the > first order linear trend from the time domain data). > Do I need to redo my TFRs or is it enough if I do sanity > checks and everything is in place (like visual alpha and > gamma, etc.)? > > And my last question, for once and for all, so that I get it > right next time from the start (assuming that I'll always have > EEG speech production data with ERPs and TFRs analysed). Is > this the best way to do it? > - preprocess with default (so NO detrend and NO demean) > - then demean and detrend for ft_timelockanalysis and > ft_freqanalysis > > Thanx a lot, and (keeping to the Dutch tradition) all the best > for 2013! > Vitoria > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:01:34 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:01:34 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <7454504B-42D8-4703-835D-C631A046015D@donders.ru.nl> Hi Ingrid, Please feel free to update the text in the FAQs ;-). You understand it perfectly so go ahead. Two tiny remarks from 'spuit elf', as we say in Dutch: - removing a polynomial of order 1 also takes out the constant term, so it also demeans. - actually, there is an error in the text of the FAQ, because FT's default behavior is to remove a zero-order polynomial, so it only demeans. If you want detrending, you should either do this in ft_preprocessing, or specify the appropriate option in ft_freqanalysis. Best wishes, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Jan 7 21:07:49 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 7 Jan 2013 21:07:49 +0100 Subject: [FieldTrip] When to detrend/demean In-Reply-To: <50EB22AF.7040509@berkeley.edu> References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: Dear Ingrid and others, I forgot to mention, the default has changed one year ago, according to the following thread on the list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html Apologies for not having updated the FAQ. Ingrid, would you mind giving this a shot? Best, Jan-Mathijs On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > Hi Roemer, > > Thanks for pointing to these questions. I'm a little bit confused about the default behavior with cfg.polyremoval as described there. So it seems the default of polyremoval for ft_freqanalysis is 1, meaning detrending always happens unless you specify otherwise, correct? So that means you don't have to call preprocessing with cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = 'yes' in preprocessing? Or does removing the linear trend (which is the default) in ft_freqanalysis automatically also demean the data? From the text under the figure in http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it almost looks that way. Because it talks about cfg.polyremoval in the context of demeaning, not detrending. I don't find that text very clear by the way. Also, the title above the figure says "TFR before (left) and after (right) subtracting the DC component in the time domain", while when I look at the code it seems it should be "TFR of channel with large DC component (left) and channel without DC component (right) after ft_freqanalysis without demeaning". I'd be happy to update the FAQ, but first wanted to check whether I understand correctly :) > > Cheers, > Ingrid > > > On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >> Hi Vitoria, >> >> I have only one thing to add to Ingrid's clear explanation. For frequency analysis, it's mostly a matter of noise. If you do not demean, the 0Hz been can bleed into all other frequency bins in a funny but patterned way. For detrending, the same story applies. When not detrending, the power of the center frequency of the linear trend (this frequency is very low), can bleed into other bins. >> >> The FAQs have two great example on this: >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >> >> Both are specific for when using 'mtmconvol' as frequency method (why this is so is explained shortly in the first FAQ), although in principle the issues could also occur using the other methods. >> >> Hope it helps! >> >> All the best, >> Roemer >> >> >> >> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis wrote: >> Hi Vitoria, >> >> The problem with these things is, it depends on what your interested in (hypothesis) and which methods you're using to analyze the data (ERP or frequanalysis, with our without ICA). All analysis steps have different pro and cons, so depending on your hypotheses and effects, what's good in one setup can be bad in the next. So you have to think of what the measures do, and how that effects your data. >> >> But now for some answers :) I'm just using a lot of experience and some common sense, maybe people can add in some refs and math if they know :) >> Demeaning just subtracts the mean of the specified time window (or indeed whole trial) from all samples >> detrending removes linear trend (you can also remove higher order trends, just for completeness) >> >> For ERPs you generally do want to demean using the baseline window, so the effect cancels out pre-stim. You don't want to detrend here, since often the ERP can have late components, and the signal might not be back to baseline yet. If you detrend in such a case, you will decrease the value samples late in the trials and increase the values during baseline. You will tilt the data (end down thus start up). But if you expect a linear trend due to equipment drift over longer time, that can muddle the ERP effect, then you might want to detrend. Also when the signal is noisy (high amplitude noise) at the end (due to speach artifacts), detrending might be dangerous. >> >> For frequency analysis, demeaning has (as far as I know) no effect, since subtracting a constant does not change the frequency info in the signal. I know people do tend to detrend before freq analysis (so I also tend to do that), but I have to admit, I don't know why really. Maybe to get rid of the drift, so it does not end up in the low frequencies. But again, the effect of detrending (which freqs it affects) depends how long your time window is, and which frequencies your interested in. If you are interested in really low frequencies, detrending might change your effects. >> >> Hope this helps somewhat, >> Ingrid >> >> >> >> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >> Dear ftrippers, >> >> I'm having a discussion with a colleague on something that is still a bit unclear to us. Since I trust the knowledge going around here a lot, I thought it would be my best chance to get a good answer: When should we demean/detrend? >> >> As relevant background, our EEG datasets involve speech production on every trial. >> We read in the data, use ft_databrowser to mark the artefacts and then do complete artefact rejection with ft_rejectartifact. The trials often include speech (onset). >> I see in the tutorial that the cfg for preprocessing is pretty simple, and ft_preprocessing default has no detrend/demean. >> But in the FT example 'Reading and pre-processing EEG data', the cfg is >> >> cfg.demean = 'yes'; >> cfg.baselinewindow = [-0.2 0]; >> >> >> In my data, I used cfg.demean = 'yes'; with no cfg for the baseline window because I don't want to correct the signal with a specific interval (and I assume this will take the whole segment then). >> Our concern is that, given that people speak during part of the trial (always towards the end), using demean here is not a good idea (the signal changes induced by moving the jaws, etc., are included in the calculation). Is this necessarily the case or can it be fixed with subsequent computations (see below)? Do I need to go through artefact rejection again? My guess would be that the damage caused by having demean here doesn't change that much where the eyeblinks are and I always take quite broad windows to mark the artefacts, so at least for the AR I should be safe, but I'd like to check that with you guys. >> >> Then, when calculating ERPs, I had both demean and detrend before timelocking. >> But for the TFRs, I didn't do any of these (dunno why). I'm using the ft_freqanalysis after the 2011 change (removing the first order linear trend from the time domain data). >> Do I need to redo my TFRs or is it enough if I do sanity checks and everything is in place (like visual alpha and gamma, etc.)? >> >> And my last question, for once and for all, so that I get it right next time from the start (assuming that I'll always have EEG speech production data with ERPs and TFRs analysed). Is this the best way to do it? >> - preprocess with default (so NO detrend and NO demean) >> - then demean and detrend for ft_timelockanalysis and ft_freqanalysis >> >> Thanx a lot, and (keeping to the Dutch tradition) all the best for 2013! >> Vitoria >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Ingrid Nieuwenhuis PhD > Postdoctoral Fellow > Sleep and Neuroimaging Laboratory > Department of Psychology > University of California, Berkeley > California 94720-1650 > Tolman Hall, room 5305 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 7 22:53:19 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 07 Jan 2013 13:53:19 -0800 Subject: [FieldTrip] When to detrend/demean In-Reply-To: References: <50E7FEAE.3080103@gmail.com> <50E8E078.1030407@berkeley.edu> <50EB22AF.7040509@berkeley.edu> Message-ID: <50EB43CF.3040705@berkeley.edu> Thanks JM, all clear now. FAQ updated: Done! Cheers, Ingrid On 1/7/2013 12:07 PM, jan-mathijs schoffelen wrote: > Dear Ingrid and others, > > I forgot to mention, the default has changed one year ago, according > to the following thread on the list: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html > > Apologies for not having updated the FAQ. Ingrid, would you mind > giving this a shot? > > Best, > > Jan-Mathijs > > > > On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote: > >> Hi Roemer, >> >> Thanks for pointing to these questions. I'm a little bit confused >> about the default behavior with cfg.polyremoval as described there. >> So it seems the default of polyremoval for ft_freqanalysis is 1, >> meaning detrending always happens unless you specify otherwise, >> correct? So that means you don't have to call preprocessing with >> cfg.detrend = 'yes', correct? But you do have to specify cfg.demean = >> 'yes' in preprocessing? Or does removing the linear trend (which is >> the default) in ft_freqanalysis automatically also demean the data? >> From the text under the figure in >> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange it >> almost looks that way. Because it talks about cfg.polyremoval in the >> context of demeaning, not detrending. I don't find that text very >> clear by the way. Also, the title above the figure says "TFR before >> (left) and after (right) subtracting the DC component in the time >> domain", while when I look at the code it seems it should be "TFR of >> channel with large DC component (left) and channel without DC >> component (right) after ft_freqanalysis without demeaning". I'd be >> happy to update the FAQ, but first wanted to check whether I >> understand correctly :) >> >> Cheers, >> Ingrid >> >> >> On 1/7/2013 4:28 AM, Roemer van der Meij wrote: >>> Hi Vitoria, >>> >>> I have only one thing to add to Ingrid's clear explanation. For >>> frequency analysis, it's mostly a matter of noise. If you do not >>> demean, the 0Hz been can bleed into all other frequency bins in a >>> funny but patterned way. For detrending, the same story applies. >>> When not detrending, the power of the center frequency of the linear >>> trend (this frequency is very low), can bleed into other bins. >>> >>> The FAQs have two great example on this: >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange >>> http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii >>> >>> Both are specific for when using 'mtmconvol' as frequency method >>> (why this is so is explained shortly in the first FAQ), although in >>> principle the issues could also occur using the other methods. >>> >>> Hope it helps! >>> >>> All the best, >>> Roemer >>> >>> >>> >>> On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis >>> > wrote: >>> >>> Hi Vitoria, >>> >>> The problem with these things is, it depends on what your >>> interested in (hypothesis) and which methods you're using to >>> analyze the data (ERP or frequanalysis, with our without ICA). >>> All analysis steps have different pro and cons, so depending on >>> your hypotheses and effects, what's good in one setup can be bad >>> in the next. So you have to think of what the measures do, and >>> how that effects your data. >>> >>> But now for some answers :) I'm just using a lot of experience >>> and some common sense, maybe people can add in some refs and >>> math if they know :) >>> Demeaning just subtracts the mean of the specified time window >>> (or indeed whole trial) from all samples >>> detrending removes linear trend (you can also remove higher >>> order trends, just for completeness) >>> >>> For ERPs you generally do want to demean using the baseline >>> window, so the effect cancels out pre-stim. You don't want to >>> detrend here, since often the ERP can have late components, and >>> the signal might not be back to baseline yet. If you detrend in >>> such a case, you will decrease the value samples late in the >>> trials and increase the values during baseline. You will tilt >>> the data (end down thus start up). But if you expect a linear >>> trend due to equipment drift over longer time, that can muddle >>> the ERP effect, then you might want to detrend. Also when the >>> signal is noisy (high amplitude noise) at the end (due to speach >>> artifacts), detrending might be dangerous. >>> >>> For frequency analysis, demeaning has (as far as I know) no >>> effect, since subtracting a constant does not change the >>> frequency info in the signal. I know people do tend to detrend >>> before freq analysis (so I also tend to do that), but I have to >>> admit, I don't know why really. Maybe to get rid of the drift, >>> so it does not end up in the low frequencies. But again, the >>> effect of detrending (which freqs it affects) depends how long >>> your time window is, and which frequencies your interested in. >>> If you are interested in really low frequencies, detrending >>> might change your effects. >>> >>> Hope this helps somewhat, >>> Ingrid >>> >>> >>> >>> On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote: >>> >>> Dear ftrippers, >>> >>> I'm having a discussion with a colleague on something that >>> is still a bit unclear to us. Since I trust the knowledge >>> going around here a lot, I thought it would be my best >>> chance to get a good answer: When should we demean/detrend? >>> >>> As relevant background, our EEG datasets involve speech >>> production on every trial. >>> We read in the data, use ft_databrowser to mark the >>> artefacts and then do complete artefact rejection with >>> ft_rejectartifact. The trials often include speech (onset). >>> I see in the tutorial that the cfg for preprocessing is >>> pretty simple, and ft_preprocessing default has no >>> detrend/demean. >>> But in the FT example 'Reading and pre-processing EEG data', >>> the cfg is >>> >>> cfg.demean = 'yes'; >>> cfg.baselinewindow = [-0.2 0]; >>> >>> >>> In my data, I used cfg.demean = 'yes'; with no cfg for the >>> baseline window because I don't want to correct the signal >>> with a specific interval (and I assume this will take the >>> whole segment then). >>> Our concern is that, given that people speak during part of >>> the trial (always towards the end), using demean here is not >>> a good idea (the signal changes induced by moving the jaws, >>> etc., are included in the calculation). Is this necessarily >>> the case or can it be fixed with subsequent computations >>> (see below)? Do I need to go through artefact rejection >>> again? My guess would be that the damage caused by having >>> demean here doesn't change that much where the eyeblinks are >>> and I always take quite broad windows to mark the artefacts, >>> so at least for the AR I should be safe, but I'd like to >>> check that with you guys. >>> >>> Then, when calculating ERPs, I had both demean and detrend >>> before timelocking. >>> But for the TFRs, I didn't do any of these (dunno why). I'm >>> using the ft_freqanalysis after the 2011 change (removing >>> the first order linear trend from the time domain data). >>> Do I need to redo my TFRs or is it enough if I do sanity >>> checks and everything is in place (like visual alpha and >>> gamma, etc.)? >>> >>> And my last question, for once and for all, so that I get it >>> right next time from the start (assuming that I'll always >>> have EEG speech production data with ERPs and TFRs >>> analysed). Is this the best way to do it? >>> - preprocess with default (so NO detrend and NO demean) >>> - then demean and detrend for ft_timelockanalysis and >>> ft_freqanalysis >>> >>> Thanx a lot, and (keeping to the Dutch tradition) all the >>> best for 2013! >>> Vitoria >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- >>> Ingrid Nieuwenhuis PhD >>> Postdoctoral Fellow >>> Sleep and Neuroimaging Laboratory >>> Department of Psychology >>> University of California, Berkeley >>> California 94720-1650 >>> Tolman Hall, room 5305 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Roemer van der Meij M.Sc. >>> PhD Candidate >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3655932 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Ingrid Nieuwenhuis PhD >> Postdoctoral Fellow >> Sleep and Neuroimaging Laboratory >> Department of Psychology >> University of California, Berkeley >> California 94720-1650 >> Tolman Hall, room 5305 >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 -------------- next part -------------- An HTML attachment was scrubbed... URL: From octavian.lie at gmail.com Tue Jan 8 03:46:01 2013 From: octavian.lie at gmail.com (octavian lie) Date: Mon, 7 Jan 2013 20:46:01 -0600 Subject: [FieldTrip] Import Cartool & Brainstorm Message-ID: > > Dear All, > > > > I am new to Fieldtrip, Is there a way to import Cartool .eph files and .els channel files? Also, how about importing Brainstorm files (brainstorm typically exports files in .mat format, regardless of the data type (MRI, sensors, recording, source solutions, etc). Thank you, Octavian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ith at deakin.edu.au Wed Jan 9 01:39:22 2013 From: ith at deakin.edu.au (IMALI THANUJA HETTIARACHCHI) Date: Wed, 9 Jan 2013 00:39:22 +0000 Subject: [FieldTrip] FW: Tutorial EEG data processing for ERP analysis In-Reply-To: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> References: <5A1787011651BC42A4D41856DBC2E0603E05DAD1@mbox-f-3.du.deakin.edu.au> Message-ID: <5A1787011651BC42A4D41856DBC2E0603E05DCB3@mbox-f-3.du.deakin.edu.au> Dear Fieldtrippers, I was not sure whether this email reached everyone as the server has been down for a few days. So I am resending it. Could anyone please give me some suggestions on my queries? Thank you very much! Regards Imali From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of IMALI THANUJA HETTIARACHCHI Sent: Monday, 7 January 2013 2:32 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Tutorial EEG data processing for ERP analysis Dear FieldTrippers, First of all, I Wish all of you a very happy and prosperous 2013! I am trying to use the example data on the Fieldtrip web site for a full analysis (sorce reconstruction/connectivity). The data which I intend to use is from the pre-processing tutorial which is mentioned as acquired by Irina Simirnova. Unfortunately I could not access the FeldTrip site for the last two days and does not remember the exact details of the data set , off the top of my head. As this data set has not been fully analysed in the tutorial, I tried to write a script to process up to the Event related potential(ERP or Visual Evoked potential-VEP) for the two conditions animal and tool visualisation. I have attached the script and the VEP's I obtained for the two conditions. 1. Could I be able to get the channel layout description or a channel location file to present the VEP's on a head plot? 2. Starting around 400ms channels have a big variation in voltage, is this due to some unremoved artefacts of vertical eye movement EOGV ? (because the blue line going down after 400-500ms is for EOGV) 3. Also has this data set been published earlier so that I can refer the paper? Many thanks in advance Kind regards Imali Imali Thanuja Hettiarachchi PhD Candidate Centre for Intelligent Systems research Deakin University, Geelong 3217, Australia. Email: ith at deakin.edu.au www.deakin.edu.au/cisr [Description: Description: Description: cid:1216BE20-1800-4A47-8B9F-E7B9D94831CD at deakin.edu.au] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 29155 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.doc Type: application/msword Size: 37888 bytes Desc: script.doc URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ERPs.jpg Type: image/jpeg Size: 224580 bytes Desc: ERPs.jpg URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From Christos.Papadelis at childrens.harvard.edu Wed Jan 9 16:17:39 2013 From: Christos.Papadelis at childrens.harvard.edu (Papadelis, Christos) Date: Wed, 9 Jan 2013 15:17:39 +0000 Subject: [FieldTrip] Special Issue in FRONTIERS IN HUMAN NEUROSCIENCE Message-ID: <876E0E5B34DB6A4DBD0E65B9091B435010E0933E@CHEXMBX2A.CHBOSTON.ORG> In collaboration with Frontiers in Neurology, we are currently organizing a Research Topic, "Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development", and as host editors we think that your work could make an excellent contribution. The proposed structure of this Research Topic is provided below. Although MEG studies will be the main focus of the research topic, articles concerning studies that use other state-of-the-art neuroimaging methods for examining the normal and abnormal human brain development are also welcome. Host Specialty: Frontiers in Human Neuroscience (Impact Factor: 2.339) Research Topic Title: Magnetoencephalography: an emerging neuroimaging tool for studying normal and abnormal human brain development Topic Editors: Christos Papadelis, Patricia Ellen Grant, Yoshio Okada, Hubert Preissl Description: Research on the human brain development has seen an upturn in the past years mostly due to novel neuroimaging tools that became available to study the anatomy and function of the developing brain. Magnetic Resonance Imaging (MRI) and Diffusion Tensor Imaging (DTI) are beginning to be used more frequently in children to determine the gross anatomy and structural connectivity of their brain. Functional MRI and Near-Infrared Spectroscopy (NIRS) determine the hemodynamics and electroencephalography (EEG) the electrophysiological functions of the developing human brain. Magnetoencephalography (MEG) complements EEG as the only other technique capable of directly measuring the developing brain electrophysiology. Although MEG is still being used relatively rarely in pediatric studies, the recent development in this technology is beginning to demonstrate its utility in both basic and clinical neurosciences. MEG seems to be quite attractive for pediatric use, since it measures the human brain activity in an entirely passive manner without possessing any conceivable risk to the developing tissue. MEG sessions generally require minimal patient preparation, and the recordings are extremely well tolerated from children. Biomagnetic techniques also offer an indirect way to assess the functional brain and heart activity of fetuses in humans in utero by measuring the magnetic field outside the maternal abdomen. Magnetic field produced by the electrical activity in the heart and brain of the fetus is not attenuated by the vernix, a waxy film covering its entire skin. A biomagnetic instrument specifically designed for fetal studies has been developed for this purpose. Fetal MEG studies using such a system have shown that both spontaneous brain activity and evoked cortical activity can be measured from outside the abdomen of pregnant mothers. Fetal MEG may become clinically very useful for implementation and evaluation of intervention programs in at-risk populations. Biomagnetic instruments have also been developed for specifically measuring the brain activity in newborns, infants and older children. MEG studies have shown the usefulness of MEG for localizing active regions in the brain and also for tracking the longitudinal maturation of various sensory systems. Studies of pediatric patients are beginning to show interesting functional pathology in autism spectrum disorder, cerebral palsy, epilepsy and other types of neurological and psychiatric disorders (Down syndrome, traumatic brain injury, Tourette syndrome, hearing deficits, childhood migraine). We propose to compile the state of the art MEG studies focused on pediatric population in both health and disease. Researchers either engaged with human brain development research, clinical applications of MEG with or without EEG, or methodological developments will be invited to submit original research articles, reviews, case reports, or opinion pieces. Articles concerning studies that use other neuroimaging methods for studying the normal and abnormal human brain development are also welcome. We believe a review of the recent studies of human brain development using MEG is quite timely, since we are witnessing advances not only in the instrumentation optimized for the pediatric population, but also in the research based on various types of MEG systems designed for both human fetuses in utero and neonates and older children. Abstract Submission Deadline: Jun 01, 2013 Article Submission Deadline: Oct 01, 2013 For more information about this topic and Frontiers in Human Neuroscience, please visit: http://www.frontiersin.org/Human_Neuroscience/researchtopics/Magnetoencephalography_an_emer/1351 Should you choose to participate, please confirm by sending us a quick email and then your abstract no later than Jun 01, 2013 using the following link: http://www.frontiersin.org/submissioninfo With best regards, CHRISTOS PAPADELIS Instructor of Neurology, Harvard Medical School, Boston Children's Hospital ELLEN GRANT Associate Professor of Radiology, Harvard Medical School, Boston Children's Hospital Founding Director, Fetal-Neonatal Neuroimaging & Developmental Science Center (FNNDSC) YOSHIO OKADA Clinical Professor of Neurology, Harvard Medical School Director, MEG Program, Boston Children's Hospital HUBERT PREISSL Assistant Professor, MEG-Center, University of Tubingen, Germany Research Associate Professor, Department of Obstetrics and Gynecology, University of Arkansas for Medical Sciences, Little Rock, USA From arno at cerco.ups-tlse.fr Thu Jan 10 08:08:05 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:08:05 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> Message-ID: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Hi Dave and Robert, By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) The issue is that the Windows 32 bit version uses read_eep_trg.dll to read triggers and that the 64 bit version uses read_eep_trg.m (programmed by Robert) now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. Just so you know, Arno On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > >> Thanks, Arno, >> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >> >> EEGLAB error in function loadeep() at line 75 >> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >> >> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >> >> Do you have any suggestions? >> -Dave >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>> Dear Dave, >>> >>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>> >>> Hope this helps. >>> Best wishes, >>> >>> Arno >>> >>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>> >>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>> >>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>> >>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>> >>>> Dave Britton >>>> City College of New York >>>> Psychology Dept. >>>> >>>> Here is the error message I get: >>>> >>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>> Invalid MEX-file >>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>> libeep.so.3: cannot open shared object file: No such file or directory >>>> >>>> Error in ft_read_header (line 627) >>>> hdr = read_eep_cnt(filename, 1, 1); >>>> >>>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 08:33:50 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 09:33:50 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: by the way, did anyone decode the .seg file? it has the beginning time of segments but it is in seconds since 1900 or so. thanks, yuval On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 > bit version of the software when importing events (scaling of time was in > second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to *delete read_eep_trg.dll*, which does not bring > much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > > Hi Dave, > > Raquels reply pointed me to the (now fully open source) version of libeep. > Previous versions of the libraries and mex files were hard to compile, but > I have just given it another try and after a few attempts I ended up with > > make distclean > ./configure --enable-matlab --enable-shared=no > make > > which compiled the mex files in a format that did not require the shared > libraries. This is the best way for having them, because then you don't > have to bother with the shared library path. I guess that this would also > work on your 64-bit linux computer. > > It would be nice to have the latest version of the mex files working out > of the box again, so I will file this as bug (see > http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all > three common (win/linux/.osx) platforms and in 32 and 64 bit versions will > take some time though. > > best regards, > Robert > > > On 18 Dec 2012, at 20:18, Dave Britton wrote: > > Thanks, Arno, > > I've installed the ant-eep import files into the EEGLAB plugin directory, > but EEGLAB gives me the same error message as I got with FieldTrip: > > > EEGLAB error in function loadeep() at line 75 > > Invalid MEX-file > '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': > libeep.so.3:cannot open shared object file:No such file or directory > > > The libeep.so.3 file is copied into the same directory as the > read_eep_cnt.mexa64 file. > > > Do you have any suggestions? > > -Dave > > > > On 12/18/2012 12:38 PM, Arnaud Delorme wrote: > > Dear Dave, > > > last time I have checked FileIO (the Fieldtrip data importer) will not > read ANT trigger files by default (it should read the raw data though - > Robert Oostenveld one of the main developer of Fieldtrip was interning at > ANT about 10 years ago and wrote the Matlab import function for them). > > The anteepimport1.09 is a plugin for the EEGLAB software. It can import > events (and then you can save the data in EEGLAB format and reload it in > Fieldtrip). You cannot recompile the ANT project (their source files are > proprietary and not included). > > > Hope this helps. > > Best wishes, > > > Arno > > > On 18 Dec 2012, at 08:59, Dave Britton wrote: > > > I am trying to process EEG data in .cnt files obtained from the ANT > system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have > installed the Linux 64 bit version of FieldTrip. > > > What is required to successfully process ANT eeg .cnt and .trg files? The > libraries that came with the FieldTrip download did not work as it came > from the download, and my investigations led me to what should be the > latest version of the ANT import library. I have downloaded the latest ANT > eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make > install, successfully, but MATLAB cannot find the shared object file it > should generate, even when I link the .so.3 file into the same directory as > the MATLAB m-file and the MATLAB current directory. > > > Initially the system was unable to read the cnt files, which is why I > attempted to reinstall the anteepimort library. Is there more to this > installation than the standard" configure, make, make install" process? Any > clues would be appreciated! > > > Dave Britton > > City College of New York > > Psychology Dept. > > > Here is the error message I get: > > > cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; > > cfg.hdr = ft_read_header(cfg.headerfile); > > Invalid MEX-file > > > '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': > > libeep.so.3: cannot open shared object file: No such file or directory > > > Error in ft_read_header (line 627) > > hdr = read_eep_cnt(filename, 1, 1); > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From arno at cerco.ups-tlse.fr Thu Jan 10 08:42:10 2013 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Wed, 9 Jan 2013 23:42:10 -0800 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: I think the .seg file should not be used (it is internal to the ASA software). Only the .trg file should be used. If you modify the .trg file though (move events), you need to remove the .seg file or ASA will use the .seg file to set the events in its graphic interface. All based on memory so I could be wrong. Arno On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > Hi Dave and Robert, > > By the way, after much research, we figured out there was a bug for the 32 bit version of the software when importing events (scaling of time was in second instead of milliseconds) > The issue is that the Windows 32 bit version uses > > read_eep_trg.dll > > to read triggers and that the 64 bit version uses > > read_eep_trg.m > > (programmed by Robert) > now I would suggest to delete read_eep_trg.dll, which does not bring much speed anyway. > Just so you know, > > Arno > > On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: > >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of libeep. Previous versions of the libraries and mex files were hard to compile, but I have just given it another try and after a few attempts I ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared libraries. This is the best way for having them, because then you don't have to bother with the shared library path. I guess that this would also work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out of the box again, so I will file this as bug (see http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all three common (win/linux/.osx) platforms and in 32 and 64 bit versions will take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >>> Thanks, Arno, >>> I've installed the ant-eep import files into the EEGLAB plugin directory, but EEGLAB gives me the same error message as I got with FieldTrip: >>> >>> EEGLAB error in function loadeep() at line 75 >>> Invalid MEX-file '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': libeep.so.3:cannot open shared object file:No such file or directory >>> >>> The libeep.so.3 file is copied into the same directory as the read_eep_cnt.mexa64 file. >>> >>> Do you have any suggestions? >>> -Dave >>> >>> >>> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >>>> Dear Dave, >>>> >>>> last time I have checked FileIO (the Fieldtrip data importer) will not read ANT trigger files by default (it should read the raw data though - Robert Oostenveld one of the main developer of Fieldtrip was interning at ANT about 10 years ago and wrote the Matlab import function for them). >>>> The anteepimport1.09 is a plugin for the EEGLAB software. It can import events (and then you can save the data in EEGLAB format and reload it in Fieldtrip). You cannot recompile the ANT project (their source files are proprietary and not included). >>>> >>>> Hope this helps. >>>> Best wishes, >>>> >>>> Arno >>>> >>>> On 18 Dec 2012, at 08:59, Dave Britton wrote: >>>> >>>>> I am trying to process EEG data in .cnt files obtained from the ANT system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have installed the Linux 64 bit version of FieldTrip. >>>>> >>>>> What is required to successfully process ANT eeg .cnt and .trg files? The libraries that came with the FieldTrip download did not work as it came from the download, and my investigations led me to what should be the latest version of the ANT import library. I have downloaded the latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make install, successfully, but MATLAB cannot find the shared object file it should generate, even when I link the .so.3 file into the same directory as the MATLAB m-file and the MATLAB current directory. >>>>> >>>>> Initially the system was unable to read the cnt files, which is why I attempted to reinstall the anteepimort library. Is there more to this installation than the standard" configure, make, make install" process? Any clues would be appreciated! >>>>> >>>>> Dave Britton >>>>> City College of New York >>>>> Psychology Dept. >>>>> >>>>> Here is the error message I get: >>>>> >>>>>>> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >>>>>>> cfg.hdr = ft_read_header(cfg.headerfile); >>>>> Invalid MEX-file >>>>> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >>>>> libeep.so.3: cannot open shared object file: No such file or directory >>>>> >>>>> Error in ft_read_header (line 627) >>>>> hdr = read_eep_cnt(filename, 1, 1); >>>>> >>>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuvharpaz at gmail.com Thu Jan 10 09:40:06 2013 From: yuvharpaz at gmail.com (Yuval Harpaz) Date: Thu, 10 Jan 2013 10:40:06 +0200 Subject: [FieldTrip] processing ANT cnt files with FieldTrip In-Reply-To: References: <50D0A0FD.9020805@davebritton.com> <0A69D0D8-967C-4F42-A6BA-99576BA16288@cerco.ups-tlse.fr> <50D0C16D.5060105@davebritton.com> <48744323-FC55-48FA-9122-616CC3029228@cerco.ups-tlse.fr> Message-ID: If you don't use the seg file, how do you know where the data is segmented? it is important when filtering raw data for example, where you have traces which and at certain y value and continue at a very different one the next sample. reading the data with fieldtrip currently doesn't let you know where the data is segmented which can sometime develop into a serious headache. If anyone have overcome this issue before please share with us. On 10 January 2013 09:42, Arnaud Delorme wrote: > I think the .seg file should not be used (it is internal to the ASA > software). > Only the .trg file should be used. > If you modify the .trg file though (move events), you need to remove the > .seg file or ASA will use the .seg file to set the events in its graphic > interface. > All based on memory so I could be wrong. > > Arno > > On 9 Jan 2013, at 23:33, Yuval Harpaz wrote: > > by the way, did anyone decode the .seg file? > it has the beginning time of segments but it is in seconds since 1900 or > so. > thanks, yuval > > On 10 January 2013 09:08, Arnaud Delorme wrote: > >> Hi Dave and Robert, >> >> By the way, after much research, we figured out there was a bug for the >> 32 bit version of the software when importing events (scaling of time was >> in second instead of milliseconds) >> The issue is that the Windows 32 bit version uses >> >> read_eep_trg.dll >> >> to read triggers and that the 64 bit version uses >> >> read_eep_trg.m >> >> (programmed by Robert) >> now I would suggest to *delete read_eep_trg.dll*, which does not bring >> much speed anyway. >> Just so you know, >> >> Arno >> >> On 21 Dec 2012, at 23:22, Robert Oostenveld wrote: >> >> Hi Dave, >> >> Raquels reply pointed me to the (now fully open source) version of >> libeep. Previous versions of the libraries and mex files were hard to >> compile, but I have just given it another try and after a few attempts I >> ended up with >> >> make distclean >> ./configure --enable-matlab --enable-shared=no >> make >> >> which compiled the mex files in a format that did not require the shared >> libraries. This is the best way for having them, because then you don't >> have to bother with the shared library path. I guess that this would also >> work on your 64-bit linux computer. >> >> It would be nice to have the latest version of the mex files working out >> of the box again, so I will file this as bug (see >> http://bugzilla.fcdonders.nl/show_bug.cgi?id=1913). Getting it on all >> three common (win/linux/.osx) platforms and in 32 and 64 bit versions will >> take some time though. >> >> best regards, >> Robert >> >> >> On 18 Dec 2012, at 20:18, Dave Britton wrote: >> >> Thanks, Arno, >> >> I've installed the ant-eep import files into the EEGLAB plugin directory, >> but EEGLAB gives me the same error message as I got with FieldTrip: >> >> >> EEGLAB error in function loadeep() at line 75 >> >> Invalid MEX-file >> '/home/dave/eeglab11_0_4_3b/plugins/anteeimport1.08/read_eep_cnt.mexa64': >> libeep.so.3:cannot open shared object file:No such file or directory >> >> >> The libeep.so.3 file is copied into the same directory as the >> read_eep_cnt.mexa64 file. >> >> >> Do you have any suggestions? >> >> -Dave >> >> >> >> On 12/18/2012 12:38 PM, Arnaud Delorme wrote: >> >> Dear Dave, >> >> >> last time I have checked FileIO (the Fieldtrip data importer) will not >> read ANT trigger files by default (it should read the raw data though - >> Robert Oostenveld one of the main developer of Fieldtrip was interning at >> ANT about 10 years ago and wrote the Matlab import function for them). >> >> The anteepimport1.09 is a plugin for the EEGLAB software. It can import >> events (and then you can save the data in EEGLAB format and reload it in >> Fieldtrip). You cannot recompile the ANT project (their source files are >> proprietary and not included). >> >> >> Hope this helps. >> >> Best wishes, >> >> >> Arno >> >> >> On 18 Dec 2012, at 08:59, Dave Britton wrote: >> >> >> I am trying to process EEG data in .cnt files obtained from the ANT >> system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have >> installed the Linux 64 bit version of FieldTrip. >> >> >> What is required to successfully process ANT eeg .cnt and .trg files? The >> libraries that came with the FieldTrip download did not work as it came >> from the download, and my investigations led me to what should be the >> latest version of the ANT import library. I have downloaded the latest ANT >> eep library, anteepimport1.09/libeep-3.3.167, and run config, make and make >> install, successfully, but MATLAB cannot find the shared object file it >> should generate, even when I link the .so.3 file into the same directory as >> the MATLAB m-file and the MATLAB current directory. >> >> >> Initially the system was unable to read the cnt files, which is why I >> attempted to reinstall the anteepimort library. Is there more to this >> installation than the standard" configure, make, make install" process? Any >> clues would be appreciated! >> >> >> Dave Britton >> >> City College of New York >> >> Psychology Dept. >> >> >> Here is the error message I get: >> >> >> cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt'; >> >> cfg.hdr = ft_read_header(cfg.headerfile); >> >> Invalid MEX-file >> >> >> '/home/dave/fieldtrip-20121102/anteepimport1.09/libeep-3.3.167/mex/matlab/read_eep_cnt.mexa64': >> >> libeep.so.3: cannot open shared object file: No such file or directory >> >> >> Error in ft_read_header (line 627) >> >> hdr = read_eep_cnt(filename, 1, 1); >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Yuval > > > > > Dr .Harpaz > > BIU MEG lab > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Yuval Dr .Harpaz BIU MEG lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdnewman at indiana.edu Thu Jan 10 15:23:43 2013 From: sdnewman at indiana.edu (sdnewman at indiana.edu) Date: Thu, 10 Jan 2013 09:23:43 -0500 Subject: [FieldTrip] matlab crashes Message-ID: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Hello fieldtrippers, I am trying again to read in data. I'm using a linux machine with Matlab 2009 installed and I have downloaded fieldtrip-20130107. Whenever I try to do anything matlab crashes and complains that an error was detected while a mex-file was running. I checked the frequently asked questions and I can't find the *.c files suggested to recompile. Please help me. Sharlene From polomacnenad at gmail.com Thu Jan 10 19:56:07 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Thu, 10 Jan 2013 19:56:07 +0100 Subject: [FieldTrip] induced activity Message-ID: Hi, I would like to calculate induced time frequency activity for my MEG data. I plan to do it as follows. First I calculate total time-frequency for every single trial. Second, I calculate evoked activity with ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from every trial total activity. And finally I average these differences. I believe this is correct way... My problem is how to subtract evoked.powspctrm(3-D matrix) from total.powspctrm(4-D matrix). Thank you in advance! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From sherrykhan78 at gmail.com Thu Jan 10 20:59:02 2013 From: sherrykhan78 at gmail.com (Sheraz Khan) Date: Thu, 10 Jan 2013 14:59:02 -0500 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: Dear Nenad please use repmat evoked.powspctrm(3-D matrix) to match dimension of epochs in total.powspctrm(4-D matrix). Some thing like this TF_mean=repmat(evoked.powspctrm,[ 1 1 1 nEpochs]); TF_mean=permute(TF_mean,[4 1 2 3]); TF_induced=total.powspctrm-TF_mean; Induced=(squeeze(mean(abs(TF_induced)))); *This will only work if you have complex TF matrices* Sheraz Martinos Center Induced=(squeeze(mean(abs(TF_induced)))); On Thu, Jan 10, 2013 at 1:56 PM, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG data. > I plan to do it as follows. First I calculate total time-frequency for > every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity from > every trial total activity. And finally I average these differences. I > believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Thu Jan 10 21:22:51 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Thu, 10 Jan 2013 23:22:51 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi I have a question on EEG preprocessing. The sampling rate of my 64 channel EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz.My question is, i it advisable to low-pass filter the data first (70 Hz) and then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing effect or should I down-sample first and then band-pass filter the data (0.5-70 Hz) ? Or does the sequence really matter ?I am new to EEG data analysis so this question might be really basic, but any help is highly appreciated! ThanksSubbu -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 10 22:39:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 10 Jan 2013 22:39:45 +0100 Subject: [FieldTrip] induced activity In-Reply-To: References: Message-ID: <50EF3521.20003@uni-leipzig.de> On 10/01/2013 19:56, Nenad Polomac wrote: > Hi, > > I would like to calculate induced time frequency activity for my MEG > data. I plan to do it as follows. First I calculate total time-frequency > for every single trial. Second, I calculate evoked activity with > ft_freqanalysis for the averaged ERF. Then I subtract evoked activity > from every trial total activity. And finally I average these > differences. I believe this is correct way... > > My problem is how to subtract evoked.powspctrm(3-D matrix) from > total.powspctrm(4-D matrix). > > Thank you in advance! > > Nenad > Hi Nenad, Another common approach is to first compute the ERP/ERF and then subtract it from each trial before performing the time-frequency transformations. This seems to be the more common approach I see in the literature, at least in a lot of EEG gamma band studies. Personally, I've found that doing the subtraction in the frequency domain (i.e. subtracting the power spectrum of the evoked activity from each trial) can give some odd looking results. There tends not to be a whole lot of difference between total and induced (ERP-subtracted) in my experience, so I stick with total rather than worry about subtracting something *into* the data. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From david.m.groppe at gmail.com Fri Jan 11 04:36:44 2013 From: david.m.groppe at gmail.com (David Groppe) Date: Thu, 10 Jan 2013 22:36:44 -0500 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: You need to low-pass filter the data before downsaple to avoid aliasing. The matlab function decimate.m can do this for you. cheers, -David On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: > Hi > > I have a question on EEG preprocessing. The sampling rate of my 64 channel > EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. > My question is, i it advisable to low-pass filter the data first (70 Hz) and > then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing > effect or should I down-sample first and then band-pass filter the data > (0.5-70 Hz) ? Or does the sequence really matter ? > I am new to EEG data analysis so this question might be really basic, but > any help is highly appreciated! > > Thanks > Subbu > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- David Groppe, Ph.D. Postdoctoral Researcher North Shore LIJ Health System New Hyde Park, New York http://www.cogsci.ucsd.edu/~dgroppe/ From jm.horschig at donders.ru.nl Fri Jan 11 08:37:23 2013 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 11 Jan 2013 08:37:23 +0100 Subject: [FieldTrip] matlab crashes In-Reply-To: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> References: <20130110092343.uewgtwn9pkok8k8w@webmail.iu.edu> Message-ID: <50EFC133.2000206@donders.ru.nl> Dear Sharlene, I'd first try to download FieldTrip again to verify that it's not just some corrupt file. Most of the source code is in the src/ subfolder, maybe have a look there again. If the source code is not in FieldTrip, then the mex file must be in some external toolbox that we cannot take care of. In any case, if the error persists after downloading FT again, it might be wise to tell us precisely what kind of data you want to read it (otherwise we don't know what file you are talking about). Best, Jörn On 1/10/2013 3:23 PM, sdnewman at indiana.edu wrote: > Hello fieldtrippers, > > I am trying again to read in data. I'm using a linux machine with > Matlab 2009 installed and I have downloaded fieldtrip-20130107. > Whenever I try to do anything matlab crashes and complains that an > error was detected while a mex-file was running. I checked the > frequently asked questions and I can't find the *.c files suggested to > recompile. Please help me. > > Sharlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Jan 11 09:37:35 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 11 Jan 2013 09:37:35 +0100 Subject: [FieldTrip] EEG preprocessing In-Reply-To: References: Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298@donders.ru.nl> Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > David Groppe, Ph.D. > Postdoctoral Researcher > North Shore LIJ Health System > New Hyde Park, New York > http://www.cogsci.ucsd.edu/~dgroppe/ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eeguser at hotmail.com Fri Jan 11 12:35:32 2013 From: eeguser at hotmail.com (Narayan Iyer) Date: Fri, 11 Jan 2013 14:35:32 +0300 Subject: [FieldTrip] EEG preprocessing Message-ID: Hi Jan-Mathijs and David Thanks for the reply. I will low-pass filter first and the do the down-sampling.Thanks again! Date: Fri, 11 Jan 2013 09:37:35 +0100 From: jan-mathijs schoffelen To: FieldTrip discussion list Subject: Re: [FieldTrip] EEG preprocessing Message-ID: <7A5272B6-AC68-44A3-8003-C5AB3F4F4298 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Subbu, To follow up on David's reply: when you use the ft_resampledata function, the data is also automatically low-passfiltered to avoid aliasing. Highpass filtering is not necessary to avoid aliasing, but in general helps to make the data better behaved at the edges, which avoids ringing of the low-pass filter. Best, Jan-Mathijs On Jan 11, 2013, at 4:36 AM, David Groppe wrote: > You need to low-pass filter the data before downsaple to avoid aliasing. > The matlab function decimate.m can do this for you. > cheers, > -David > > On Thu, Jan 10, 2013 at 3:22 PM, Narayan Iyer wrote: >> Hi >> >> I have a question on EEG preprocessing. The sampling rate of my 64 channel >> EEG data is 500 Hz and I would like to down-sample this to 256 Hz or 128 Hz. >> My question is, i it advisable to low-pass filter the data first (70 Hz) and >> then down-sample followed by high-pass filter (0.5 Hz) to avoid aliasing >> effect or should I down-sample first and then band-pass filter the data >> (0.5-70 Hz) ? Or does the sequence really matter ? >> I am new to EEG data analysis so this question might be really basic, but >> any help is highly appreciated! >> >> Thanks >> Subbu >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.curado at yahoo.com.br Fri Jan 11 14:00:14 2013 From: marco.curado at yahoo.com.br (Marco Curado) Date: Fri, 11 Jan 2013 05:00:14 -0800 (PST) Subject: [FieldTrip] MNI grid alignment in subjects for group comparison Message-ID: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Dear Fieldtrip experts, I have a question on MNI aligned grids for subjects head prior to source reconstruction. In my experimental design, there are three experimental conditions (A, B and C) I want to compare in one group of subjects at the source level. To be able to compare source activity (by LCMV beamforming) among them, I use the MNI grid warped in every subject's head (to allow comparison at the source level) as stated in the tutorial "Create MNI-aligned grids in individual head-space": http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Up to now, everything is ok. But as I am naive in beamforming, I am a bit confused on the last sentence of this tutorial, where it is stated: "You can use these single subjects' MNI grids in source analysis. After that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the template_grid onto the subjects's source, which is thereby in MNI coordinates." My question (indeed very basic) is what is exactly referred as the subject's source? Is it the final source localization after LCMV? I.e., do I need to insert such template_grid parameters in subject's parameter as last step after all source localization? Summing up: The procedure would be to use the .grid from the subject (already warped with MNI grid) for source localization with LCMV and after it I include these parameters from the template-grid? Thanks a lot for your comprehension and attention to my question - I hope I was clear in my issue. My best wishes of an excellent year to everybody, Marco Curado -------------- next part -------------- An HTML attachment was scrubbed... URL: From polomacnenad at gmail.com Fri Jan 11 14:21:02 2013 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 11 Jan 2013 14:21:02 +0100 Subject: [FieldTrip] induced activity Message-ID: Dear Sheraz and Matt, Thank you for your answers! I think I will use Matt's suggestion. The only thing I would like to know is when you subtract ERF from single trial, do you use baseline corrected ERF or not? All the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at donders.ru.nl Fri Jan 11 17:50:32 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Fri, 11 Jan 2013 17:50:32 +0100 Subject: [FieldTrip] MNI grid alignment in subjects for group comparison In-Reply-To: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> References: <1357909214.66017.YahooMailClassic@web126003.mail.ne1.yahoo.com> Message-ID: Dear Marco, I agree that sentence is not phrased ideally. It is refering to the source data structure, i.e. the output of ft_sourceanalysis. Specifically, copy the template_grid.pos to source.pos and then this updated source data structure can be used in ft_sourcegrandaverage. Likewise,it can be overlaid on the MNI brain. I'm not sure if the other fields are necessary, if they are, maybe someone else can comment. Best, Johanna 2013/1/11 Marco Curado > Dear Fieldtrip experts, > > I have a question on MNI aligned grids for subjects head prior to source > reconstruction. > > In my experimental design, there are three experimental conditions (A, B > and C) I want to compare in one group of subjects at the source level. To > be able to compare source activity (by LCMV beamforming) among them, I use > the MNI grid warped in every subject's head (to allow comparison at the > source level) as stated in the tutorial "Create MNI-aligned grids in > individual head-space": > > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Up to now, everything is ok. But as I am naive in beamforming, I am a bit > confused on the last sentence of this tutorial, where it is stated: > > "You can use these single subjects' MNI grids in source analysis. After > that you should put .pos, .xgrid, .ygrid, .zgrid, .dim field from the > template_grid onto the subjects's source, which is thereby in MNI > coordinates." > > My question (indeed very basic) is what is exactly referred as the > subject's source? Is it the final source localization after LCMV? I.e., do > I need to insert such template_grid parameters in subject's parameter as > last step after all source localization? > Summing up: The procedure would be to use the .grid from the subject > (already warped with MNI grid) for source localization with LCMV and after > it I include these parameters from the template-grid? > > Thanks a lot for your comprehension and attention to my question - I hope > I was clear in my issue. > My best wishes of an excellent year to everybody, > Marco Curado > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Sat Jan 12 01:22:03 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 11 Jan 2013 18:22:03 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity Message-ID: Dear fieldtrip experts, I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. thanks Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Jan 14 21:14:23 2013 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 14 Jan 2013 20:14:23 +0000 Subject: [FieldTrip] Electrode location structure Message-ID: Dear FieldTrip users, I would like to define the positions of the EEG electrodes myself. I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. I’m trying to use the ft_prepare_layout() function. Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. Many thanks, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From narayan.ps at tut.fi Mon Jan 14 21:43:26 2013 From: narayan.ps at tut.fi (Narayan P Subramaniyam) Date: Mon, 14 Jan 2013 22:43:26 +0200 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <50F46DEE.6010802@tut.fi> On 14/01/2013 22:14, Emma Holmes wrote: > > Dear FieldTrip users, > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. > > I'm trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > > Here, I'm referring to the part of the documentation 'cfg.elec: > structure with electrode positions', but can't seem to find any > explanation of what the layout of this structure should be. > > Many thanks, > > Emma > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Hello First create a structure called elec with two fields in int elec.pnt -> N x 3 matrix -> electrode positions elec.label - > 1 x N cell -> electrode label Then you can write the following script cfg = [] cfg.elec = elec; lay = ft_prepare_layout(cfg, data); where data is as provided by ft_preprocessing etc Hope this works. -- With Best Regards, Narayan P Subramaniyam, M.Sc. Researcher/PhD student Department of Electronics and Communications Engineering Tampere University of Technology Finn-Medi 1, 4th Floor, Room 203 Biokatu 6, FI-33520 Tampere, Finland Tel: +358 (0)40 198 1951 E-mail: narayan.ps at tut.fi -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Jan 14 21:47:26 2013 From: a.stolk at fcdonders.ru.nl (Stolk, A.) Date: Mon, 14 Jan 2013 21:47:26 +0100 (CET) Subject: [FieldTrip] Electrode location structure In-Reply-To: Message-ID: <1557461731.474785.1358196446162.JavaMail.root@sculptor.zimbra.ru.nl> Dear Emma, FieldTrip is moving towards layouts that are based on an image  (for reference) and that are stored in a .mat file . For some examples, see: http://fieldtrip.fcdonders.nl/template/layout The layout structure stored in those .mat files contains fields that describe the position (.pos), the width (.width), and the height (.height), and the naming (.label) of the electrodes. Furthermore, it contains fields that describe the topographic interpolation boundaries (.mask) and the outlines of the 'head' (.outline). Previous, and still supported, layout files (with a  .lay extension) typically contain a data matrix consisting of 5 columns. The first two columns describe the position of each electrode whereas the third, fourth, and fifth column describe the width, height, and label (i.e. number/name) for each electrode respectively. If you have a bitmap image, I'd recommend to create a layout variable and to store it in a .mat file. Try using  the following commands:   cfg.img = '*.bmp'  lay = ft_prepare_layout(cfg, []) Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Emma Holmes" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 14 januari 2013 21:14:23 > Onderwerp: [FieldTrip] Electrode location structure > Dear FieldTrip users, >   > I would like to define the positions of the EEG electrodes myself. > I have a structure containing the x,y,z co-ordinates and channel names > for 66 channels. However, I am having trouble converting this to a > FieldTrip structure. >   > I’m trying to use the ft_prepare_layout() function. > Can anyone tell me what format the input structure should be in? i.e. > what fields it should contain. > Here, I’m referring to the part of the documentation ‘cfg.elec:  > structure with electrode positions’, but can’t seem to find any > explanation of what the layout of this structure should be. >   > Many thanks, > Emma > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From inieuwenhuis at berkeley.edu Mon Jan 14 22:46:21 2013 From: inieuwenhuis at berkeley.edu (Ingrid Nieuwenhuis) Date: Mon, 14 Jan 2013 13:46:21 -0800 Subject: [FieldTrip] normalizing EEG power Message-ID: <50F47CAD.7010803@berkeley.edu> Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 From pgoodin at swin.edu.au Tue Jan 15 06:00:28 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Tue, 15 Jan 2013 05:00:28 +0000 Subject: [FieldTrip] Running sensor space stats then source? Message-ID: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Jan 15 09:36:19 2013 From: f.roux at bcbl.eu (Frederic Roux) Date: Tue, 15 Jan 2013 09:36:19 +0100 (CET) Subject: [FieldTrip] normalizing EEG power In-Reply-To: <50F47CAD.7010803@berkeley.edu> Message-ID: <1e9ab1ac-1a4d-4a6d-ab2b-f34a03bee311@thalamus_p> Hi Ingrid, if the shapes of your power spectra look qualitatively similar and are simply shifted up or down, you could normalize the power on a frequency by frequenyc basis by computing z-scores for each individual within their respective gender according to: z(i,f) = (x(i,f) - x_males(f))./sd_males(f); % for males z(i,f) = (x(i,f) - x_females(f))./sd_females(f); % for females with x(i,f) being the individual power spectrum, x_males(f) and x_females(f) being the group mean power spectra for males and females, and sd_males(f) and sd_females(f) being the standard deviations of the power spectra for each group. At least this should help to get rid of gender specific differences and you wouldn't have to normalize your values using total power etc. Best, Fred ----- Original Message ----- From: "Ingrid Nieuwenhuis" To: "FieldTrip discussion list" Sent: Monday, January 14, 2013 10:46:21 PM Subject: [FieldTrip] normalizing EEG power Hi all, This is more a data analysis question than FieldTrip question, but I hope I may still pick your brains for this: Does anyone know of a good method to normalize EEG power? In general, EEG power is higher in female than male participants (probably due to gender differences in skull thickness or other non-brain-physiology related gender differences). When correlating EEG power to some behavioral measure for instance, this can interfere. I know that people often calculate relative power in these cases - dividing the power in each frequency band by the total power -, but there are some obvious problems with this measure: Total power both contains power due to unspecific (and for instance gender specific) contributions, but also power due to the very brain activity of interest. This brain activity of interest can be very different depending on the current cognitive state. Thus dividing by total power can result in: 1) 'mixing' in band specific brain results to all other bands 2) not getting rid of the unspecific (for instance gender related) power differences In my data both 1 & 2 happen. The topo plots of the relative power look horrible, some brain related power gets totally divided out (all becomes quite uninterpretable), and still the female participants have more power than the male in most bands. I also tried normalizing by using only the power in higher frequencies (45 - 57Hz), with the underlying idea that in these high frequencies power is more due to unspecific noise and less to brain (so I divided by power in 45 - 57Hz instead of total power). Now my topoplots look much better (very much like the absolute power), while the non specific gender related power difference is decreased. However not totally gone yet. Also, this approach is tricky when subjects have high muscle tone / muscle artifacts, because this high band does contain muscle related power. So what I need is to get an reliable and stable estimate of the non brain dependent power, and use that to normalize the power spectrum by. Something I thought of was: getting rid of the power at frequencies where there is a clear peak on top of the 1/f (in the spectrum), then spline interpolate those frequencies back in, and use that as total power? Anyone know of such an approach being used by anyone? Makes sense? Maybe fitting the 1/f in some way (possibly after removing peaks at specific freqs first). And which frequencies should be used for total power? Include the lowest frequencies? The lowest possible frequency contributes most to total power (due to 1/f drop off), but is also estimated least well (due to having least amount of cycles). Does it make sense to leave those low frequencies out? I also prefer to do this on the whole (cleaned) data, to get a reliable estimate, and then use the same value to normalize all data (so just scale subjects differently in respect to each other). Because that's another problem of normalizing by total power, the total power changes, so you always divide by a different value. I'm working on sleep data, and the powerspec changes a lot depending on sleep stage. Using one value for all data is valid under the assumption that this gender difference in power is stable over time, which I would assume it is. I could for instance use the wake data to estimate the total power, and normalize all sleep data by it? Probably someone is going to suggest to go to source space: But I was wondering if this would even help, because normally one does not have different forward models for male and female participants, right? Also this is a lot of work, I'd rather not... But is people have used this and it worked without side effects, I'd love to hear the details! So in summary: 1) are there other ways to normalize power except for using relative power (dividing by total power)? 2) Is it valid (and wise) to leave out the power of the lowest freqs for the total power? 3) Is it valid to use high freqs instead of total power? 4) is it valid to estimate high freq power (of total power) over all data (or even other data in same run), and use that to normalize all data with (so always divide by same value)? 5) refs or FT code welcome! Thanks!! Ingrid -- Ingrid Nieuwenhuis PhD Postdoctoral Fellow Sleep and Neuroimaging Laboratory Department of Psychology University of California, Berkeley California 94720-1650 Tolman Hall, room 5305 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.oostenveld at donders.ru.nl Wed Jan 16 09:40:55 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 16 Jan 2013 09:40:55 +0100 Subject: [FieldTrip] Electrode location structure In-Reply-To: References: Message-ID: <61157CED-8EDB-48A4-881A-ABD1F414CB53@donders.ru.nl> Hi Emma Narayan and Arjen already pointed you in the appropriate direction. Just to clarify their emails, FieldTrip uses a layout structure for 2-D plotting of data, and the electrode structure for a 3-D representation. The electrode structure can be converted to a 2-D layout, but can also be used for source reconstruction, for which the layout is useless. Please see http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described and pointers to other documentation therein. Also these new pages http://fieldtrip.fcdonders.nl/template/electrode http://fieldtrip.fcdonders.nl/template/layout might help. best Robert On 14 Jan 2013, at 21:14, Emma Holmes wrote: > Dear FieldTrip users, > > > I would like to define the positions of the EEG electrodes myself. > > I have a structure containing the x,y,z co-ordinates and channel names for 66 channels. However, I am having trouble converting this to a FieldTrip structure. > > > I’m trying to use the ft_prepare_layout() function. > > Can anyone tell me what format the input structure should be in? i.e. what fields it should contain. > > Here, I’m referring to the part of the documentation ‘cfg.elec: structure with electrode positions’, but can’t seem to find any explanation of what the layout of this structure should be. > > > Many thanks, > > Emma > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sangita.dandekar at gmail.com Wed Jan 16 22:06:44 2013 From: sangita.dandekar at gmail.com (Sangita Dandekar) Date: Wed, 16 Jan 2013 16:06:44 -0500 Subject: [FieldTrip] defining phase and axial to planar conversion Message-ID: Hi fieldtrippers, I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? My current procedure: 1. Apply megplanar to get the dH and dV components 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately Is there a better way to do this? If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? Thanks in advance for any help! Sangita -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Thu Jan 17 11:11:42 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Thu, 17 Jan 2013 11:11:42 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 05:20:02 2013 From: dave at davebritton.com (Dave Britton) Date: Thu, 17 Jan 2013 23:20:02 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing Message-ID: <50F8CD72.80507@davebritton.com> What is the structure required for the 'data' argument to "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? I am not getting meaningful results from passing the output of [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that appears in the resulting figure is the names of the channels, with no graphs of trial epochs appearing below them as it should be. What ft_preprocessing returns is: data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} fsample: NaN cfg: [1x1 struct] sampleinfo: [132x2 double] where I have 128 electrodes and 132 trials of 238 samples each. When this is passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels of the 128 electrodes, but there is no graph under each label showing the EEG data. What I am passing into ft_preprocessing may be incorrectly structured, I suspect. This is data = label: {128x1 cell} time: {132x1 cell} trial: {132x1 cell} (specifically, why are these all cells instead of arrays? What is the structure of data.time, and of data.trial?) where label is the cell array of strings of electrode names, time is a cell array of the 132 trials' starting times in the .cnt EEG data file, and trial is a cell array containing the 132 cell arrays of the corresponding {128 x 283} EEG samples. Where am I going wrong? What does ft_rejectvisual(data) expect to have as the structure for "data"? -Dave From jan.schoffelen at donders.ru.nl Fri Jan 18 07:55:17 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 07:55:17 +0100 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Hi Jun, If you want to test whether within a subject the PLV across conditions is significantly different (in some statistical sense), you would either do a statistical test along the lines described in "Nonparametric statistical testing of coherence differences, E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 (1), 161-175" or "Comparing spectra and coherences for groups of unequal size, H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of neuroscience methods 159 (2), 337-345". This functionality is not supported in ft_connectivityanalysis. For the former way of statistical testing, you should use ft_freqstatistics, in combination with an adjusted version of statfun_indepsamplesZcoh in order for it to compute differential PLV, rather than Z-transformed coherence difference. Alternatively, you could ask ft_connectivity to compute a jackknife estimate of the variance of the PLV, which could be used in a traditional t-test. Best, Jan-Mathijs On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > Dear fieldtrip experts, > I have a question regarding to test the plv output from ft_connectivityanalysis. How can I check the significance with a statistical test based on surrogate data. the plv output didn't have the magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Jan 18 09:46:24 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 18 Jan 2013 09:46:24 +0100 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: <50F8CD72.80507@davebritton.com> References: <50F8CD72.80507@davebritton.com> Message-ID: Dear Dave, You are correct in assuming that label, time, and trial are the three minimally required fields for a FT-style raw data structure. Label is a cell array, because channel names can have varying lengths. Time and trial are cell arrays, because also trials can have variable lengths. Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. For more details, you might want to have a look at http://fieldtrip.fcdonders.nl/faq/how_are_the_various_data_structures_defined . Hope this helps! Best, Eelke On 18 January 2013 05:20, Dave Britton wrote: > What is the structure required for the 'data' argument to > "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "? > I am not getting meaningful results from passing the output of > [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that > appears in the resulting figure is the names of the channels, with no graphs > of trial epochs appearing below them as it should be. > > What ft_preprocessing returns is: > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > fsample: NaN > cfg: [1x1 struct] > sampleinfo: [132x2 double] > > where I have 128 electrodes and 132 trials of 238 samples each. When this is > passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels > of the 128 electrodes, but there is no graph under each label showing the > EEG data. > What I am passing into ft_preprocessing may be incorrectly structured, I > suspect. This is > data = > > label: {128x1 cell} > time: {132x1 cell} > trial: {132x1 cell} > > (specifically, why are these all cells instead of arrays? What is the > structure of data.time, and of data.trial?) > > where label is the cell array of strings of electrode names, time is a cell > array of the 132 trials' starting times in the .cnt EEG data file, and trial > is a cell array containing the 132 cell arrays of the corresponding {128 x > 283} EEG samples. > > Where am I going wrong? What does ft_rejectvisual(data) expect to have as > the structure for "data"? > > -Dave > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From caspervanheck at gmail.com Fri Jan 18 15:53:11 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Fri, 18 Jan 2013 15:53:11 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: Dear Fieldtrippers, I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: *Attempted to access dim(3); index out of bounds because numel(dim)=2.* *Error in ==> cornerpoints at 11 * *Error in ==> ft_plot_slice at 157 * So, I tried the surf-option, which gave me this: *Undefined function or variable "val".* *Error in ==> ft_sourceplot at 1174 * And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): *Out of memory* Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB Or, the mildly disconcerting: *Matlab has encountered an internal error and has to close* Which seems to have been caused by a so-called *"Segmentation violation" * Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. Sincerely, Casper van Heck On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:35:05 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:35:05 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <7180B46C-356A-456A-8C3B-66E9F94D9DAE@donders.ru.nl> Hi Casper, Looks like a lowlevel error to me. The function complains about the dim not having the number of elements it expects (should be 3). Thus it looks as if the input to the plotting function (thus the output to ft_sourceinterpolate) is unexpected. Best, Jan-Mathijs On Jan 18, 2013, at 3:53 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical reasons, or the people who actually understand what's happening here were on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck wrote: > Dear Fieldtrippers, > > I've been trying to do a source analysis on a dataset with two conditions, mostly following the tutorials and examples from the Fieldtrip site, and come upon a problem; it won't plot. While the source analysis is not an essential component of the analysis of this dataset (it's more along the lines of "let's see if I can do this"), and I don't expect any result other than something like "there might be a source in the left hemisphere", I'd still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual MRI's from the "Subject1.mri"-example, using ft_volumesegment, ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip to find sources based on individual EEG-datasets using ft_freqanalysis (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and surface. Initially I tried to get the ortho-option to work, but this gave the following error: > Attempted to access dim(3); index out of bounds because numel(dim)=2. > Error in ==> cornerpoints at 11 > Error in ==> ft_plot_slice at 157 > > So, I tried the surf-option, which gave me this: > Undefined function or variable "val". > Error in ==> ft_sourceplot at 1174 > > And finally, I tried the slice-option, which gave one of two errors (which seems to be based on how many slices I requested): > Out of memory > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile topping of at 40GB > Or, the mildly disconcerting: > Matlab has encountered an internal error and has to close > Which seems to have been caused by a so-called "Segmentation violation" > > Can anyone offer any insight in these errors? I think I'm doing something wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 16:40:37 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:40:37 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: References: Message-ID: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: > Dear all, > > I am trying to beam single trials into source space using a DICS filter and the following code. > > cfg=[]; > cfg.method='dics'; > cfg.grid=grid_ind; > cfg.vol=hdm; > cfg.grid.filter=alldics.avg.filter;% common filter > cfg.dics.lambda='5%'; > cfg.channel=channs; > cfg.frequency=13; > cfg.grad=data.grad; > cfg.keeptrials='yes'; > cfg.rawtrial='yes'; > dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) > > I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). > > However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? > > Thanks for any advice! > > Best, > Nadia > > Dr. Nadia Müller > CIMeC - Center for Mind/Brain Sciences > Università degli Studi di Trento > via delle Regole, 101 > Mattarello (TN) - ITALY > e-mail nadia.muller at unitn.it > http://sites.google.com/site/obobcimec > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lilla.Magyari at mpi.nl Fri Jan 18 16:43:25 2013 From: Lilla.Magyari at mpi.nl (Lilla.Magyari at mpi.nl) Date: Fri, 18 Jan 2013 16:43:25 +0100 (CET) Subject: [FieldTrip] Source localization In-Reply-To: References: Message-ID: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Hi Casper, I think it is really difficult to figure only from the error message what the problem is. I think it would be also useful to see the inputs (cfg, and your data) of ft_sourceplot. Could you just send me how your cfg and your data-structure looks like? (I mean that you do not need to send the actual data, just the screen output of disp(data) and disp(cfg)). Best, Lilla > Dear Fieldtrippers, > > I've asked this question earlier, but either it got lost due to technical > reasons, or the people who actually understand what's happening here were > on vacation, so here it is again: > > I've been trying to do a source analysis on a dataset with two conditions, > mostly following the tutorials and examples from the Fieldtrip site, and > come upon a problem; it won't plot. While the source analysis is not an > essential component of the analysis of this dataset (it's more along the > lines of "let's see if I can do this"), and I don't expect any result > other > than something like "there might be a source in the left hemisphere", I'd > still would like to found out why it's not working. > > Essentially, I create a standard headmodel cause I don't have individual > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > to find sources based on individual EEG-datasets using ft_freqanalysis > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > After that, I use ft_sourcegrandaverage to produce, well, a grand average > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > surface. Initially I tried to get the ortho-option to work, but this gave > the following error: > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > *Error in ==> cornerpoints at 11 > * > *Error in ==> ft_plot_slice at 157 > * > > So, I tried the surf-option, which gave me this: > *Undefined function or variable "val".* > *Error in ==> ft_sourceplot at 1174 > * > > And finally, I tried the slice-option, which gave one of two errors (which > seems to be based on how many slices I requested): > *Out of memory* > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > topping of at 40GB > Or, the mildly disconcerting: > *Matlab has encountered an internal error and has to close* > Which seems to have been caused by a so-called *"Segmentation violation" > * > > Can anyone offer any insight in these errors? I think I'm doing something > wrong pretty early on, but have no idea what it is. > > Sincerely, > > Casper van Heck > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > wrote: > >> Dear Fieldtrippers, >> >> I've been trying to do a source analysis on a dataset with two >> conditions, >> mostly following the tutorials and examples from the Fieldtrip site, and >> come upon a problem; it won't plot. While the source analysis is not an >> essential component of the analysis of this dataset (it's more along the >> lines of "let's see if I can do this"), and I don't expect any result >> other >> than something like "there might be a source in the left hemisphere", >> I'd >> still would like to found out why it's not working. >> >> Essentially, I create a standard headmodel cause I don't have individual >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> to find sources based on individual EEG-datasets using ft_freqanalysis >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> surface. Initially I tried to get the ortho-option to work, but this >> gave >> the following error: >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> *Error in ==> cornerpoints at 11 >> * >> *Error in ==> ft_plot_slice at 157 >> * >> >> So, I tried the surf-option, which gave me this: >> *Undefined function or variable "val".* >> *Error in ==> ft_sourceplot at 1174 >> * >> >> And finally, I tried the slice-option, which gave one of two errors >> (which >> seems to be based on how many slices I requested): >> *Out of memory* >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> topping of at 40GB >> Or, the mildly disconcerting: >> *Matlab has encountered an internal error and has to close* >> Which seems to have been caused by a so-called *"Segmentation violation" >> * >> >> Can anyone offer any insight in these errors? I think I'm doing >> something >> wrong pretty early on, but have no idea what it is. >> >> Sincerely, >> >> Casper van Heck >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Jan 18 16:55:33 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 16:55:33 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: References: Message-ID: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Jan 18 17:05:45 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 18 Jan 2013 17:05:45 +0100 Subject: [FieldTrip] defining phase and axial to planar conversion In-Reply-To: References: Message-ID: <43CF52FF-6D8B-4888-9A4E-A7E549D3B8E6@donders.ru.nl> Hi Sangita, > I'd like to convert axial gradiometer data to planar data as part of a time frequency analysis. I'm currently using the 'megplanar' code with the 'sincos' option, then applying time frequency analysis on the dH and dV components separately, and then recombining the resulting power spectra with the 'combineplanar' script. This all is working well. Good. > I'd also like to do the same time frequency analysis described above using the phase of a relatively low frequency oscillation (i.e. theta or alpha troughs) as the time locking events within each sensor. What are your opinions on how to best do this? > > My current procedure: > 1. Apply megplanar to get the dH and dV components > 2. Identify phase time points of interest in the dH and dV components separately (i.e. band pass filter and then determine analytic phase of dH and dV components separately) > 3. Perform two separate time frequency analyses time locked to the phase points of interest in the dH and dV components separately > > Is there a better way to do this? > > If this method seems ok, does summing the dH and dV power spectra after step 3 seem justified even if the phase troughs extracted from the dH and dV components and used for time locking are not comparable on a 1:1 basis? Or would it make more sense to do two separate analyses for dH and dV and never recombine? I wouldn't do the dH and dV analysis separately, and then combine. One of the reasons is indeed that it would be strange if there is a phase shift between the dV and dH gradients. Another reason is that the actual direction of dH and dV is rather arbitrary. One could consider an oscillatory source to yield a time-varying gradient oriented exactly along the dH-axis, exactly along the dV-axis, but also somewhere in between. In the first case, the source of interest is not visible along the dV-axis (and the phases estimated from the dV are actually rubbish, so introduces a lot of non-specific variance on your feature of interest), in the second case the situation is reversed (dH picks up nothing relevant), and in the in between situation both pick up a bit. What I would do is to do a PCA on each dH-dV combination, and then go for the first PCA-component that will be used for the phase computation. This approach is implemented in ft_combineplanar, but only for frequency domain data. The order of the steps would be: cfg = []; cfg.planarmethod = 'sincos'; dataplanar = ft_megplanar(cfg, data); cfg = []; cfg.method = 'mtmconvol'/'mtmfft' cfg.output = 'fourier'; cfg.taper = 'hanning'; freqplanar = ft_freqanalysis(cfg, dataplanar); cfg = []; cfg.method = 'svd'; % which is equivalent to PCA freqcombined = ft_combineplanar(cfg, freqplanar); freqplanar.fourierspctrm should now contain phase information, estimated at the gradient orientation yielding the maximum power (assuming a fixed orientation over time and trials, but different across frequencies). Alternatively, you can do the analysis in the time domain, but this will require some code of your own. Best wishes, Jan-Mathijs > > Thanks in advance for any help! > Sangita > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nadia.Muller at unitn.it Fri Jan 18 17:32:10 2013 From: Nadia.Muller at unitn.it (Muller, Nadia) Date: Fri, 18 Jan 2013 17:32:10 +0100 Subject: [FieldTrip] DICS with rawtrial='yes' In-Reply-To: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> References: <4AFB84AB-4F4A-4749-B88C-59BD3EE67396@donders.ru.nl> Message-ID: <61DABECF-9193-429E-8C27-11C8580531BA@unitn.it> Hi Jan-Mathijs, That makes completely sense and you were right I used a vector beamformer. By taking only one orientation (cfg.fixedori='yes') I could solve the problem: Now the values are exactly the same. Could it be that this 'problem' also exists for the example code in the 'Common Filters Beamformer Tutorial' (http://fieldtrip.fcdonders.nl/example/common_filters_in_beamforming)? Should I include the line (cfg.fixedori='yes') also there? Thanks a lot for your very helpful response, Best, Nadia On Jan 18, 2013, at 4:40 PM, jan-mathijs schoffelen wrote: Hi Nadia, My guess here would be that you have used a vector beamformer (i.e. each of the common filters has size 3xM). Then, for each voxel the activity is computed by sandwiching the sensor level cross-spectral density matrix between the voxel's spatial filter: w'*C*w, which yields a 3x3 csd-matrix at the voxel level. Then, in order to get a single number as the power estimate for that voxel (and trial), some computation needs to be done. I believe that the default is to take the first singular value of this 3x3 matrix. Essentially, for each trial a PCA is performed, and the largest eigenvalue is taken to be the power. The PCA may yield a slightly different optimal orientation for each trial, and as a result the average across trials will be different from the first singular value estimated from the average-across-trials csd matrix. If my guesses are incorrect (i.e. you didn't use a vector beamformer, OR the default is not to take the first singular value to represent the voxel power) then we need to dig into the FieldTrip-code. Best wishes, Jan-Mathijs On Jan 17, 2013, at 11:11 AM, Muller, Nadia wrote: Dear all, I am trying to beam single trials into source space using a DICS filter and the following code. cfg=[]; cfg.method='dics'; cfg.grid=grid_ind; cfg.vol=hdm; cfg.grid.filter=alldics.avg.filter;% common filter cfg.dics.lambda='5%'; cfg.channel=channs; cfg.frequency=13; cfg.grad=data.grad; cfg.keeptrials='yes'; cfg.rawtrial='yes'; dics=ft_sourceanalysis(cfg,pow);%pow contains csd of singletrials (only one condition) I would suppose that the average of the rawtrials (obtained by ft_soucredescriptives([],dics) or by averaging power of single trials myselves) should be comparable to the output of dics with rawtrials='no' (and also keeptrials='no'). However this is not the case (the averaged raw trials have a 30-60% bigger amplitude compared to the average values obtained from dics without rawtrial='yes'). Am I misunderstanding something here? Or could it be that I use wrong parameters for beaming single trials? Thanks for any advice! Best, Nadia Dr. Nadia Müller CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY e-mail nadia.muller at unitn.it http://sites.google.com/site/obobcimec _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From teaheart at gmail.com Fri Jan 18 18:09:41 2013 From: teaheart at gmail.com (Jun Wang) Date: Fri, 18 Jan 2013 11:09:41 -0600 Subject: [FieldTrip] statistics test on PLV of connectivity In-Reply-To: References: Message-ID: Thanks, Jan-Mathijs. This is really helpful, I will check the papers you referred. Jun On Fri, Jan 18, 2013 at 12:55 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Jun, > > If you want to test whether within a subject the PLV across conditions is > significantly different (in some statistical sense), you would either do a > statistical test along the lines described in "Nonparametric statistical > testing of coherence differences > , E Maris, JM Schoffelen, P Fries, Journal of neuroscience methods 163 > (1), 161-175" or "Comparing spectra and coherences for groups of unequal > size > , H Bokil, K Purpura, JM Schoffelen, D Thomson, P Mitra, Journal of > neuroscience methods 159 (2), 337-345". > > This functionality is not supported in ft_connectivityanalysis. For the > former way of statistical testing, you should use ft_freqstatistics, in > combination with an adjusted version of statfun_indepsamplesZcoh in order > for it to compute differential PLV, rather than Z-transformed coherence > difference. Alternatively, you could ask ft_connectivity to compute a > jackknife estimate of the variance of the PLV, which could be used in a > traditional t-test. > > Best, > > Jan-Mathijs > > > On Jan 12, 2013, at 1:22 AM, Jun Wang wrote: > > Dear fieldtrip experts, > I have a question regarding to test the plv output from > ft_connectivityanalysis. How can I check the significance with a > statistical test based on surrogate data. the plv output didn't have the > magnitude for single trials. > > thanks > Jun > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at davebritton.com Fri Jan 18 21:24:28 2013 From: dave at davebritton.com (Dave Britton) Date: Fri, 18 Jan 2013 15:24:28 -0500 Subject: [FieldTrip] structure of 'data' argument for ft_preprocessing In-Reply-To: References: <50F8CD72.80507@davebritton.com> Message-ID: <50F9AF7C.1060302@davebritton.com> On 01/18/2013 03:46 AM, Eelke Spaak wrote: Each element k in time should be a 1xN vector of time points corresponding to the time axis of trial k. Each element k in trial should be an MxN matrix corresponding to channels X timepoints. If your data is structured like this, it should work. Note, though, that FT uses 1xNumTrials cell arrays for time and trial, whereas you are using NumTrialsx1. I don't know if this matters, but it might be worth changing it around. Thanks, this is very helpful. It seems that data.sampleinfo is also important for raw data, and needs to be in the reverse order, i.e. NumSamplesx1. -Dave From naran.kutt at gmail.com Sat Jan 19 07:00:06 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 01:00:06 -0500 Subject: [FieldTrip] source level statistics on one data set. Message-ID: Dear All, I had a question regarding across subject source level statistics using fieldtrip. For 15 subjects I have two conditions conA and conB. For each subject I then 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. sincerely Naran -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Jan 19 08:08:32 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 19 Jan 2013 08:08:32 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: Message-ID: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Hi Naran, It seems you're almost there! What I would do is the following: Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. The final step would be something like this: cfg = []; cfg ... stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; cfg.ivar = 2; cfg.uvar = 1; cfg.statistic = 'depsamplesT'; In this case you will perform a paired T-test between the 2 conditions. Best, Jan-Mathijs On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > Dear All, > > I had a question regarding across subject source level statistics using fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From naran.kutt at gmail.com Sat Jan 19 10:17:51 2013 From: naran.kutt at gmail.com (Narayanan Kutty) Date: Sat, 19 Jan 2013 04:17:51 -0500 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: Hi Jan, Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest 1. would the bias be still there, or will it be taken care of? 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects Thank you again! best, Naran On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 > conditions separate. Then, srcA and srcB (for all subjects) are ready to > enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. > Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = > 'no', you'll only get an average across subjects, so that's not useful for > doing statistics to begin with. Alternatively, you could call > ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a > redundant step. Moreover, it is a bit silly, because in that case no > 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on > source level data, but you may get some inspiration from the tutorials that > deal with sensor-level data. Instead of using ft_timelockanalysis you > should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, > srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and > likewise for B. It now boils down to informing ft_sourcestatistics with the > appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > > Dear All, > > I had a question regarding across subject source level statistics using > fieldtrip. > > For 15 subjects I have two conditions conA and conB. For each subject I > then > > 1. calculate a DICS beaformer for conA, conB, based on a common filter. > (lets call them srcA and srcB resp.) > > 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) > > 3. interpolate and normalize srcDiff using ft_sourceinterpolate > and ft_volumenormalise (lets call the output srcDiffNorm) > > After I have done that for each subject I use ft_sourcegrandaverage > with cfg.keepindividual = 'yes'; to get grandavgAvsB. > > What I would like to do is test just grandavgAvsB to see if any voxels are > significantly different from zero (zero being conA = conB). > > How should I go about doing this using ft_sourcestatistics (or another > program). The example scripts seem want two datasets. > > sincerely > Naran > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sun Jan 20 03:23:51 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 20 Jan 2013 02:23:51 +0000 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: , <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Jan-Mathijs, Thank you very much for the thoughts on the issue. I do hope to hear what others have to say also. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: Saturday, 19 January 2013 2:55 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Running sensor space stats then source? Hi Peter, I don't have a definite answer to your question, but note that analysing the data at the level of the sources is something a bit more involved than just taking the log-transform... Here are some pseudo-random thoughts: Essentially, sensor level signals present themselves as a linear mixture of the underlying sources of interest, and the source modelling attempts to unmix the sensor signals using biophysical (and additional) constraints. In general, source level analysis will allow for a 'cleaner' interpretation of the possible location of the sources, where one should always account for the fact that the spatial resolution of EEG/MEG source reconstruction is not typically very high. In addition, the more relevant reason to try to unmix the sensor-level data, is to get a cleaner account of the temporal structure in and between the underlying neural generators, allowing for less problematic interpretation of univariate and bi/multivariate (connectivity) quantities estimated from the data. As a result of the source reconstruction, it could be that results are uncovered which are not easily visible from the sensor data alone. It is perfectly valid to constrain yourself to sensor-level analysis, if this allows you to make your scientific point. Also, once you manage to reject your null-hypothesis (allowing you to speculate about the alternative hypothesis in your discussion section of your paper), there is no need to go to the source level. I guess that to some extent it is also a matter of taste, familiarity with the methods, and opportunity which drives researchers to choose for one or the other approach. These are just my thoughts and ideas, and it could be that other people on this forum have more sensible things to say about it. Best, Jan-Mathijs On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: Hi fieldtrip list, I'm about to start running some stats on my data but have run into a bit of a problem when it comes to the correct method. I'm interested in looking at ER "p3" activity and so will first be using the cluster based tests in fieldtrip to examine for significant differences between my two groups, limiting the TOI to around 300 - 500ms. The problem comes when I want to to do source localisation, as I'll be using the same time window, just in a different (more assumption filled) space. In my head it's like running a t-test on "raw" data then doing it again transformed (eg, log transform) numbers, removing any assumption of independence and by conventional wisdom shouldn't be done. Most of the articles I've read seem to go for one or the other but those that use both don't make any discussion regarding it. Can anyone point me in the right methodology direction? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sun Jan 20 09:15:36 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sun, 20 Jan 2013 09:15:36 +0100 Subject: [FieldTrip] source level statistics on one data set. In-Reply-To: References: <95602DCF-2AF8-45D6-926D-DD246071EE02@donders.ru.nl> Message-ID: <47B5264C-3D58-4AA1-8C21-0A0CC0C06C07@donders.ru.nl> Hi Naran, Usually the statistical contrast takes care of the depth bias. Alternatively, you could test the difference of the log10 of the power (i.e. take the log10 of srcX.avg.pow); this is equivalent to testing the log10 of the ratio. Indeed you can correct for multiple comparisons using the cluster-based test statistic. Best, Jan-Mathijs On Jan 19, 2013, at 10:17 AM, Narayanan Kutty wrote: > Hi Jan, > > Thank you for the quick reply. I thought the normalization (srcA-srcB)/srcA was necessary to get rid of the bias towards the center of the head. So if I do it as you suggest > > 1. would the bias be still there, or will it be taken care of? > > 2. if I wanted to "correct" for multiple comparisons do I follow your suggestion with a few extras to do the montecarlo as given here > http://fieldtrip.fcdonders.nl/example/source_statistics#group_level_statistics_over_subjects > > Thank you again! > > best, > Naran > > On Sat, Jan 19, 2013 at 2:08 AM, jan-mathijs schoffelen wrote: > Hi Naran, > > It seems you're almost there! > What I would do is the following: > > Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with. > We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics. > The final step would be something like this: > > cfg = []; > cfg ... > stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, .... > > where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g. > > cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2]; > cfg.ivar = 2; > cfg.uvar = 1; > cfg.statistic = 'depsamplesT'; > > In this case you will perform a paired T-test between the 2 conditions. > > Best, > > Jan-Mathijs > > > On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote: > >> Dear All, >> >> I had a question regarding across subject source level statistics using fieldtrip. >> >> For 15 subjects I have two conditions conA and conB. For each subject I then >> >> 1. calculate a DICS beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.) >> >> 2. calculate normalized srcDiff by doing (srcA-srcB/srcA) >> >> 3. interpolate and normalize srcDiff using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm) >> >> After I have done that for each subject I use ft_sourcegrandaverage with cfg.keepindividual = 'yes'; to get grandavgAvsB. >> >> What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB). >> >> How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets. >> >> sincerely >> Naran >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Mon Jan 21 12:18:58 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Mon, 21 Jan 2013 12:18:58 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: Everyone, While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: First I create a pre-post contrast as shown in the beamformer tutorial. Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); * *mri = ft_volumereslice([], mri);* Then: *[data] = ft_sourceinterpolate(cfg, data, mri); * where cfg contains: *cfg.parameter: 'avg.pow'* *cfg.downsample: 4* and I add the anatomy: *data.anatomy = mri.anatomy; clear mri* And finally, I call ft_sourceplot using these options: cfg.*parameter: 'avg.pow'* *cfg.downsample: 4* with one of these three methods: 1) *cfg.method = 'surface';* * cfg.surffile = 'surface_l4_both.mat';* * cfg.surfdownsample = 4;* * cfg.projmethod = 'nearest';* 2) *cfg.method = 'ortho';* 3) *cfg.method = 'slice';* * cfg.nslices = 20;* Which leads to the errors shown earlier. At this point, disp(data) yields: *K>> disp(data)* * avg: [1x1 struct]* * pos: [16777216x3 double]* * dim: [256 256 256]* * inside: [1x16777216 double]* * outside: [1x0 double]* * coordsys: 'ctf'* * unit: 'mm'* * cfg: [1x1 struct]* * anatomy: [256x256x256 double]* * * I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model * * * *% segment the template brain and construct a volume conduction model (i.e. head model)* *cfg = [];* *cfg.output = {'brain' 'scalp' 'skull'};* *cfg.downsample = 2;* *t_seg = ft_volumesegment(cfg, mri);* * * *% create head model* *cfg = [];* *cfg.method = 'singlesphere';* *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* *cfg.elec = ft_read_sens('standard_1020.elc');* *t_vol = ft_prepare_headmodel(cfg, t_seg);* *clear template_seg* * * *% construct the dipole grid in the template brain coordinates* *cfg = [];* *cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION* *cfg.vol = t_vol;* *t_grid = ft_prepare_sourcemodel(cfg);* * * After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* * * Anyone seeing anything obviously stupid? Sincerely, Casper On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two > conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors > (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Jan 22 09:49:16 2013 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 22 Jan 2013 09:49:16 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> Message-ID: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Hi intersect(everyone, casper) > Everyone, > > While the whole script is way too convoluted to put up here, but luckily the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using cfg.outputfile), where the data is fed as a cell array (which seems to work properly), I go over to a source-comparison script. This script works as follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and reslice this data: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > mri = ft_volumereslice([], mri); > > Then: > [data] = ft_sourceinterpolate(cfg, data, mri); > where cfg contains: > cfg.parameter: 'avg.pow' > cfg.downsample: 4 > > and I add the anatomy: > data.anatomy = mri.anatomy; clear mri Putting mri.anatomy into data.anatomy is probably not what you want to do: the whole point about ft_sourceinterpolate is to get the functional and anatomical data in the same 'pixel-space'; this is the only way that ft_sourceplot (as of yet) can deal with it. The reason is that now the functional data is sampled once every 4 voxels, relative to the anatomy. I guess that this causes your problem in ft_sourceplot. Best wishes, Jan-Mathijs > And finally, I call ft_sourceplot using these options: > cfg.parameter: 'avg.pow'; > cfg.downsample: 4 > with one of these three methods: > 1) cfg.method = 'surface'; > cfg.surffile = 'surface_l4_both.mat'; > cfg.surfdownsample = 4; > cfg.projmethod = 'nearest'; > 2) cfg.method = 'ortho'; > 3) cfg.method = 'slice'; > cfg.nslices = 20; > Which leads to the errors shown earlier. At this point, disp(data) yields: > K>> disp(data) > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > anatomy: [256x256x256 double] > > I'm guessing it has something to do with the 'inside' and 'outside' elements, so my 'standard head model'. I think I made this using the following code: > mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' anatomical model > > % segment the template brain and construct a volume conduction model (i.e. head model) > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > cfg.downsample = 2; > t_seg = ft_volumesegment(cfg, mri); > > % create head model > cfg = []; > cfg.method = 'singlesphere'; > cfg.hdmfile = strcat(h.subject,'Subject01.hdm'); > cfg.elec = ft_read_sens('standard_1020.elc'); > t_vol = ft_prepare_headmodel(cfg, t_seg); > clear template_seg > > % construct the dipole grid in the template brain coordinates > cfg = []; > cfg.normalize = 'no'; % no normalization, since we're comparing two conditions THAT'S RIGHT I DID PAY ATTENTION > cfg.vol = t_vol; > t_grid = ft_prepare_sourcemodel(cfg); > > After which I use this on all subjects, using this (note that I store all data in a single massive structure, to make saving to disk and selecting data etc. easier): > source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid); > > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > Hi Casper, > > I think it is really difficult to figure only from the error message what > the problem is. I think it would be also useful to see the inputs (cfg, > and your data) of ft_sourceplot. Could you just send me how your cfg and > your data-structure looks like? (I mean that you do not need to send the > actual data, just the screen output of disp(data) and disp(cfg)). > > Best, > Lilla > > > > Dear Fieldtrippers, > > > > I've asked this question earlier, but either it got lost due to technical > > reasons, or the people who actually understand what's happening here were > > on vacation, so here it is again: > > > > I've been trying to do a source analysis on a dataset with two conditions, > > mostly following the tutorials and examples from the Fieldtrip site, and > > come upon a problem; it won't plot. While the source analysis is not an > > essential component of the analysis of this dataset (it's more along the > > lines of "let's see if I can do this"), and I don't expect any result > > other > > than something like "there might be a source in the left hemisphere", I'd > > still would like to found out why it's not working. > > > > Essentially, I create a standard headmodel cause I don't have individual > > MRI's from the "Subject1.mri"-example, using ft_volumesegment, > > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get Fieldtrip > > to find sources based on individual EEG-datasets using ft_freqanalysis > > (with cfg.method = 'mtmfft') and ft_sourceanalysis. > > After that, I use ft_sourcegrandaverage to produce, well, a grand average > > source, and feed this via ft_sourceinterpolate to ft_sourceplot. > > > > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > > surface. Initially I tried to get the ortho-option to work, but this gave > > the following error: > > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > > *Error in ==> cornerpoints at 11 > > * > > *Error in ==> ft_plot_slice at 157 > > * > > > > So, I tried the surf-option, which gave me this: > > *Undefined function or variable "val".* > > *Error in ==> ft_sourceplot at 1174 > > * > > > > And finally, I tried the slice-option, which gave one of two errors (which > > seems to be based on how many slices I requested): > > *Out of memory* > > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > > topping of at 40GB > > Or, the mildly disconcerting: > > *Matlab has encountered an internal error and has to close* > > Which seems to have been caused by a so-called *"Segmentation violation" > > * > > > > Can anyone offer any insight in these errors? I think I'm doing something > > wrong pretty early on, but have no idea what it is. > > > > Sincerely, > > > > Casper van Heck > > > > > > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck > > wrote: > > > >> Dear Fieldtrippers, > >> > >> I've been trying to do a source analysis on a dataset with two > >> conditions, > >> mostly following the tutorials and examples from the Fieldtrip site, and > >> come upon a problem; it won't plot. While the source analysis is not an > >> essential component of the analysis of this dataset (it's more along the > >> lines of "let's see if I can do this"), and I don't expect any result > >> other > >> than something like "there might be a source in the left hemisphere", > >> I'd > >> still would like to found out why it's not working. > >> > >> Essentially, I create a standard headmodel cause I don't have individual > >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, > >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get > >> Fieldtrip > >> to find sources based on individual EEG-datasets using ft_freqanalysis > >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. > >> After that, I use ft_sourcegrandaverage to produce, well, a grand > >> average > >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. > >> > >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and > >> surface. Initially I tried to get the ortho-option to work, but this > >> gave > >> the following error: > >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* > >> *Error in ==> cornerpoints at 11 > >> * > >> *Error in ==> ft_plot_slice at 157 > >> * > >> > >> So, I tried the surf-option, which gave me this: > >> *Undefined function or variable "val".* > >> *Error in ==> ft_sourceplot at 1174 > >> * > >> > >> And finally, I tried the slice-option, which gave one of two errors > >> (which > >> seems to be based on how many slices I requested): > >> *Out of memory* > >> Which is pretty damn impressive since I've got 8GB of RAM and a pagefile > >> topping of at 40GB > >> Or, the mildly disconcerting: > >> *Matlab has encountered an internal error and has to close* > >> Which seems to have been caused by a so-called *"Segmentation violation" > >> * > >> > >> Can anyone offer any insight in these errors? I think I'm doing > >> something > >> wrong pretty early on, but have no idea what it is. > >> > >> Sincerely, > >> > >> Casper van Heck > >> > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Jan 23 09:26:36 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 23 Jan 2013 09:26:36 +0100 Subject: [FieldTrip] Running sensor space stats then source? In-Reply-To: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> References: <0F033F11-4C0C-472E-AE19-8BB718D8CD1B@donders.ru.nl> Message-ID: Hi Peter, I think your question was aimed at asking: is it, by running the same stats on transformed data, double-dipping to use the same time window, for example? I don't think so in this case of sensor versus source because, as Jan-Mathijs already mentioned, it's not just a transform of each sensor to a given source location, but rather a linear mixture, and this linear mixture may pull out different effects, even when using cluster stats at the sensor level. I also don't think that it is double dipping if you first find the optimal time window in sensor data, and then simply want to ask: where is the most likely location of the underlying neural source? Then you are asking a spatial/where question, not a presence/if question. Although, see previous paragraph as to why you may find a different set of significant findings in source versus sensor space. Cheers, Johanna 2013/1/18 jan-mathijs schoffelen > Hi Peter, > > I don't have a definite answer to your question, but note that analysing > the data at the level of the sources is something a bit more involved than > just taking the log-transform... > > Here are some pseudo-random thoughts: > > Essentially, sensor level signals present themselves as a linear mixture > of the underlying sources of interest, and the source modelling attempts to > unmix the sensor signals using biophysical (and additional) constraints. > In general, source level analysis will allow for a 'cleaner' > interpretation of the possible location of the sources, where one should > always account for the fact that the spatial resolution of EEG/MEG source > reconstruction is not typically very high. In addition, the more relevant > reason to try to unmix the sensor-level data, is to get a cleaner account > of the temporal structure in and between the underlying neural generators, > allowing for less problematic interpretation of univariate and > bi/multivariate (connectivity) quantities estimated from the data. As a > result of the source reconstruction, it could be that results are uncovered > which are not easily visible from the sensor data alone. > > It is perfectly valid to constrain yourself to sensor-level analysis, if > this allows you to make your scientific point. Also, once you manage to > reject your null-hypothesis (allowing you to speculate about the > alternative hypothesis in your discussion section of your paper), there is > no need to go to the source level. > > I guess that to some extent it is also a matter of taste, familiarity with > the methods, and opportunity which drives researchers to choose for one or > the other approach. > > These are just my thoughts and ideas, and it could be that other people on > this forum have more sensible things to say about it. > > Best, > > Jan-Mathijs > > > > > > On Jan 15, 2013, at 6:00 AM, Peter Goodin wrote: > > Hi fieldtrip list, > > I'm about to start running some stats on my data but have run into a bit > of a problem when it comes to the correct method. > > I'm interested in looking at ER "p3" activity and so will first be using > the cluster based tests in fieldtrip to examine for significant differences > between my two groups, limiting the TOI to around 300 - 500ms. > > The problem comes when I want to to do source localisation, as I'll be > using the same time window, just in a different (more assumption filled) > space. In my head it's like running a t-test on "raw" data then doing it > again transformed (eg, log transform) numbers, removing any assumption of > independence and by conventional wisdom shouldn't be done. > > Most of the articles I've read seem to go for one or the other but those > that use both don't make any discussion regarding it. Can anyone point me > in the right methodology direction? > > Thanks, > > Peter. > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caspervanheck at gmail.com Wed Jan 23 10:55:54 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Wed, 23 Jan 2013 10:55:54 +0100 Subject: [FieldTrip] Source localization In-Reply-To: <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Jan-Mathijs, Since ft_sourceplot complained about not having anatomy (or functional) parameter, and it seems to default to a field named '*data.anatomy'*, I assumed adding *mri.anatomy* in *data.anatomy* would suffice. But, without this, ft_sourceplot would again require an anatomy parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' in the cfg I feed to ft_sourceplot, where 'mri' is the result from ft_volumereslice. However, ft_sourceplot then says "*do not understand cfg.anaparameter*", and thus it is not plotting "*anatomy*". After looking back to the plotting tutorial where I read "The anatomy can be read with ft_read_mri", I'm not quite sure what's going wrong. Sincerely, Casper On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi intersect(everyone, casper) > > Everyone, > > While the whole script is way too convoluted to put up here, but luckily > the relevant steps are quite simple > Input is simply raw data, read with ft_preprocessing, which is passed > through functions as shown in my previous email. > > After passing the data to ft_sourcegrandaverage (only using > cfg.outputfile), where the data is fed as a cell array (which seems to work > properly), I go over to a source-comparison script. This script works as > follows: > First I create a pre-post contrast as shown in the beamformer tutorial. > > Next, I read some MRI-data using ft_read_mri from a standard folder, and > reslice this data: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); > * > *mri = ft_volumereslice([], mri);* > > Then: > *[data] = ft_sourceinterpolate(cfg, data, mri); > * > where cfg contains: > *cfg.parameter: 'avg.pow'* > *cfg.downsample: 4* > > and I add the anatomy: > *data.anatomy = mri.anatomy; clear mri* > > > Putting mri.anatomy into data.anatomy is probably not what you want to do: > the whole point about ft_sourceinterpolate is to get the functional and > anatomical data in the same 'pixel-space'; this is the only way that > ft_sourceplot (as of yet) can deal with it. The reason is that now the > functional data is sampled once every 4 voxels, relative to the anatomy. I > guess that this causes your problem in ft_sourceplot. > > > > Best wishes, > > Jan-Mathijs > > > > And finally, I call ft_sourceplot using these options: > > cfg.*parameter: 'avg.pow';* > > *cfg.downsample: 4* > > * > * > > with one of these three methods: > 1) *cfg.method = 'surface';* > * cfg.surffile = 'surface_l4_both.mat';* > * cfg.surfdownsample = 4;* > * cfg.projmethod = 'nearest';* > 2) *cfg.method = 'ortho';* > 3) *cfg.method = 'slice';* > * cfg.nslices = 20;* > Which leads to the errors shown earlier. At this point, disp(data) yields: > *K>> disp(data)* > * avg: [1x1 struct]* > * pos: [16777216x3 double]* > * dim: [256 256 256]* > * inside: [1x16777216 double]* > * outside: [1x0 double]* > * coordsys: 'ctf'* > * unit: 'mm'* > * cfg: [1x1 struct]* > * anatomy: [256x256x256 double]* > * > * > I'm guessing it has something to do with the 'inside' and 'outside' > elements, so my 'standard head model'. I think I made this using the > following code: > *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' > anatomical model > * > * > * > *% segment the template brain and construct a volume conduction model > (i.e. head model)* > *cfg = [];* > *cfg.output = {'brain' 'scalp' 'skull'};* > *cfg.downsample = 2;* > *t_seg = ft_volumesegment(cfg, mri);* > * * > *% create head model* > *cfg = [];* > *cfg.method = 'singlesphere';* > *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* > *cfg.elec = ft_read_sens('standard_1020.elc');* > *t_vol = ft_prepare_headmodel(cfg, t_seg);* > *clear template_seg* > * > * > *% construct the dipole grid in the template brain coordinates* > *cfg = [];* > *cfg.normalize = 'no'; % no normalization, since we're comparing two > conditions THAT'S RIGHT I DID PAY ATTENTION* > *cfg.vol = t_vol;* > *t_grid = ft_prepare_sourcemodel(cfg);* > * > * > After which I use this on all subjects, using this (note that I store all > data in a single massive structure, to make saving to disk and selecting > data etc. easier): > *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* > * > * > Anyone seeing anything obviously stupid? > > Sincerely, > > Casper > > > On Fri, Jan 18, 2013 at 4:43 PM, wrote: > >> Hi Casper, >> >> I think it is really difficult to figure only from the error message what >> the problem is. I think it would be also useful to see the inputs (cfg, >> and your data) of ft_sourceplot. Could you just send me how your cfg and >> your data-structure looks like? (I mean that you do not need to send the >> actual data, just the screen output of disp(data) and disp(cfg)). >> >> Best, >> Lilla >> >> >> > Dear Fieldtrippers, >> > >> > I've asked this question earlier, but either it got lost due to >> technical >> > reasons, or the people who actually understand what's happening here >> were >> > on vacation, so here it is again: >> > >> > I've been trying to do a source analysis on a dataset with two >> conditions, >> > mostly following the tutorials and examples from the Fieldtrip site, and >> > come upon a problem; it won't plot. While the source analysis is not an >> > essential component of the analysis of this dataset (it's more along the >> > lines of "let's see if I can do this"), and I don't expect any result >> > other >> > than something like "there might be a source in the left hemisphere", >> I'd >> > still would like to found out why it's not working. >> > >> > Essentially, I create a standard headmodel cause I don't have individual >> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> Fieldtrip >> > to find sources based on individual EEG-datasets using ft_freqanalysis >> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> > After that, I use ft_sourcegrandaverage to produce, well, a grand >> average >> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> > >> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> > surface. Initially I tried to get the ortho-option to work, but this >> gave >> > the following error: >> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> > *Error in ==> cornerpoints at 11 >> > * >> > *Error in ==> ft_plot_slice at 157 >> > * >> > >> > So, I tried the surf-option, which gave me this: >> > *Undefined function or variable "val".* >> > *Error in ==> ft_sourceplot at 1174 >> > * >> > >> > And finally, I tried the slice-option, which gave one of two errors >> (which >> > seems to be based on how many slices I requested): >> > *Out of memory* >> > Which is pretty damn impressive since I've got 8GB of RAM and a pagefile >> > topping of at 40GB >> > Or, the mildly disconcerting: >> > *Matlab has encountered an internal error and has to close* >> > Which seems to have been caused by a so-called *"Segmentation violation" >> > * >> > >> > Can anyone offer any insight in these errors? I think I'm doing >> something >> > wrong pretty early on, but have no idea what it is. >> > >> > Sincerely, >> > >> > Casper van Heck >> > >> > >> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >> > wrote: >> > >> >> Dear Fieldtrippers, >> >> >> >> I've been trying to do a source analysis on a dataset with two >> >> conditions, >> >> mostly following the tutorials and examples from the Fieldtrip site, >> and >> >> come upon a problem; it won't plot. While the source analysis is not an >> >> essential component of the analysis of this dataset (it's more along >> the >> >> lines of "let's see if I can do this"), and I don't expect any result >> >> other >> >> than something like "there might be a source in the left hemisphere", >> >> I'd >> >> still would like to found out why it's not working. >> >> >> >> Essentially, I create a standard headmodel cause I don't have >> individual >> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >> >> Fieldtrip >> >> to find sources based on individual EEG-datasets using ft_freqanalysis >> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >> >> average >> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >> >> >> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >> >> surface. Initially I tried to get the ortho-option to work, but this >> >> gave >> >> the following error: >> >> *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >> >> *Error in ==> cornerpoints at 11 >> >> * >> >> *Error in ==> ft_plot_slice at 157 >> >> * >> >> >> >> So, I tried the surf-option, which gave me this: >> >> *Undefined function or variable "val".* >> >> *Error in ==> ft_sourceplot at 1174 >> >> * >> >> >> >> And finally, I tried the slice-option, which gave one of two errors >> >> (which >> >> seems to be based on how many slices I requested): >> >> *Out of memory* >> >> Which is pretty damn impressive since I've got 8GB of RAM and a >> pagefile >> >> topping of at 40GB >> >> Or, the mildly disconcerting: >> >> *Matlab has encountered an internal error and has to close* >> >> Which seems to have been caused by a so-called *"Segmentation >> violation" >> >> * >> >> >> >> Can anyone offer any insight in these errors? I think I'm doing >> >> something >> >> wrong pretty early on, but have no idea what it is. >> >> >> >> Sincerely, >> >> >> >> Casper van Heck >> >> >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at med.uni-duesseldorf.de Wed Jan 23 12:19:37 2013 From: Hanneke.vanDijk at med.uni-duesseldorf.de (Hanneke van Dijk) Date: Wed, 23 Jan 2013 12:19:37 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Hi Casper, The cfg.anaparameter should then be 'anatomy'. It refers to the field (in data) in which the anatomy can be found, in your case: data.anatomy. Hope this helps, Hanneke Op 23 jan. 2013 10:57 schreef "Casper van Heck" het volgende: > Dear Jan-Mathijs, > > Since ft_sourceplot complained about not having anatomy (or functional) > parameter, and it seems to default to a field named '*data.anatomy'*, I > assumed adding *mri.anatomy* in *data.anatomy* would suffice. > > But, without this, ft_sourceplot would again require an anatomy parameter, > so that would mean that I need to ut '*cfg.anaparameter = mri*' in the > cfg I feed to ft_sourceplot, where 'mri' is the result from > ft_volumereslice. > However, ft_sourceplot then says "*do not understand cfg.anaparameter*", > and thus it is not plotting "*anatomy*". After looking back to the > plotting tutorial where I read "The anatomy can be read with ft_read_mri", > I'm not quite sure what's going wrong. > > Sincerely, > > Casper > > > > On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi intersect(everyone, casper) >> >> Everyone, >> >> While the whole script is way too convoluted to put up here, but luckily >> the relevant steps are quite simple >> Input is simply raw data, read with ft_preprocessing, which is passed >> through functions as shown in my previous email. >> >> After passing the data to ft_sourcegrandaverage (only using >> cfg.outputfile), where the data is fed as a cell array (which seems to work >> properly), I go over to a source-comparison script. This script works as >> follows: >> First I create a pre-post contrast as shown in the beamformer tutorial. >> >> Next, I read some MRI-data using ft_read_mri from a standard folder, and >> reslice this data: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >> * >> *mri = ft_volumereslice([], mri);* >> >> Then: >> *[data] = ft_sourceinterpolate(cfg, data, mri); >> * >> where cfg contains: >> *cfg.parameter: 'avg.pow'* >> *cfg.downsample: 4* >> >> and I add the anatomy: >> *data.anatomy = mri.anatomy; clear mri* >> >> >> Putting mri.anatomy into data.anatomy is probably not what you want to >> do: the whole point about ft_sourceinterpolate is to get the functional and >> anatomical data in the same 'pixel-space'; this is the only way that >> ft_sourceplot (as of yet) can deal with it. The reason is that now the >> functional data is sampled once every 4 voxels, relative to the anatomy. I >> guess that this causes your problem in ft_sourceplot. >> >> >> >> Best wishes, >> >> Jan-Mathijs >> >> >> >> And finally, I call ft_sourceplot using these options: >> >> cfg.*parameter: 'avg.pow';* >> >> *cfg.downsample: 4* >> >> * >> * >> >> with one of these three methods: >> 1) *cfg.method = 'surface';* >> * cfg.surffile = 'surface_l4_both.mat';* >> * cfg.surfdownsample = 4;* >> * cfg.projmethod = 'nearest';* >> 2) *cfg.method = 'ortho';* >> 3) *cfg.method = 'slice';* >> * cfg.nslices = 20;* >> Which leads to the errors shown earlier. At this point, disp(data) yields: >> *K>> disp(data)* >> * avg: [1x1 struct]* >> * pos: [16777216x3 double]* >> * dim: [256 256 256]* >> * inside: [1x16777216 double]* >> * outside: [1x0 double]* >> * coordsys: 'ctf'* >> * unit: 'mm'* >> * cfg: [1x1 struct]* >> * anatomy: [256x256x256 double]* >> * >> * >> I'm guessing it has something to do with the 'inside' and 'outside' >> elements, so my 'standard head model'. I think I made this using the >> following code: >> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load 'standard' >> anatomical model >> * >> * >> * >> *% segment the template brain and construct a volume conduction model >> (i.e. head model)* >> *cfg = [];* >> *cfg.output = {'brain' 'scalp' 'skull'};* >> *cfg.downsample = 2;* >> *t_seg = ft_volumesegment(cfg, mri);* >> * * >> *% create head model* >> *cfg = [];* >> *cfg.method = 'singlesphere';* >> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >> *cfg.elec = ft_read_sens('standard_1020.elc');* >> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >> *clear template_seg* >> * >> * >> *% construct the dipole grid in the template brain coordinates* >> *cfg = [];* >> *cfg.normalize = 'no'; % no normalization, since we're comparing two >> conditions THAT'S RIGHT I DID PAY ATTENTION* >> *cfg.vol = t_vol;* >> *t_grid = ft_prepare_sourcemodel(cfg);* >> * >> * >> After which I use this on all subjects, using this (note that I store all >> data in a single massive structure, to make saving to disk and selecting >> data etc. easier): >> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >> * >> * >> Anyone seeing anything obviously stupid? >> >> Sincerely, >> >> Casper >> >> >> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >> >>> Hi Casper, >>> >>> I think it is really difficult to figure only from the error message what >>> the problem is. I think it would be also useful to see the inputs (cfg, >>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>> your data-structure looks like? (I mean that you do not need to send the >>> actual data, just the screen output of disp(data) and disp(cfg)). >>> >>> Best, >>> Lilla >>> >>> >>> > Dear Fieldtrippers, >>> > >>> > I've asked this question earlier, but either it got lost due to >>> technical >>> > reasons, or the people who actually understand what's happening here >>> were >>> > on vacation, so here it is again: >>> > >>> > I've been trying to do a source analysis on a dataset with two >>> conditions, >>> > mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> > come upon a problem; it won't plot. While the source analysis is not an >>> > essential component of the analysis of this dataset (it's more along >>> the >>> > lines of "let's see if I can do this"), and I don't expect any result >>> > other >>> > than something like "there might be a source in the left hemisphere", >>> I'd >>> > still would like to found out why it's not working. >>> > >>> > Essentially, I create a standard headmodel cause I don't have >>> individual >>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> Fieldtrip >>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>> average >>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> > >>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> > surface. Initially I tried to get the ortho-option to work, but this >>> gave >>> > the following error: >>> > *Attempted to access dim(3); index out of bounds because numel(dim)=2.* >>> > *Error in ==> cornerpoints at 11 >>> > * >>> > *Error in ==> ft_plot_slice at 157 >>> > * >>> > >>> > So, I tried the surf-option, which gave me this: >>> > *Undefined function or variable "val".* >>> > *Error in ==> ft_sourceplot at 1174 >>> > * >>> > >>> > And finally, I tried the slice-option, which gave one of two errors >>> (which >>> > seems to be based on how many slices I requested): >>> > *Out of memory* >>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> > topping of at 40GB >>> > Or, the mildly disconcerting: >>> > *Matlab has encountered an internal error and has to close* >>> > Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> > * >>> > >>> > Can anyone offer any insight in these errors? I think I'm doing >>> something >>> > wrong pretty early on, but have no idea what it is. >>> > >>> > Sincerely, >>> > >>> > Casper van Heck >>> > >>> > >>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>> > wrote: >>> > >>> >> Dear Fieldtrippers, >>> >> >>> >> I've been trying to do a source analysis on a dataset with two >>> >> conditions, >>> >> mostly following the tutorials and examples from the Fieldtrip site, >>> and >>> >> come upon a problem; it won't plot. While the source analysis is not >>> an >>> >> essential component of the analysis of this dataset (it's more along >>> the >>> >> lines of "let's see if I can do this"), and I don't expect any result >>> >> other >>> >> than something like "there might be a source in the left hemisphere", >>> >> I'd >>> >> still would like to found out why it's not working. >>> >> >>> >> Essentially, I create a standard headmodel cause I don't have >>> individual >>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>> >> Fieldtrip >>> >> to find sources based on individual EEG-datasets using ft_freqanalysis >>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>> >> average >>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>> >> >>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>> >> surface. Initially I tried to get the ortho-option to work, but this >>> >> gave >>> >> the following error: >>> >> *Attempted to access dim(3); index out of bounds because >>> numel(dim)=2.* >>> >> *Error in ==> cornerpoints at 11 >>> >> * >>> >> *Error in ==> ft_plot_slice at 157 >>> >> * >>> >> >>> >> So, I tried the surf-option, which gave me this: >>> >> *Undefined function or variable "val".* >>> >> *Error in ==> ft_sourceplot at 1174 >>> >> * >>> >> >>> >> And finally, I tried the slice-option, which gave one of two errors >>> >> (which >>> >> seems to be based on how many slices I requested): >>> >> *Out of memory* >>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>> pagefile >>> >> topping of at 40GB >>> >> Or, the mildly disconcerting: >>> >> *Matlab has encountered an internal error and has to close* >>> >> Which seems to have been caused by a so-called *"Segmentation >>> violation" >>> >> * >>> >> >>> >> Can anyone offer any insight in these errors? I think I'm doing >>> >> something >>> >> wrong pretty early on, but have no idea what it is. >>> >> >>> >> Sincerely, >>> >> >>> >> Casper van Heck >>> >> >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Jan 23 18:21:17 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 23 Jan 2013 12:21:17 -0500 Subject: [FieldTrip] CTF MEG data anonymization Message-ID: Hello, Does anybody know *how to anonymize CTF MEG scans* (all patient's info must be removed from the file)? I have tools for the DICOM format but not for CTF formats. Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Wed Jan 23 19:01:22 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Wed, 23 Jan 2013 13:01:22 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: Message-ID: <51002572.9090908@kurage.nimh.nih.gov> Use the CTF tool newDs with the -anon option. McGowin, Inna wrote: > Hello, > > Does anybody know *how to anonymize CTF MEG scans* (all patient's info > must be removed from the file)? > I have tools for the DICOM format but not for CTF formats. > > Thanks! > -- > Inna > > > ------------------------------------------------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- The white knight is talking backwards. From a.stolk8 at gmail.com Wed Jan 23 19:08:19 2013 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 23 Jan 2013 19:08:19 +0100 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: <51002572.9090908@kurage.nimh.nih.gov> References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Hi Inna, Have a look here http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset Yours, Arjen 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > Use the CTF tool newDs with the -anon option. > > McGowin, Inna wrote: > >> Hello, >> >> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >> must be removed from the file)? >> >> I have tools for the DICOM format but not for CTF formats. >> >> Thanks! >> -- >> Inna >> >> >> ------------------------------**------------------------------** >> ------------ >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > -- > The white knight is talking backwards. > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 02:59:58 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 01:59:58 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment Message-ID: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Thu Jan 24 07:38:15 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Thu, 24 Jan 2013 07:38:15 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From pgoodin at swin.edu.au Thu Jan 24 10:11:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 09:11:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin wrote: > Hi Fieldtrip list, > > I'm trying to add an altered channel and save it as a new fiff file using > the MNE commands from the external/MNE dir in Fieldtrip, but seem to just > keep getting the data from the old fiff file instead. > > The code I'm currently using is: > > To read: > fh = fiff_setup_read_raw('input.fif'); > f = fiff_read_raw_segment(fh); > > After adding in the altered channel data to f, I then use: > > fiff_write_raw_segment(output.fif, fh); > > What I thought would happen is output.fif would use the information in f and > fh to write output.fif, but what seems to be happening is the data in f is > being ignored. > > Does anyone have any ideas on how to insert the altered channel data then > write it back out as a fiff file? > > Thanks, > > Peter. > > > > > __________________________ > Peter Goodin, > BSc (Hons), Ph.D Candidate. > > Brain and Psychological Sciences Research Centre (BPsych) > Swinburne University, > Hawthorn, Vic, 3122 > > Monash Alfred Psychiatry Research Centre (MAPrc) > Level 1, Old Baker Building > Commercial Road > Melbourne, Vic, 3004 > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From julian.keil at gmail.com Thu Jan 24 11:13:11 2013 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 24 Jan 2013 11:13:11 +0100 Subject: [FieldTrip] =?iso-8859-1?q?PhD=2E_Position_at_the_Department_of_P?= =?iso-8859-1?q?sychiatry_and_Psychotherapy=2C_Charit=E9?= Message-ID: <78950AEB-FEFC-4E59-A4E0-9A969D9AA224@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A Starting Grant of the European Research Council (ERC) will fund the currently open position (initially 24 months). The main objective of this ERC research program is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes. The studies within this program include EEG and other neuroimaging methods. Studies will be conducted in healthy subjects and patients with schizophrenia. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as some German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until February 03, 2013, electronically to: daniel.senkowski at charite.de Regards, Daniel Senkowski --------------------------------------------------------------- Daniel Senkowski, Ph.D. Professor of Clinical Neuropsychology Department of Psychiatry and Psychotherapy Charité, University Medicine Berlin St. Hedwig Hospital, Große Hamburger Str. 5-11 10115 Berlin, Germany www.danielsenkowski.com http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianpaolo.demarchi at unitn.it Thu Jan 24 11:13:49 2013 From: gianpaolo.demarchi at unitn.it (Demarchi, Gianpaolo) Date: Thu, 24 Jan 2013 11:13:49 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Thu Jan 24 13:05:48 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Thu, 24 Jan 2013 12:05:48 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , Message-ID: Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrysa.lithari at gmail.com Thu Jan 24 16:33:56 2013 From: chrysa.lithari at gmail.com (Chrysa Lithari) Date: Thu, 24 Jan 2013 16:33:56 +0100 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Message-ID: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:42:43 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:42:43 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From MEpstein at NKI.RFMH.ORG Thu Jan 24 16:44:17 2013 From: MEpstein at NKI.RFMH.ORG (Epstein, Michael) Date: Thu, 24 Jan 2013 10:44:17 -0500 Subject: [FieldTrip] read tfcs from BESA in Fieldtrip In-Reply-To: <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> References: <7583E128-EB5A-4E2A-95F7-1535D8D6CBAA@gmail.com> <2586A1048152BE4D861E64A98700AD420CFFF1CD@nki-mail.NKI.rfmh.org> Message-ID: <2586A1048152BE4D861E64A98700AD420CFFF1CF@nki-mail.NKI.rfmh.org> I forgot to mention - this doesn't change it to fieldtrip format, just to matlab format. But once it's in matlab, it shouldn't be too hard to convert it to a fieldtrip structure. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Epstein, Michael Sent: Thursday, January 24, 2013 10:43 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] read tfcs from BESA in Fieldtrip My lab needed to do the same thing. After communicating with BESA, they sent a function to do just that. (I also wrote one custom for our data). I'm adding the code BESA sent to this email. If you want, email me separately and I'll send other code as well. Hope this works for you :) -Michael %%%%% function tfc_data = readBESAtfcs(filename) % readBESAtfcs reads single trial TFC data exported from BESA Research. % % Use as % tfc = readBESAtfcs(filename) % % The output is a structure containing a 3D matrix with complex numbers % for every trial. The size of the matrix is % [NChannels x NFreqSamples x NTimeSamples]. % % Created June 28, 2012 Todor Jordanov if isempty(findstr(filename,'.')) filename = [filename,'.tfcs']; end fp = fopen(filename, 'r'); if (fp) tfc_data.trials = {}; n_trials = 0; n_channels = 0; n_freqs = 0; tline = fgetl(fp); tline = strtrim(tline); while ischar(tline) if(strncmpi(tline, 'Trial', 5)) n_trials = n_trials + 1; n_channels = 0; n_freqs = 0; elseif(strncmpi(tline, 'Channel', 7)) n_channels = n_channels + 1; n_freqs = 0; else tline = strtrim(tline); tmp = regexp(tline, '\t', 'split'); n_samples = size(tmp, 2); n_freqs = n_freqs + 1; for i=1:n_samples two_reals = sscanf(tmp{i}, '%f +i* %f'); tfc_data.trials{n_trials}(n_channels, n_freqs, i) = ... complex(two_reals(1), two_reals(2)); end end tline = fgetl(fp); end fclose(fp); end %%%% -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Chrysa Lithari Sent: Thursday, January 24, 2013 10:34 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] read tfcs from BESA in Fieldtrip Hi to all, I am trying to read time-frequency single trials from BESA with Fieldtrip. The function besa2fieldtrip deals only with tfc files that are averaged and not with tfcs that contains the single trials. Has anybody expand this function to read also tfcs files? thanks in advance, Chrysa Lithari _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Conserve Resources. Print only when necessary. IMPORTANT NOTICE: This e-mail is meant only for the use of the intended recipient. It may contain confidential information which is legally privilegedor otherwise protected by law. If you received this e-mail in error or from someone who is not authorized to send it to you, you are strictly prohibited from reviewing, using, disseminating, distributing or copying the e-mail. PLEASE NOTIFY US IMMEDIATELY OF THE ERROR BY RETURN E-MAIL AND DELETE THIS MESSAGE FROM YOUR SYSTEM. Thank you for your cooperation. From ninja78278 at aol.com Thu Jan 24 17:11:33 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Thu, 24 Jan 2013 11:11:33 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter Message-ID: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Dear Fieldtrip-Users, I am trying to do lcmv beamform sourceanalysis with a common filter for all conditions (same session, different trials defined with ft_preprocessing belong to different conditions,sequence of conditions randomly intermixed for each block). However if I use the common filter calculated from one block (consisting of 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each condition separately without common filters it is working). Here is how I proceed: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK cfg = []; cfg.channel='MEG'; cfg.keeptrials='yes'; cfg.blc='yes'; cfg.blcwindow = [-0.2 0] data = ft_timelockanalysis(cfg,data); cfg = []; cfg.channel = 'MEG' cfg.covariance ='yes'; cfg.covariancewindow = [0 0.2]; cfg.removemean = 'no'; cfg.keeptrials = 'yes'; timelock_post = ft_timelockanalysis(cfg,data); cfg.covariancewindow = [-0.2 0]; timelock_pre = ft_timelockanalysis(cfg,data); %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.vol = vol.vol; cfg.grad = grad.grad; cfg.keeptrials='yes'; cfg.lcmv.lamda = '5%'; cfg.lcmv.keepfilter = 'yes'; source_post = ft_sourceanalysis(cfg,timelock_post); source_pre = ft_sourceanalysis(cfg,timelock_pre); source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS cfg = []; cfg.trials=cond1; %this picks out the trials belonging to condition1 cfg.channel ='MEG'; cfg.keeptrials='yes'; cfg.blc = 'yes'; cfg.blcwindow = [-02 0]; data=ft_timelockanalysis(cfg,data); cfg =[]; cfg.channel='MEG'; cfg.covariance='yes'; cfg.covariancewindow=[0 0.2]; cfg.removemean ='no'; cfg.keeptrials='yes'; timelock_post_cond1 = ft_timelockanalysis(cfg,data); timelock_pre_cond1 = ft_timelockanalysis(cfg,data); %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE BLOCK cfg = []; cfg.method = 'lcmv'; cfg.grid = grid.grid; cfg.grid.filter=source_post.avg.filter; cfg.lcmv.keepfilter='no'; cfg.keeptrials = 'yes'; cfg.vol = vol.vol; cfg.grad=grad.grad; cfg.lcmv.lambda='5%'; source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); source_post_cond1.avg.nai = source_post_cond1.avg.pow./source_pre_cond1.avg.pow; %PLOT source_post_cond1.pos = template.pos; source_post_cond1.dim = template.dim; source_post_cond1.xgrid = template.xgrid; source_post_cond1.ygrid = template.ygrid; source_post_cond1.zgrid = template.zgrid; cfg = []; cfg.parameter =' avg.nai'; interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); cfg = []; cfg.funparameter = 'nai'; cfg.method = 'ortho'; cfg.location = 'max'; cfg.funcolorlim = [1.5 2.0]; ft_sourceplot (cfg,interp_cond1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I also tried it using rawtrials, but with the same outcome (no activation visible in sourceplot). As I said, doing the same thing for cond1 without using the common filter works perfectly fine. Does anybody have an idea what might be my mistake?. Thank you a lot for your help! Ninja -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Thu Jan 24 17:29:09 2013 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 24 Jan 2013 17:29:09 +0100 Subject: [FieldTrip] postdoc and PhD position in comp neuroscience & MEG/EEG methods, Jena, Germany References: <2059450434.7696.1358875351785.JavaMail.root@zimbra> Message-ID: Begin forwarded message: > Dear FieldTrip community, > > We are inviting applications for a postdoctoral and a PhD student position in the Computational Neuroscience & Magnetoencephalography group at the Biomagnetic Centre (http://www.biomag.uni-jena.de), Friedrich-Schiller-University of Jena, Germany. > > The successful candidates will develop novel analysis methods for Magneto- and Electroencephalography (MEG/EEG) such as connectivity analysis, source reconstruction and advanced single trial analysis. The positions are devoted to research only without any teaching or administrative duties. The work will be done in collaboration with the MEG and theoretical neuroscience groups at the Wellcome Trust Centre for Neuroimaging in London, UK. These positions are ideal for candidates with a computational/theoretical background and a strong interest in collaborating with experimental researchers in neuroimaging. > > The lab runs a 306 channels MEG (Neuromag Vectorview) with 128 integrated EEG sensors, a high-density EEG system, and high-performing compute servers. In addition the group has access to a research-only 3T MRI-scanner. All experimental facilities (MEG, EEG, MRI) are supported by experienced physics and IT staff. > > The applicants should have worked in neuroscience before and be motivated to work in a multidisciplinary team (e.g. mathematicians, engineers, psychologists, physicians). > > The postdoc applicant must have a PhD (or equivalent) in computational neuroscience, physics, or a related field and should, ideally, have expertise in EEG or MEG and nonlinear dynamical systems. The PhD student should have a mathematically oriented background in computational neuroscience, physics, or a related field but students with a cognitive neuroscience, psychology, or related background will be considered as well. > > The starting dates for both positions are flexible. Salary is based on German Public service regulations (postdoc TV-L E13, PhD student TV-L E13 65%). The postdoc position is initially for two years with possible extension; the PhD position is for three years with one year possible extension. > > Interested candidates are encouraged to get in touch at their earliest convenience. Applications are considered until 15th of March 2013 but reviewing of the applications will start immediately. > > For questions or an informal discussion about these positions please contact Prof. Stefan Kiebel (skiebel at biomag.uni-jena.de). > > The following documents should be included in the application in a single PDF-file and sent by email to skiebel at biomag.uni-jena.de: A cover letter including a brief description of personal qualifications and future research interests, curriculum vitae, and contact details of two personal references. > > > -- > Prof. Dr. Stefan Kiebel > Biomagnetic Center > Hans Berger Dept of Neurology > Jena University Hospital, Germany > Tel.: +49 (0) 3641 9325770 > http://www.biomag.uni-jena.de From johanna.zumer at donders.ru.nl Thu Jan 24 17:30:35 2013 From: johanna.zumer at donders.ru.nl (Johanna Zumer) Date: Thu, 24 Jan 2013 17:30:35 +0100 Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> References: <8CFC8649CDC909A-1708-662F@webmail-m001.sysops.aol.com> Message-ID: Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Thu Jan 24 22:03:05 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 16:03:05 -0500 Subject: [FieldTrip] evoked power greater than total power Message-ID: Hi All, I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? Cheers - Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 22:45:04 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 14:45:04 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From russgport at gmail.com Thu Jan 24 23:07:35 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 17:07:35 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don wrote: > Russ, > > It might help if you posted a bit of your script so that we could see how > you are deriving the measures. But, the relationship you state is true only > given a couple of assumptions. First it depends on how you define induced > power. For some, induced power is the total signal, phase-locked and > non-phase-locked, i.e., the average in the frequency domain. So in that > sense, induced = total. If you are going with the notion that induced = > total - evoked, then yes, you would expect that evoked power would always > necessarily be less than or equal to total power. But second, that > relationship only holds up if you do not baseline correct the power > estimates you are comparing, which is often done in time-frequency > analyses. As far as I recall, in ft_freqanalysis there is no particular > option to return only induced or evoked power in the way that you mention > it, but certainly it could be calculated from the output of that function. > So if you let us know what your cfg options were and subsequent > calculations, it might be more helpful. > > Best, > > Don > ----------------------- > Don Rojas, Ph.D. > UCD Magnetoencephalography Lab > University of Colorado Denver Anschutz Medical Campus > 13001 E. 17th Pl F546 > Aurora, CO 80045 > USA > > > On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > > > Hi All, > > > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both in-vivo > EEG recordings in animals and MEG in children, through freqanalysis. I have > the strange result though that my total power (in either mV^2 or nAm^2) is > less than my evoked power. How can this be, if total=evoked+induced. I am > assuming that something that I have done while handling the data is causing > this error, but I have check my work very carefully. Has anyone ever seen > anything like this before, or can suggest what I am doing to help point me > in the right direction? > > > > Cheers - Russ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Thu Jan 24 23:17:45 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Thu, 24 Jan 2013 15:17:45 -0700 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <28BB4648-B4D2-42EA-8E9D-19201531EE49@ucdenver.edu> Yes, I think it is the baseline correction you are doing. Try the comparison without the correction and see if that makes more sense. If there is still a non-trivial difference, then it might be a more interesting problem. On Jan 24, 2013, at 3:07 PM, Russell G Port wrote: So my script generally goes preprocessing: cfg.trialfun='ft_trialfun_general' cfg.trialdef.eventvalue=65 cfg.trialdef.prestim=1 cfg.trialdef.poststim=2 cfg.trialdef.eventtype='untitled' cfg=ft_definetrial(cfg) cfg.demean='yes' cfg.outputfile= ------- data=ft_preprocessing(cfg) then from this output I do two different things, first I produced the time locked data: [timelock] = ft_timelockanalysis(cfg, data) For this new variable I then run the ft_freqanalysis with the following settings: cfg.method='wavelet' cfg.toi=[-.8:0.001666666666666667:1.5] cfg.foi= 5:0.95:100 cfg.width=3:0.03:6 cfg.polyremoval=-1 and so this gives me the evoked power for the total power instead i take the data from the preprocessing function (called data above) and repeat the exact same frequency transformation (same cfg setting/same called function) Once this is done, I convert both to dB scale using freqbaseline (-.2 to 0) and perforimg log10*10 operation of the data. Its here where suddenly total power is less than evoked power. I assume then its the baseline correction (since the total power has considerably more baseline activity (activity in the -.2 to 0 time window)) that creates an 'artificially' lower total power to evoked power. On Thu, Jan 24, 2013 at 4:45 PM, Rojas, Don > wrote: Russ, It might help if you posted a bit of your script so that we could see how you are deriving the measures. But, the relationship you state is true only given a couple of assumptions. First it depends on how you define induced power. For some, induced power is the total signal, phase-locked and non-phase-locked, i.e., the average in the frequency domain. So in that sense, induced = total. If you are going with the notion that induced = total - evoked, then yes, you would expect that evoked power would always necessarily be less than or equal to total power. But second, that relationship only holds up if you do not baseline correct the power estimates you are comparing, which is often done in time-frequency analyses. As far as I recall, in ft_freqanalysis there is no particular option to return only induced or evoked power in the way that you mention it, but certainly it could be calculated from the output of that function. So if you let us know what your cfg options were and subsequent calculations, it might be more helpful. Best, Don ----------------------- Don Rojas, Ph.D. UCD Magnetoencephalography Lab University of Colorado Denver Anschutz Medical Campus 13001 E. 17th Pl F546 Aurora, CO 80045 USA On Jan 24, 2013, at 2:03 PM, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip people will already know whats going on. I run my data, from both in-vivo EEG recordings in animals and MEG in children, through freqanalysis. I have the strange result though that my total power (in either mV^2 or nAm^2) is less than my evoked power. How can this be, if total=evoked+induced. I am assuming that something that I have done while handling the data is causing this error, but I have check my work very carefully. Has anyone ever seen anything like this before, or can suggest what I am doing to help point me in the right direction? > > Cheers - Russ > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ----------------------- Don Rojas, Ph.D. Associate Professor of Psychiatry U. of Colorado Denver Anschutz Medical Campus Director, UCD Magnetoencephalography Lab 13001 E. 17th Pl F546 Aurora, CO 80045 303-724-4994 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.craddock at uni-leipzig.de Thu Jan 24 23:24:45 2013 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Thu, 24 Jan 2013 23:24:45 +0100 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: References: Message-ID: <5101B4AD.30901@uni-leipzig.de> On 24/01/2013 22:03, Russell G Port wrote: > Hi All, > > I am currently trying to understand something and I think fieldtrip > people will already know whats going on. I run my data, from both > in-vivo EEG recordings in animals and MEG in children, through > freqanalysis. I have the strange result though that my total power (in > either mV^2 or nAm^2) is less than my evoked power. How can this be, if > total=evoked+induced. I am assuming that something that I have done > while handling the data is causing this error, but I have check my work > very carefully. Has anyone ever seen anything like this before, or can > suggest what I am doing to help point me in the right direction? > > Cheers - Russ > Hi Russ, I'm guessing you mean after baseline correction. Evoked and total have very different baselines: with evoked power, pre-stim-onset power is usually pretty much 0, since there shouldn't really be anything time/phase-locked in this period. That's not the case for total power. If you're doing relative measures of change from baseline this difference can be ENORMOUS - for example, I often see evoked power 500 times greater than baseline compared to, say, a 20% increase in total power (this is in the gamma band range). On the single trial level, the evoked, such as it is, contributes very little to the overall signal - averaging out the noise/background/non-phase-locked activity is what makes it stand out. one way people sometimes isolate induced activity is to remove the ERP from each trial before doing the TF; if you do it that way and compare it to total power, you should see that it makes very little difference (which is one reason why I prefer not to do it, another being that it rests on a faulty assumption - that the ERP is stationary and the same on each trial). Basically, there's nothing wrong here. Cheers, Matt -- Dr. Matt Craddock Post-doctoral researcher, Institute of Psychology, University of Leipzig, Seeburgstr. 14-20, 04103 Leipzig, Germany Phone: +49 341 973 95 44 From caulveil at gmail.com Thu Jan 24 23:32:56 2013 From: caulveil at gmail.com (Jacob Martin) Date: Thu, 24 Jan 2013 17:32:56 -0500 Subject: [FieldTrip] Realtime problems with intensive computations and data loss due to buffer expiration Message-ID: Hello, I have written a Matlab StreamExtractor Class that reads data from the Fieldtrip buffer and then "notifies" various other Matlab component classes that new BCI data is available so that the class can analyze it (e.g. a Signal Viewer component could show the data so far, a Classifier component could classify the newest data, etc). The problem I am having is that since Matlab is single threaded, when the notify method is called, and the notified component does a computationally intense operation (e.g. building a classifier), then by the time that the notify() method returns to the StreamExtractor, many data samples can be lost. It is as if I am limited to very short operations that will return "in time" to catch all the samples that are in the buffer. I have thought to use parallel processing to allow "notify" to return quickly, but that strategy is made difficult with GUIs because pmode processes in Matlab do not have access to graphics. More imporantly, there is some overhead due to launching the parallel processes and executing many notify commands, which may ultimately cause the StreamExtractor class to again miss data if too many classes are listening and being notified by the StreamExtractor. I could "live downsample" the data (currently using 2048hz), but I would prefer to keep 2048hz and just increase the buffer size if possible so that all events will be recorded, regardless of how much time each component takes to return. Is there a way to increase the default buffer size in Fieldtrip so that I will not lose data due to computationally intense operations being executed intermittently during the stream? Does anyone have any other ideas? I'm almost at a loss here... Best wishes, Jacob From mcgoiv0 at wfu.edu Fri Jan 25 01:55:54 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Thu, 24 Jan 2013 19:55:54 -0500 Subject: [FieldTrip] CTF MEG data anonymization In-Reply-To: References: <51002572.9090908@kurage.nimh.nih.gov> Message-ID: Thanks Tom and Arjen! I used -anon with newDs, it works fine. Thanks, Inna Thanks, Inna On Wed, Jan 23, 2013 at 1:08 PM, Arjen Stolk wrote: > Hi Inna, > > Have a look here > > http://fieldtrip.fcdonders.nl/faq/how_can_i_anonimize_a_ctf_dataset > > Yours, > Arjen > > 2013/1/23 Tom Holroyd (NIH/NIMH) [E] > > Use the CTF tool newDs with the -anon option. >> >> McGowin, Inna wrote: >> >>> Hello, >>> >>> Does anybody know *how to anonymize CTF MEG scans* (all patient's info >>> must be removed from the file)? >>> >>> I have tools for the DICOM format but not for CTF formats. >>> >>> Thanks! >>> -- >>> Inna >>> >>> >>> ------------------------------**------------------------------** >>> ------------ >>> >>> ______________________________**_________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >>> >> >> -- >> The white knight is talking backwards. >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Jan 25 02:57:37 2013 From: russgport at gmail.com (Russell G Port) Date: Thu, 24 Jan 2013 20:57:37 -0500 Subject: [FieldTrip] evoked power greater than total power In-Reply-To: <5101B4AD.30901@uni-leipzig.de> References: <5101B4AD.30901@uni-leipzig.de> Message-ID: thanks everyone, I was starting to get a little nervous On Thu, Jan 24, 2013 at 5:24 PM, Matt Craddock wrote: > On 24/01/2013 22:03, Russell G Port wrote: > >> Hi All, >> >> I am currently trying to understand something and I think fieldtrip >> people will already know whats going on. I run my data, from both >> in-vivo EEG recordings in animals and MEG in children, through >> freqanalysis. I have the strange result though that my total power (in >> either mV^2 or nAm^2) is less than my evoked power. How can this be, if >> total=evoked+induced. I am assuming that something that I have done >> while handling the data is causing this error, but I have check my work >> very carefully. Has anyone ever seen anything like this before, or can >> suggest what I am doing to help point me in the right direction? >> >> Cheers - Russ >> >> > Hi Russ, > > I'm guessing you mean after baseline correction. Evoked and total have > very different baselines: with evoked power, pre-stim-onset power is > usually pretty much 0, since there shouldn't really be anything > time/phase-locked in this period. That's not the case for total power. If > you're doing relative measures of change from baseline this difference can > be ENORMOUS - for example, I often see evoked power 500 times greater than > baseline compared to, say, a 20% increase in total power (this is in the > gamma band range). On the single trial level, the evoked, such as it is, > contributes very little to the overall signal - averaging out the > noise/background/non-phase-**locked activity is what makes it stand out. > one way people sometimes isolate induced activity is to remove the ERP from > each trial before doing the TF; if you do it that way and compare it to > total power, you should see that it makes very little difference (which is > one reason why I prefer not to do it, another being that it rests on a > faulty assumption - that the ERP is stationary and the same on each trial). > Basically, there's nothing wrong here. > > Cheers, > Matt > -- > Dr. Matt Craddock > > Post-doctoral researcher, > Institute of Psychology, > University of Leipzig, > Seeburgstr. 14-20, > 04103 Leipzig, Germany > Phone: +49 341 973 95 44 > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ninja78278 at aol.com Fri Jan 25 09:25:34 2013 From: ninja78278 at aol.com (Ninja Katja Horr) Date: Fri, 25 Jan 2013 03:25:34 -0500 (EST) Subject: [FieldTrip] lcmv beamform with common filter In-Reply-To: References: Message-ID: <8CFC8ECAE12D748-1708-DAE2@webmail-m001.sysops.aol.com> Hi Johanna, yes, of course, that was my mistake! Thank you :-)!!! Now it is working! 'nai' as cfg.funparameter is working fine. I think I also tried 'avg.nai' in the beginning and got an error. All the best, Ninja -----Original Message----- From: fieldtrip-request To: fieldtrip Sent: Thu, Jan 24, 2013 5:32 pm Subject: fieldtrip Digest, Vol 26, Issue 35 ------------------------------ Message: 3 Date: Thu, 24 Jan 2013 17:30:35 +0100 From: Johanna Zumer To: FieldTrip discussion list Subject: Re: [FieldTrip] lcmv beamform with common filter Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Ninja, Not counting the issues with ft_sourceplot, my first observation is that I think you are confusing what is common for the common filter that you are creating. source_post.avg.filter is common over both conditions for the post-stimulus window only, meaning that it can be applied to source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1) or source_post_cond2 = ft_sourceanalysis (cfg,timelock_post_cond2) But not to source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1);. You need a filter computed from source_pre for this. Alternativey, have 1 overall filter common to both condtions and both time windows. (i.e. Use the time window [-.2 .2] and all conditions to create this filter). Specific to your sourceplot question, I'm less familiar with this, and hopefully someone else can answer, but is it a problem that you call cfg.funparameter = 'nai';? or does it need to be 'avg.nai'? Cheers, Johanna 2013/1/24 Ninja Katja Horr > Dear Fieldtrip-Users, > > I am trying to do lcmv beamform sourceanalysis with a common filter for > all conditions (same session, different trials defined with ft_preprocessing > belong to different conditions,sequence of conditions randomly intermixed > for each block). > However if I use the common filter calculated from one block (consisting of > 57 trials) ft_sourceplot doesn't show any activity anymore (if I run each > condition separately without common filters it is working). > > Here is how I proceed: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % MAKE TIMELOCKANALYSIS FOR COMPLETE BLOCK > > cfg = []; > cfg.channel='MEG'; > cfg.keeptrials='yes'; > cfg.blc='yes'; > cfg.blcwindow = [-0.2 0] > data = ft_timelockanalysis(cfg,data); > > cfg = []; > cfg.channel = 'MEG' > cfg.covariance ='yes'; > cfg.covariancewindow = [0 0.2]; > cfg.removemean = 'no'; > cfg.keeptrials = 'yes'; > timelock_post = ft_timelockanalysis(cfg,data); > cfg.covariancewindow = [-0.2 0]; > timelock_pre = ft_timelockanalysis(cfg,data); > > %MAKE SOURCEANALYSIS FOR COMPLETE BLOCK AND KEEP FILTER > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.vol = vol.vol; > cfg.grad = grad.grad; > cfg.keeptrials='yes'; > cfg.lcmv.lamda = '5%'; > cfg.lcmv.keepfilter = 'yes'; > source_post = ft_sourceanalysis(cfg,timelock_post); > source_pre = ft_sourceanalysis(cfg,timelock_pre); > > source_post.avg.nai = source_post.avg.pow./source_pre.avg.pow; > > %MAKE TIMELOCKANALYSIS OF SPECIFIC CONDITIONS > > cfg = []; > cfg.trials=cond1; %this picks out the trials belonging to condition1 > cfg.channel ='MEG'; > cfg.keeptrials='yes'; > cfg.blc = 'yes'; > cfg.blcwindow = [-02 0]; > data=ft_timelockanalysis(cfg,data); > > cfg =[]; > cfg.channel='MEG'; > cfg.covariance='yes'; > cfg.covariancewindow=[0 0.2]; > cfg.removemean ='no'; > cfg.keeptrials='yes'; > timelock_post_cond1 = ft_timelockanalysis(cfg,data); > timelock_pre_cond1 = ft_timelockanalysis(cfg,data); > > %MAKE SOUCEANALYSIS OF SPECIFIC CONDITION USING THE COMMON FILTER OF THE > BLOCK > > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid.grid; > cfg.grid.filter=source_post.avg.filter; > cfg.lcmv.keepfilter='no'; > cfg.keeptrials = 'yes'; > cfg.vol = vol.vol; > cfg.grad=grad.grad; > cfg.lcmv.lambda='5%'; > > source_post_cond1 = ft_sourceanalysis (cfg,timelock_post_cond1); > source_pre_cond1 = ft_sourceanalysis (cfg,timelock_pre_cond1); > > source_post_cond1.avg.nai = > source_post_cond1.avg.pow./source_pre_cond1.avg.pow; > > %PLOT > > source_post_cond1.pos = template.pos; > source_post_cond1.dim = template.dim; > source_post_cond1.xgrid = template.xgrid; > source_post_cond1.ygrid = template.ygrid; > source_post_cond1.zgrid = template.zgrid; > > cfg = []; > cfg.parameter =' avg.nai'; > interp_cond1 = ft_sourceinterpolate (cfg,source_post_cond1,mri); > > cfg = []; > cfg.funparameter = 'nai'; > cfg.method = 'ortho'; > cfg.location = 'max'; > cfg.funcolorlim = [1.5 2.0]; > > ft_sourceplot (cfg,interp_cond1); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > I also tried it using rawtrials, but with the same outcome (no activation > visible in sourceplot). > As I said, doing the same thing for cond1 without using the common filter > works perfectly fine. > > Does anybody have an idea what might be my mistake?. > > Thank you a lot for your help! > > Ninja > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 26, Issue 35 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Sat Jan 26 12:42:10 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sat, 26 Jan 2013 11:42:10 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , , , Message-ID: Hi Gianpaolo (or anyone else that can help me out again), Again, thank you very much for putting me onto mne_ex_read_write_raw.m. Unfortunately I am still having problems. Because I appear to have been not too forthcoming in my original email, the problem is with the triggering in our neuromag triux (306 channel) system, I'm having triggers add onto each other and others fail to register with the trigger channels. I've written a script to read in the trigger information from my stimuli presentation software and want to write the accurate data to the main trigger channel (STI101), then save as a new fiff file. By adding code from mne_ex_read_write_raw.m to my overall script (reading the entire data set into memory at once), I'm able to replace the questionable STI101 data with that obtained from my stim software, but have a problem when writing the new fiff file. The size of the input file is ~2gb but when writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of redundant data, but am unable to open the new file, even on a machine running 16gb RAM. I've attached the script and would be extremely grateful for any advice that could be given. Thanks again to everyone on the mailing list whose helped me out so far, Peter. _________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Peter Goodin [pgoodin at swin.edu.au] Sent: Thursday, 24 January 2013 11:05 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Gianpaolo, Wonderful! This is exactly what I'm after! Thank you very much for pointing me in the correct direction! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Demarchi, Gianpaolo [gianpaolo.demarchi at unitn.it] Sent: Thursday, 24 January 2013 9:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment Hi Peter, for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file: mne_ex_read_write_raw.m which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained. Basically, I just copied and pasted the relevant lines, and put some intelligence in the % % You can add your own miracle here % part (namely, changing accordingly the data(channel, time) matrix). It's straightforward, but just post back in case of need ... Best luck, GP Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin > ha scritto: Hi Alex, Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to fh.info.ch or any other aspect of fh? Thanks and sorry for the confusion again. Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Thursday, 24 January 2013 5:38 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, when you add channels to a fif structure you need to update the measurement information (channels names, types etc.). With your notations you should update fh.info.chs hope this helps Alex On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin > wrote: Hi Fieldtrip list, I'm trying to add an altered channel and save it as a new fiff file using the MNE commands from the external/MNE dir in Fieldtrip, but seem to just keep getting the data from the old fiff file instead. The code I'm currently using is: To read: fh = fiff_setup_read_raw('input.fif'); f = fiff_read_raw_segment(fh); After adding in the altered channel data to f, I then use: fiff_write_raw_segment(output.fif, fh); What I thought would happen is output.fif would use the information in f and fh to write output.fif, but what seems to be happening is the data in f is being ignored. Does anyone have any ideas on how to insert the altered channel data then write it back out as a fiff file? Thanks, Peter. __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------------------ Gianpaolo Demarchi, PhD gianpaolo.demarchi at unitn.it MEG Lab phone: 0039 0461 28 30 76 CIMeC - Mind/Brain Center University of Trento Via delle Regole, 101 I-38100 Mattarello di Trento (TN), Italy ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: trigchange.m URL: From caspervanheck at gmail.com Sat Jan 26 17:05:28 2013 From: caspervanheck at gmail.com (Casper van Heck) Date: Sat, 26 Jan 2013 17:05:28 +0100 Subject: [FieldTrip] Source localization In-Reply-To: References: <51644.131.174.45.70.1358523805.squirrel@131.174.45.70> <0BD0EECD-D21C-44A4-AAFE-E066AAB3FDE6@donders.ru.nl> Message-ID: Dear Hanneke, But data.anatomy doesn't exist; I added it through the line *data.anatomy = mri.anatomy; clear mri*, but originally it does not have any. I'm going to take a look at earlier steps to find out why this field isn't there in the first place (assuming it should be). Sincerely, Casper On Wed, Jan 23, 2013 at 12:19 PM, Hanneke van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Hi Casper, > > The cfg.anaparameter should then be 'anatomy'. It refers to the field (in > data) in which the anatomy can be found, in your case: data.anatomy. > > Hope this helps, > > Hanneke > Op 23 jan. 2013 10:57 schreef "Casper van Heck" > het volgende: > > Dear Jan-Mathijs, >> >> Since ft_sourceplot complained about not having anatomy (or functional) >> parameter, and it seems to default to a field named '*data.anatomy'*, I >> assumed adding *mri.anatomy* in *data.anatomy* would suffice. >> >> But, without this, ft_sourceplot would again require an anatomy >> parameter, so that would mean that I need to ut '*cfg.anaparameter = mri*' >> in the cfg I feed to ft_sourceplot, where 'mri' is the result from >> ft_volumereslice. >> However, ft_sourceplot then says "*do not understand cfg.anaparameter*", >> and thus it is not plotting "*anatomy*". After looking back to the >> plotting tutorial where I read "The anatomy can be read with ft_read_mri", >> I'm not quite sure what's going wrong. >> >> Sincerely, >> >> Casper >> >> >> >> On Tue, Jan 22, 2013 at 9:49 AM, jan-mathijs schoffelen < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hi intersect(everyone, casper) >>> >>> Everyone, >>> >>> While the whole script is way too convoluted to put up here, but luckily >>> the relevant steps are quite simple >>> Input is simply raw data, read with ft_preprocessing, which is passed >>> through functions as shown in my previous email. >>> >>> After passing the data to ft_sourcegrandaverage (only using >>> cfg.outputfile), where the data is fed as a cell array (which seems to work >>> properly), I go over to a source-comparison script. This script works as >>> follows: >>> First I create a pre-post contrast as shown in the beamformer tutorial. >>> >>> Next, I read some MRI-data using ft_read_mri from a standard folder, and >>> reslice this data: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); >>> * >>> *mri = ft_volumereslice([], mri);* >>> >>> Then: >>> *[data] = ft_sourceinterpolate(cfg, data, mri); >>> * >>> where cfg contains: >>> *cfg.parameter: 'avg.pow'* >>> *cfg.downsample: 4* >>> >>> and I add the anatomy: >>> *data.anatomy = mri.anatomy; clear mri* >>> >>> >>> Putting mri.anatomy into data.anatomy is probably not what you want to >>> do: the whole point about ft_sourceinterpolate is to get the functional and >>> anatomical data in the same 'pixel-space'; this is the only way that >>> ft_sourceplot (as of yet) can deal with it. The reason is that now the >>> functional data is sampled once every 4 voxels, relative to the anatomy. I >>> guess that this causes your problem in ft_sourceplot. >>> >>> >>> >>> Best wishes, >>> >>> Jan-Mathijs >>> >>> >>> >>> And finally, I call ft_sourceplot using these options: >>> >>> cfg.*parameter: 'avg.pow';* >>> >>> *cfg.downsample: 4* >>> >>> * >>> * >>> >>> with one of these three methods: >>> 1) *cfg.method = 'surface';* >>> * cfg.surffile = 'surface_l4_both.mat';* >>> * cfg.surfdownsample = 4;* >>> * cfg.projmethod = 'nearest';* >>> 2) *cfg.method = 'ortho';* >>> 3) *cfg.method = 'slice';* >>> * cfg.nslices = 20;* >>> Which leads to the errors shown earlier. At this point, disp(data) >>> yields: >>> *K>> disp(data)* >>> * avg: [1x1 struct]* >>> * pos: [16777216x3 double]* >>> * dim: [256 256 256]* >>> * inside: [1x16777216 double]* >>> * outside: [1x0 double]* >>> * coordsys: 'ctf'* >>> * unit: 'mm'* >>> * cfg: [1x1 struct]* >>> * anatomy: [256x256x256 double]* >>> * >>> * >>> I'm guessing it has something to do with the 'inside' and 'outside' >>> elements, so my 'standard head model'. I think I made this using the >>> following code: >>> *mri = ft_read_mri(strcat(h.subject,'Subject01.mri')); % load >>> 'standard' anatomical model >>> * >>> * >>> * >>> *% segment the template brain and construct a volume conduction model >>> (i.e. head model)* >>> *cfg = [];* >>> *cfg.output = {'brain' 'scalp' 'skull'};* >>> *cfg.downsample = 2;* >>> *t_seg = ft_volumesegment(cfg, mri);* >>> * * >>> *% create head model* >>> *cfg = [];* >>> *cfg.method = 'singlesphere';* >>> *cfg.hdmfile = strcat(h.subject,'Subject01.hdm');* >>> *cfg.elec = ft_read_sens('standard_1020.elc');* >>> *t_vol = ft_prepare_headmodel(cfg, t_seg);* >>> *clear template_seg* >>> * >>> * >>> *% construct the dipole grid in the template brain coordinates* >>> *cfg = [];* >>> *cfg.normalize = 'no'; % no normalization, since we're comparing two >>> conditions THAT'S RIGHT I DID PAY ATTENTION* >>> *cfg.vol = t_vol;* >>> *t_grid = ft_prepare_sourcemodel(cfg);* >>> * >>> * >>> After which I use this on all subjects, using this (note that I store >>> all data in a single massive structure, to make saving to disk and >>> selecting data etc. easier): >>> *source{subj}.(datasets{d}) = sourceanalysis(data, t_vol, t_grid);* >>> * >>> * >>> Anyone seeing anything obviously stupid? >>> >>> Sincerely, >>> >>> Casper >>> >>> >>> On Fri, Jan 18, 2013 at 4:43 PM, wrote: >>> >>>> Hi Casper, >>>> >>>> I think it is really difficult to figure only from the error message >>>> what >>>> the problem is. I think it would be also useful to see the inputs (cfg, >>>> and your data) of ft_sourceplot. Could you just send me how your cfg and >>>> your data-structure looks like? (I mean that you do not need to send the >>>> actual data, just the screen output of disp(data) and disp(cfg)). >>>> >>>> Best, >>>> Lilla >>>> >>>> >>>> > Dear Fieldtrippers, >>>> > >>>> > I've asked this question earlier, but either it got lost due to >>>> technical >>>> > reasons, or the people who actually understand what's happening here >>>> were >>>> > on vacation, so here it is again: >>>> > >>>> > I've been trying to do a source analysis on a dataset with two >>>> conditions, >>>> > mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> > come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> > essential component of the analysis of this dataset (it's more along >>>> the >>>> > lines of "let's see if I can do this"), and I don't expect any result >>>> > other >>>> > than something like "there might be a source in the left hemisphere", >>>> I'd >>>> > still would like to found out why it's not working. >>>> > >>>> > Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> > MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> > ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> Fieldtrip >>>> > to find sources based on individual EEG-datasets using ft_freqanalysis >>>> > (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> > After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> average >>>> > source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> > >>>> > Now, ft_sourceplot has three plotting possibilities: slice, ortho, and >>>> > surface. Initially I tried to get the ortho-option to work, but this >>>> gave >>>> > the following error: >>>> > *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> > *Error in ==> cornerpoints at 11 >>>> > * >>>> > *Error in ==> ft_plot_slice at 157 >>>> > * >>>> > >>>> > So, I tried the surf-option, which gave me this: >>>> > *Undefined function or variable "val".* >>>> > *Error in ==> ft_sourceplot at 1174 >>>> > * >>>> > >>>> > And finally, I tried the slice-option, which gave one of two errors >>>> (which >>>> > seems to be based on how many slices I requested): >>>> > *Out of memory* >>>> > Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> > topping of at 40GB >>>> > Or, the mildly disconcerting: >>>> > *Matlab has encountered an internal error and has to close* >>>> > Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> > * >>>> > >>>> > Can anyone offer any insight in these errors? I think I'm doing >>>> something >>>> > wrong pretty early on, but have no idea what it is. >>>> > >>>> > Sincerely, >>>> > >>>> > Casper van Heck >>>> > >>>> > >>>> > On Fri, Dec 21, 2012 at 1:43 PM, Casper van Heck >>>> > wrote: >>>> > >>>> >> Dear Fieldtrippers, >>>> >> >>>> >> I've been trying to do a source analysis on a dataset with two >>>> >> conditions, >>>> >> mostly following the tutorials and examples from the Fieldtrip site, >>>> and >>>> >> come upon a problem; it won't plot. While the source analysis is not >>>> an >>>> >> essential component of the analysis of this dataset (it's more along >>>> the >>>> >> lines of "let's see if I can do this"), and I don't expect any result >>>> >> other >>>> >> than something like "there might be a source in the left hemisphere", >>>> >> I'd >>>> >> still would like to found out why it's not working. >>>> >> >>>> >> Essentially, I create a standard headmodel cause I don't have >>>> individual >>>> >> MRI's from the "Subject1.mri"-example, using ft_volumesegment, >>>> >> ft_prepare_headmodel and ft_prepare_sourcemodel, and try to get >>>> >> Fieldtrip >>>> >> to find sources based on individual EEG-datasets using >>>> ft_freqanalysis >>>> >> (with cfg.method = 'mtmfft') and ft_sourceanalysis. >>>> >> After that, I use ft_sourcegrandaverage to produce, well, a grand >>>> >> average >>>> >> source, and feed this via ft_sourceinterpolate to ft_sourceplot. >>>> >> >>>> >> Now, ft_sourceplot has three plotting possibilities: slice, ortho, >>>> and >>>> >> surface. Initially I tried to get the ortho-option to work, but this >>>> >> gave >>>> >> the following error: >>>> >> *Attempted to access dim(3); index out of bounds because >>>> numel(dim)=2.* >>>> >> *Error in ==> cornerpoints at 11 >>>> >> * >>>> >> *Error in ==> ft_plot_slice at 157 >>>> >> * >>>> >> >>>> >> So, I tried the surf-option, which gave me this: >>>> >> *Undefined function or variable "val".* >>>> >> *Error in ==> ft_sourceplot at 1174 >>>> >> * >>>> >> >>>> >> And finally, I tried the slice-option, which gave one of two errors >>>> >> (which >>>> >> seems to be based on how many slices I requested): >>>> >> *Out of memory* >>>> >> Which is pretty damn impressive since I've got 8GB of RAM and a >>>> pagefile >>>> >> topping of at 40GB >>>> >> Or, the mildly disconcerting: >>>> >> *Matlab has encountered an internal error and has to close* >>>> >> Which seems to have been caused by a so-called *"Segmentation >>>> violation" >>>> >> * >>>> >> >>>> >> Can anyone offer any insight in these errors? I think I'm doing >>>> >> something >>>> >> wrong pretty early on, but have no idea what it is. >>>> >> >>>> >> Sincerely, >>>> >> >>>> >> Casper van Heck >>>> >> >>>> > _______________________________________________ >>>> > fieldtrip mailing list >>>> > fieldtrip at donders.ru.nl >>>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> Jan-Mathijs Schoffelen, MD PhD >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Cognitive Neuroimaging, >>> Radboud University Nijmegen, The Netherlands >>> >>> Max Planck Institute for Psycholinguistics, >>> Nijmegen, The Netherlands >>> >>> J.Schoffelen at donders.ru.nl >>> Telephone: +31-24-3614793 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at inria.fr Sun Jan 27 10:49:56 2013 From: alexandre.gramfort at inria.fr (Alexandre Gramfort) Date: Sun, 27 Jan 2013 10:49:56 +0100 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: Message-ID: hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex From dave at davebritton.com Sun Jan 27 22:21:17 2013 From: dave at davebritton.com (Dave Britton) Date: Sun, 27 Jan 2013 16:21:17 -0500 Subject: [FieldTrip] cfg.viewmode='reject' throws databrowser error Message-ID: <51059A4D.2050702@davebritton.com> In the following preprocessing, reject_visual and databrowse sequence, ft_reject_visual sets viewmode to 'reject' as a default (line 176), then when ft_databrowser is run, it throws an error upon finding viewmode='reject'. (from main routine semattn.m:) data = ft_preprocessing(cfg); cfg.layout='butterfly'; [data2] = ft_rejectvisual(cfg, data); data2.cfg.layout=cfg.layout; cfg = ft_databrowser(data2.cfg,data2); >> Error using ft_databrowser>redraw_cb (line 1713) unknown viewmode "remove" Error in ft_databrowser (line 685) redraw_cb(h); Error in semattn_main (line 76) cfg = ft_databrowser(data2.cfg,data2); Am I doing something wrong or is this a bug? -Dave From pgoodin at swin.edu.au Sun Jan 27 23:36:15 2013 From: pgoodin at swin.edu.au (Peter Goodin) Date: Sun, 27 Jan 2013 22:36:15 +0000 Subject: [FieldTrip] MNE fiff_read / write_raw_segment In-Reply-To: References: , Message-ID: Hi Alex, Thanks for letting me know! I'll try changing the precision and see how it goes! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 1, Old Baker Building Commercial Road Melbourne, Vic, 3004 ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Alexandre Gramfort [alexandre.gramfort at inria.fr] Sent: Sunday, 27 January 2013 8:49 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment hi Peter, > The size of the input file is ~2gb but when > writing, the output is approx ~18gb. I suspect I'm writing a WHOLE bunch of > redundant data, but am unable to open the new file, even on a machine > running 16gb RAM. what is likely to happen is that the matlab code writes data as double precision while the original neuromag data were in float 16. Note that a single fif file cannot exceed 2Go due to internal pointer arithmetic otherwise it will be broken. What you can do is hack the fif writing to make sure it's written back in float16. Best, Alex _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Mon Jan 28 13:07:08 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Mon, 28 Jan 2013 12:07:08 +0000 Subject: [FieldTrip] How to use ft_average_sens? Message-ID: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Hello Fieldtrippers, I get an error message when using ft_average_sens and couldn't find the solution on the ft homepage. Here is my short code: grad_01 = ft_read_sens('Run_01.ds') grad_02 = ft_read_sens('Run_02.ds') AvgGrad = ft_average_sens(grad_01, grad_02) And that's error message: ??? Error using ==> ft_getopt the first input should contain key-value pairs Anyone who can help me there? Thanks and best regards, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Mon Jan 28 13:11:10 2013 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 28 Jan 2013 12:11:10 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Jan 28 13:20:58 2013 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 28 Jan 2013 13:20:58 +0100 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn’t find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that’s error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tkietzma at uos.de Mon Jan 28 17:03:47 2013 From: tkietzma at uos.de (Tim Kietzmann) Date: Mon, 28 Jan 2013 17:03:47 +0100 Subject: [FieldTrip] Problems with Dipole Fitting Message-ID: Dear Mailing List, I am currently trying to use the ft_dipolefitting function to localize the source of a visually evoked response, and to use the dipole time-course to test for effects in source space. Along the way, however, a few questions and problems arose, which I was not yet able to solve despite excessive trying, reading and googling. Some of the questions are technical, others are more general. Please note that I am new to fieldtrip and source localization, so please excuse the potentially stupid ones. The general setup is that we have collected data using a CTF275 system, looking at visually evoked responses (we are showing drawings of faces). The data is cleaned already and we have a structural MRI scan for every subject, which we can use for individual headmodels (I use singleshell, and the models look perfectly fine). As every trial also contained a button-press I first fitted dipoles locked to this button-press as a sanity check. This worked nicely for all subjects. However, I am now looking into the visually evoked responses. This has given me a lot of trouble (see below). Here is the code I use for the actual fit: cfg=[]; cfg.numdipoles =2; cfg.symmetry = 'y'; %I use this, as I expect bilateral visual activations cfg.latency = [.1 .12]; cfg.vol = subvol_singleshell; %volume conduction model for the subject cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, ERF_all); Question 1: Dipole Time Courses To look at the individual time-courses of the dipoles I follow http://mailman.science.ru.nl/pipermail/fieldtrip/2011-April/003690.html and http://mailman.science.ru.nl/pipermail/fieldtrip/2012-May/005215.html. The returned dipole information in dip.pos is 2x3 (two dipoles, three dimensions), so I can easily pick the position of each of the two dipoles. The dip.mom, however has size 6x13. Is it correct that the first three values of source.dip.mom correspond to the first dipole, and 4:6 to the second dipole? That is, to show the two activations, can I do the following? dip_select=1; dip = source.dip.pos(dip_select,:); [u,s,v] = svd(source.dip.mom((1:3)+(dip_select-1)*3,:)); [vol, grad] = ft_prepare_vol_sens(subvol_singleshell, ERF_all.grad, 'channel', ERF_all.label); L = ft_compute_leadfield(dip, grad,vol,'reducerank',2); % leadfield Li = pinv(L); % pseudoinverse of L %check which orientation the dipole is in orientation_vector = u(:,1)'; Qn = double(orientation_vector/norm(orientation_vector)); % normed orientation vector Qn = repmat(Qn,length(Li),1)'; % make Qn the same size as Li W = dot(Li,Qn)'; % weights for projection to source space waveform = dot(ERF_all.avg,repmat(W,1,size(ERF_all.avg,2))); % source waveform Given this is correct, I noticed in the resulting waveforms that only one of the two dipoles shows a clear activation, whereas the other seems to cover mostly remaining noise. However, based on the perfectly symmetric topography of the activation and given this is a visual response (the M100), I would expect both hemispheres (and therefore both dipoles) to be activated. In fitting the dipole location and moment, is there some sort of regularization, which prefers one strong dipole over two equally active dipoles? Any ideas on this? Question 2: ICA topographies as basis for the fit Given I had quite some problems with the reliability of the fits when using the sensor data, I also tried fitting the dipoles to selected ICA components (namely the ones which explain most of the variance across sensors at a given time-point, the comp structure is given as is from ft_componentanalysis). This, however, lead to the following warning/error: cfg=[]; cfg.numdipoles =1; cfg.component = [17]; cfg.vol = subvol_singleshell;%volume conduction model cfg.model = 'regional'; [source] = ft_dipolefitting(cfg, comp); the input is component data with 271 components and 271 original channels using headmodel specified in the configuration using gradiometers specified in the data computing surface normals selected 0 channels selected 1 topographies Warning: not enough channels to perform a dipole fit I am sure this is a simple mistake, but could not yet successfully solve it. Could it have to do with the fact that the comp structure has a comp.topolabel the original sensor labels, and as comp.label the ICA labels ('runica001' ..)? Question 3: Sensor Averaging Since all else failed, I wanted to use the average gradient position across subjects together with the MNI standard brain to find the dipoles based on the Grand Average activation. Here, I would like to use the ft_average_sens function. However, I have the problem that different subjects were recorded with slightly different numbers of sensors (some with 271 sensors, some with 273). Because of this, the ft_average_sens function throws an error. Is there a way to select a subset of sensors from the grad structure such that I only use the sensors which were present for all subjects? Question 4: Stability of the Fit The toughest and most general question at last: I noticed that the solutions I get from ft_dipolefitting are not very robust. For instance, I get vastly different dipole locations with only subtle changes in the selected time-points. Moreover, although subjects show a clear M100 in sensor space, the dipole locations for some of them are extremely far off (if not to say in the middle of nowhere). Are there certain methods, tricks or tutorials I can look into to get things more robust? I am truly sorry to have so many questions, but any help is highly appreciated! I look very much forward to hearing from you Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 17:55:50 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 11:55:50 -0500 Subject: [FieldTrip] GE MRI platform 12.0 scans don't import into CTF MRIViewer Message-ID: Hello, We have an MRI research scan, GE MRI platform 12.0, that produces scans with some DICOM header fields missing. These fields are required in order to import the scan into CTF MRIViewer or DICOM_Viewer or some other software. Does anybody know if these missing fields can be somehow added to the DICOM header? Maybe in Matlab or through some conversion method? Thanks! -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Mon Jan 28 18:01:06 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 12:01:06 -0500 Subject: [FieldTrip] CTF MEG current phantom Message-ID: Hello, Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. It's made of plastic and suppose to be non-magnetic. Thanks, -- Inna -------------- next part -------------- An HTML attachment was scrubbed... URL: From Don.Rojas at ucdenver.edu Mon Jan 28 18:30:50 2013 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Mon, 28 Jan 2013 10:30:50 -0700 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: Message-ID: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> We don't use that phantom, but the 4D MEG phantom is similar in nature. If it is electrically disconnected, then perhaps the mounting of it is coupling in some vibration that is being picked up by your sensors due to some weakly magnetic component to the phantom or phantom mount. Are you certain that the origin of the signal is the phantom? On Jan 28, 2013, at 10:01 AM, "McGowin, Inna" wrote: > Hello, > Does anybody use the CTF MEG Current Phantom (with a current dipole inside) in their studies? > If yes, is it noise free? I discovered that even when it's empty and disconnected it produces noise at ~ 5, 10 and 10.8 Hz frequencies on the order of 100-300 fT. > > It's made of plastic and suppose to be non-magnetic. > Thanks, > -- > Inna > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mcgoiv0 at wfu.edu Mon Jan 28 19:59:34 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 13:59:34 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: Yes, I run all kind of scans: noise test (good), disconnected phantom (noisy), phantom with dipole removed (noisy), phantom with saline solution removed (noisy); dipole alone (good), saline alone (good). Below is the snapshot for Phantom with no saline solution or dipole: Thanks.[image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 61830 bytes Desc: not available URL: From mushfa.yousuf at googlemail.com Mon Jan 28 20:20:31 2013 From: mushfa.yousuf at googlemail.com (Mushfa Yousuf) Date: Mon, 28 Jan 2013 20:20:31 +0100 Subject: [FieldTrip] Combined EEG and MEG source reconstruction Message-ID: Hello Fieldtrippers, I am currently doing source analysis using beamformer method in fieldtrip. The data i work on is a simultaneous measurement of MEG (306) with EEG (128) on PD patients. I was successful in calculating the sources for both the modalities alone. I tried according the tutorial "Combined EEG and MEG source reconstruction" and was successful till the estimation of the lead field. But, then when i want to use the created vol for the source analysis i have two structures one for EEG and the second one for MEG. Now, i can only define only one to estimate the sources. How to use this for both the modalities? Any help would be appreciated. With regards Mushfa -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomh at kurage.nimh.nih.gov Mon Jan 28 20:44:43 2013 From: tomh at kurage.nimh.nih.gov (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 28 Jan 2013 14:44:43 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5106D52B.5050203@kurage.nimh.nih.gov> With no fluid I would hazard a guess that you are seeing building vibration. Try just putting a stiff wire under the helmet and see what kind of vibration you get. McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). -- The white knight is talking backwards. From mcgoiv0 at wfu.edu Tue Jan 29 01:28:07 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Mon, 28 Jan 2013 19:28:07 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5106D52B.5050203@kurage.nimh.nih.gov> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5106D52B.5050203@kurage.nimh.nih.gov> Message-ID: Thanks, I will try that. It seems like the plastic material of the phantom is contaminated with some magnetic impurities... Inna On Mon, Jan 28, 2013 at 2:44 PM, Tom Holroyd (NIH/NIMH) [E] < tomh at kurage.nimh.nih.gov> wrote: > With no fluid I would hazard a guess that you are seeing building > vibration. Try just putting a stiff wire under the helmet and see what kind > of vibration you get. > > > McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom (noisy), >> phantom with dipole removed (noisy), phantom with saline solution removed >> (noisy); dipole alone (good), saline alone (good). >> > > -- > The white knight is talking backwards. > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Tue Jan 29 08:21:30 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Tue, 29 Jan 2013 08:21:30 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> Message-ID: <5107787A.5030309@wwu.de> Hi Inna, did you fixate the cables and connectors of the Current Phantom? Are the cables twisted? Andreas On 01/28/13 19:59, McGowin, Inna wrote: > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From patrick.jung at esi-frankfurt.de Tue Jan 29 09:52:37 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:52:37 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309B6@UM-EXCDAG-A01.um.gwdg.de> Thanks, Eelke, that works fine. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: 28 January 2013 13:21 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Hi Patrick, Use it like this: sens(1) = grad_01; sens(2) = grad_02; AvgGrad = ft_average_sens(sens); so the first input argument has to be a structure array of the different sens structures you want to average. Best, Eelke On 28 January 2013 13:07, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From patrick.jung at esi-frankfurt.de Tue Jan 29 09:54:12 2013 From: patrick.jung at esi-frankfurt.de (Jung, Patrick) Date: Tue, 29 Jan 2013 08:54:12 +0000 Subject: [FieldTrip] How to use ft_average_sens? In-Reply-To: References: <36E953F5321EB743AC6B338995A56D6301E2E8F4@UM-EXCDAG-A01.um.gwdg.de> Message-ID: <36E953F5321EB743AC6B338995A56D6301E309C2@UM-EXCDAG-A01.um.gwdg.de> Thanks, Vladimir, that works. I did not understand that I have to concatenate the arrays. -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Vladimir Litvak Sent: 28 January 2013 13:11 To: FieldTrip discussion list Subject: Re: [FieldTrip] How to use ft_average_sens? Dear Patrick, I would start with reading the function's help which says: % Use as % [asens, afid] = ft_average_sens(sens) % where sens is a 1xN structure array containing N sensor arrays % % Additional options should be specified in key-value pairs and can be % 'weights' a vector of weights (will be normalized to sum==1) % 'fiducials' optional structure array of headshapes Therefore you should do: AvgGrad = ft_average_sens([grad_01, grad_02]); Best, Vladimir On Mon, Jan 28, 2013 at 12:07 PM, Jung, Patrick wrote: > Hello Fieldtrippers, > > > > I get an error message when using ft_average_sens > > and couldn't find the solution on the ft homepage. > > Here is my short code: > > > > grad_01 = ft_read_sens('Run_01.ds') > > grad_02 = ft_read_sens('Run_02.ds') > > AvgGrad = ft_average_sens(grad_01, grad_02) > > > > And that's error message: > > ??? Error using ==> ft_getopt > > the first input should contain key-value pairs > > > > Anyone who can help me there? > > Thanks and best regards, > > Patrick > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From andrea.brovelli at univ-amu.fr Tue Jan 29 17:16:05 2013 From: andrea.brovelli at univ-amu.fr (andrea brovelli) Date: Tue, 29 Jan 2013 17:16:05 +0100 Subject: [FieldTrip] Error in prepare_freq_matrices.m ? Message-ID: <20130129171605.176164iln90u72f4@wmelperso1.univmed.fr> Dear all, I have an error while running ft_sourceanalysis. I am analysing a data set over a frequency range which includes 100 frequencies and 60 trials. I get an error due to the definition of the variable Ntrials, which as far as I understand, it is done in prepare_freq_matrices.m at lines 76 -> 85: ------------------------------------------------- % the time-frequency latency has already been squeezed away (see above) if strcmp(freq.dimord, 'chan_freq') Ntrials = 1; elseif strcmp(freq.dimord, 'rpt_chan_freq') Ntrials = length(freq.cumtapcnt); elseif strcmp(freq.dimord, 'rpttap_chan_freq') Ntrials = length(freq.cumtapcnt); else error('unrecognized dimord for frequency data'); end ------------------------------------------------- If the number of trials is less than the number of frequencies, Ntrials = length(freq.cumtapcnt) should be replaced by Ntrials = size(freq.cumtapcnt,1); It is the case ? Thanks a lot Andrea From fanny.lachat at gmail.com Tue Jan 29 16:56:20 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 16:56:20 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? Message-ID: Dear fieldtrip users, I am trying to use the function* ft_selectdata_new * on my data. I have time-frequency data that come from ft_freqanalysis. I want to average my data over the frequency of interest (10-12Hz). ---------------------- Here is my script : cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.frequency = [10 12]; cfg.avgoverfreq = 'yes'; cfg.latency = [-0.7 1]; cfg.avgovertime = 'no'; avg_10_12 = ft_selectdata_new (cfg,mydata); ------ This doesn't work : 'Undefined function 'ft_selectdata_new' for input arguments of type 'struct'. What should I change in my script in order for it to work ? (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); Thank you in advance ! -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Tue Jan 29 17:23:22 2013 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Tue, 29 Jan 2013 17:23:22 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hi Fanny, Thats a matlab error when it cant find the function (ft_selectdata_new) since its probably in a private folder. Try ft_selectdata (it will figure out if you're using it in the old (key-value pairs) or new (cfg,data) way). Cheers, Stephen On 29 January 2013 16:56, Fanny wrote: > Dear fieldtrip users, > > I am trying to use the function ft_selectdata_new on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From johanna.zumer at gmail.com Tue Jan 29 17:23:15 2013 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Tue, 29 Jan 2013 17:23:15 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Hello, This sounds like it could be a path issue. Is ft_selectdata_new in your path? If you type 'which ft_selectdata_new' does it show up? If not, type ft_defaults and then try again. If still a problem...I'll have to look closer. Cheers, Johanna 2013/1/29 Fanny > Dear fieldtrip users, > > I am trying to use the function* ft_selectdata_new * on my data. > I have time-frequency data that come from ft_freqanalysis. > > I want to average my data over the frequency of interest (10-12Hz). > > ---------------------- > Here is my script : > > cfg = [ ]; > cfg.parameter = 'powspctrm'; > cfg.frequency = [10 12]; > cfg.avgoverfreq = 'yes'; > cfg.latency = [-0.7 1]; > cfg.avgovertime = 'no'; > > avg_10_12 = ft_selectdata_new (cfg,mydata); > ------ > > This doesn't work : 'Undefined function 'ft_selectdata_new' for input > arguments of type 'struct'. > > What should I change in my script in order for it to work ? > (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); > > Thank you in advance ! > > -- > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fanny.lachat at gmail.com Tue Jan 29 17:31:19 2013 From: fanny.lachat at gmail.com (Fanny) Date: Tue, 29 Jan 2013 17:31:19 +0100 Subject: [FieldTrip] ft_selectdata_new, how does it work ?? In-Reply-To: References: Message-ID: Thank you Johanna, with the use of ft_defaults my script works now ! Cheers 2013/1/29 Johanna Zumer > Hello, > > This sounds like it could be a path issue. Is ft_selectdata_new in your > path? If you type 'which ft_selectdata_new' does it show up? If not, type > ft_defaults and then try again. > > If still a problem...I'll have to look closer. > > Cheers, > Johanna > > > 2013/1/29 Fanny > >> Dear fieldtrip users, >> >> I am trying to use the function* ft_selectdata_new * on my data. >> I have time-frequency data that come from ft_freqanalysis. >> >> I want to average my data over the frequency of interest (10-12Hz). >> >> ---------------------- >> Here is my script : >> >> cfg = [ ]; >> cfg.parameter = 'powspctrm'; >> cfg.frequency = [10 12]; >> cfg.avgoverfreq = 'yes'; >> cfg.latency = [-0.7 1]; >> cfg.avgovertime = 'no'; >> >> avg_10_12 = ft_selectdata_new (cfg,mydata); >> ------ >> >> This doesn't work : 'Undefined function 'ft_selectdata_new' for input >> arguments of type 'struct'. >> >> What should I change in my script in order for it to work ? >> (I tried with : ft_selectdata_new (cfg,mydata.powspctrm)); >> >> Thank you in advance ! >> >> -- >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Jan 29 19:46:47 2013 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Jan 2013 13:46:47 -0500 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: <5107787A.5030309@wwu.de> References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: Hi Andreas, The problem is that there are no cables or connecters used for the noise test study I did on the phantom. Just the phantom... It seems it has some magnetic contamination and creates a signal due to vibration. My next step is to clean thoroughly the phantom, inside and outside, and see will it help. Thanks, Inna On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink wrote: > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > >> Yes, >> I run all kind of scans: noise test (good), disconnected phantom >> (noisy), phantom with dipole removed (noisy), phantom with saline >> solution removed (noisy); dipole alone (good), saline alone (good). >> >> Below is the snapshot for Phantom with no saline solution or dipole: >> Thanks.Inline image 1 >> >> >> >> ______________________________**_________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip >> >> > -- > > ==============================**==============================**========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > D-48149 Muenster mobil: +49-(0)160-98527553 > Germany fax: +49-(0)251-83-56874 > e-Mail: a.wollbrink at wwu.de > > ==============================**==============================**========== > > ______________________________**_________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/**mailman/listinfo/fieldtrip > -- Inna McGowin -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.wollbrink at wwu.de Wed Jan 30 11:27:32 2013 From: a.wollbrink at wwu.de (Andreas Wollbrink) Date: Wed, 30 Jan 2013 11:27:32 +0100 Subject: [FieldTrip] CTF MEG current phantom In-Reply-To: References: <442B7107-7E2D-4AF0-9EA6-284F7F77E23F@ucdenver.edu> <5107787A.5030309@wwu.de> Message-ID: <5108F594.7000707@wwu.de> Hi Inna, did you detect the intefering signal in the reference channels as well? How do the MEG sensor signals behave for different noise balancing settings (different synthetic gradiometer orders)? Cheers, Andreas On 01/29/13 19:46, McGowin, Inna wrote: > Hi Andreas, > The problem is that there are no cables or connecters used for the noise > test study I did on the phantom. > Just the phantom... It seems it has some magnetic contamination and > creates a signal due to vibration. > My next step is to clean thoroughly the phantom, inside and outside, and > see will it help. > Thanks, > Inna > > On Tue, Jan 29, 2013 at 2:21 AM, Andreas Wollbrink > wrote: > > Hi Inna, > > did you fixate the cables and connectors of the Current Phantom? > Are the cables twisted? > > Andreas > > > On 01/28/13 19:59, McGowin, Inna wrote: > > Yes, > I run all kind of scans: noise test (good), disconnected phantom > (noisy), phantom with dipole removed (noisy), phantom with saline > solution removed (noisy); dipole alone (good), saline alone (good). > > Below is the snapshot for Phantom with no saline solution or dipole: > Thanks.Inline image 1 > > > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > -- > > ==============================__==============================__========== > > Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 phone: +49-(0)251-83-52546 > > D-48149 Muenster mobil: +49-(0)160-98527553 > > Germany fax: +49-(0)251-83-56874 > > e-Mail: a.wollbrink at wwu.de > > > ==============================__==============================__========== > > _________________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/__mailman/listinfo/fieldtrip > > > > > > -- > Inna McGowin > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ====================================================================== Dipl.-Ing. Andreas Wollbrink, Biomedical Engineer Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 phone: +49-(0)251-83-52546 D-48149 Muenster mobil: +49-(0)160-98527553 Germany fax: +49-(0)251-83-56874 e-Mail: a.wollbrink at wwu.de ====================================================================== From singhharsimrat at gmail.com Wed Jan 30 18:26:46 2013 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 30 Jan 2013 17:26:46 +0000 Subject: [FieldTrip] Reading events from a trigger channel Message-ID: Hi Fieldtrippers My data is in edf format but has a event marker channel in the form of pulse on channel 1. I have tried to use event = ft_read_event(cfg.datafile,'trigindx',1,'threshold',5e2,'detectflank','up'); But 'detectflank' doesn't seem to work. Is it particular for MEG data format (yokogawa). Can some one give me an idea how to define pulses on channel trials in define trial. The channel has same Fs as data channels. Thanks for your help in advance. Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: