From kambiz.tavabi at UNI-MUENSTER.DE Wed Oct 5 15:46:00 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Wed, 5 Oct 2005 15:46:00 +0200 Subject: BESA avg - TF analysis Message-ID: Hello, I would like to know what is the starting point for performing time-freq analysis on data (MEG 275 CTF) preprocessed and averaged with BESA (5.1)? ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From d.talsma at PSY.VU.NL Mon Oct 10 12:15:15 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 12:15:15 +0200 Subject: Data concatination Message-ID: Hi Everybody, I have a question regarding the following: I would like to run a time/frequency analysis on some EEG data we collected. The data is collected over short 5-min runs, and each run is saved into a separate datafile (neuroscan.cnt format). So what I would like to try to do is the following (in pseudo code): for subj=1:12 for run =i:10 cfg.dataset = [subj run].cnt data(run) = preprocessing(cfg); end datacat = concatenate data(1:10) datafreq = freqanalysis(cfg, datacat) end Is there a way to do this? Thanks, Durk From G.vanElswijk at NEURO.UMCN.NL Mon Oct 10 12:20:43 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Mon, 10 Oct 2005 12:20:43 +0200 Subject: Data concatination Message-ID: Hi, APPENDDATA should do the job: "APPENDDATA combines multiple datasets that have been preprocessed separately into a single large dataset" Gijs > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Durk Talsma > Sent: Monday, October 10, 2005 12:15 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Data concatination > > Hi Everybody, > > I have a question regarding the following: I would like to > run a time/frequency analysis on some EEG data we collected. > The data is collected over short 5-min runs, and each run is > saved into a separate datafile (neuroscan.cnt format). So > what I would like to try to do is the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) end > > Is there a way to do this? > > Thanks, > Durk > From d.talsma at PSY.VU.NL Mon Oct 10 14:42:37 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 14:42:37 +0200 Subject: Data concatination In-Reply-To: <4CD85D348E46984983185B911CBF3ED18DA3CB@umcnet13.umcn.nl> Message-ID: HI Gijs, That works indeed. Thanks a lot. Cheers, Durk Gijs van Elswijk wrote: >Hi, > >APPENDDATA should do the job: > > "APPENDDATA combines multiple datasets that have been preprocessed >separately > into a single large dataset" > >Gijs > > > From d.talsma at PSY.VU.NL Tue Oct 11 10:29:16 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 11 Oct 2005 10:29:16 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434A3F33.6010907@psy.vu.nl> Message-ID: Okay, just to follow up on my own message: The skeleton code below, led to a "Too many files open" error after preprocessing four subjects, causing any I/O functions of MATLAB to freeze: After some debugging, I found that in the file private/read_neuroscan_cnt.m the read function returns when headeronly is given as an argument, without closing the filehandle first. Attached is a fix. Cheers, Durk Durk Talsma wrote: > Hi Everybody, > > I have a question regarding the following: I would like to run a > time/frequency analysis on some EEG data we collected. The data is > collected over short 5-min runs, and each run is saved into a separate > datafile (neuroscan.cnt format). So what I would like to try to do is > the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) > end > > Is there a way to do this? > > Thanks, > Durk > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_ns_cnt.m URL: From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 10:34:52 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 10:34:52 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434B77DC.2050507@psy.vu.nl> Message-ID: Hi Durk, Thanks for reporting and fixing the problem. I will incorporate your fix in our copy of the code, it will be in the next daily release. best, Robert On 11-okt-2005, at 10:29, Durk Talsma wrote: > Okay, just to follow up on my own message: The skeleton code below, > led to a "Too many files open" error after preprocessing four > subjects, causing any I/O functions of MATLAB to freeze: > > After some debugging, I found that in the file private/ > read_neuroscan_cnt.m the read function returns when headeronly is > given as an argument, without closing the filehandle first. > > Attached is a fix. > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From kambiz.tavabi at UNI-MUENSTER.DE Tue Oct 11 16:26:09 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Tue, 11 Oct 2005 16:26:09 +0200 Subject: Error using ==> nargout Message-ID: The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From G.vanElswijk at NEURO.UMCN.NL Tue Oct 11 21:56:33 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Tue, 11 Oct 2005 21:56:33 +0200 Subject: Error using ==> nargout Message-ID: Hi, You have defined a trial function with the name "trialfun_ctf_epoched" in the cfg structure. Supposedly, this function (.m file) does not exist (or is not found somewhere in the matlab path). Therefore, during preprocessing "nargout" is called with an non-existing .m file as parameter and returns with an error. I've had the same problem recently. The solution would normally be to set cfg.trialfun to an existing trial function or to create a trial function with name "trialfun_ctf_epoched". However, in the sample dataset of the tutorial no trial function was (is?) included, and I think it is a bit hard to make one if you don't know how trials are marked in the raw data. Jan-Mathijs has sent me an .m file with a trialfunction that worked for this tutorial. Jan-Mathijs, is it allright if I forward that file to Kambiz? Gijs -----Original Message----- From: FieldTrip discussion list on behalf of Kambiz Tavabi Sent: Tue 10/11/2005 4:26 PM To: FIELDTRIP at NIC.SURFNET.NL Cc: Subject: [FIELDTRIP] Error using ==> nargout The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 22:18:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 22:18:04 +0200 Subject: Error using ==> nargout In-Reply-To: <4CD85D348E46984983185B911CBF3ED1083B89@umcnet13.umcn.nl> Message-ID: Hi Kambiz, The subfunction "trialfun_ctf_epoched" is automatically selected if you specify a particular dataformat (CTF) in combination with particular cfg settings in preprocessing. The "trialfun_ctf_epoched" function is included in recent fieldtrip versions, and can be found in the private subdirectory. [Gijs, please update to a recent version]. Since it is not a functino that you should call directly, it is not included in the fieldtrip main directory. In general, user defined trialfunctions should return a "trl" matrix, but also can return a second structure with additional information. That second return argument is the "event" structure (see read_fcdc_event for more information). Fieldtrip is using the standard "nargout" function of Matlab to determine whether the trialfunction returns one or two output arguments. It seems that there is an incompatibility with the nargout function on specific combinations of Matlab with MS Windows. I have heard the problem from others as well, but have not been able to reproduce the problem myself since I do not have a Windows computer. Since 4 October I changed the nargout behaviour, and hope that that fixes the problem on Windows. Please download the latest version of fieldtrip from ftp:// ftp.fcdonders.nl/pub/fieldtrip, that should fix the problem. best regards, Robert On 11-okt-2005, at 21:56, Gijs van Elswijk wrote: > Hi, > > You have defined a trial function with the name > "trialfun_ctf_epoched" in the cfg structure. Supposedly, this > function (.m file) does not exist (or is not found somewhere in the > matlab path). Therefore, during preprocessing "nargout" is called > with an non-existing .m file as parameter and returns with an error. > > I've had the same problem recently. The solution would normally be > to set cfg.trialfun to an existing trial function or to create a > trial function with name "trialfun_ctf_epoched". However, in the > sample dataset of the tutorial no trial function was (is?) > included, and I think it is a bit hard to make one if you don't > know how trials are marked in the raw data. > > Jan-Mathijs has sent me an .m file with a trialfunction that worked > for this tutorial. Jan-Mathijs, is it allright if I forward that > file to Kambiz? > > Gijs > > -----Original Message----- > From: FieldTrip discussion list on behalf of Kambiz Tavabi > Sent: Tue 10/11/2005 4:26 PM > To: FIELDTRIP at NIC.SURFNET.NL > Cc: > Subject: [FIELDTRIP] Error using ==> nargout > > > > The errors below result from running the excerpt code provided > in the > FIELDTRIP tutorial/example MATLAB script for Time Frequency > analysis. My > MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which > contains the > folder 'Subject01.ds' and associated head shape/MRI files. > > Any suggestions on what I am doing wrong? > > >> cfg = []; > cfg.dataset = 'Subject01.ds'; > cfg.channel = {'MEG' 'STIM'}; > cfg.trialdef.excludeConditions = {'BAD'}; > cfg.trialdef.includeTrigger = 3; > cfg.detrend = 'yes'; > > dataFIC = preprocessing(cfg); > evaluating trialfunction 'trialfun_ctf_epoched' > > > ??? Error using ==> nargout > Not a valid M-file. > > Error in ==> definetrial at 141 > num = nargout(cfg.trialfun); > > Error in ==> preprocessing at 263 > [cfg] = definetrial(cfg); > > > ============================================ > Kambiz Tavabi, Dipl. Psych., MS. > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 > D-48149 Muenster > Germany > > phone: +49-(0)251-83-56884 > fax: +49-(0)251-83-56874 > e-Mail: Kambiz.Tavabi at uni-muenster.de > > ============================================ > > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From holroydt at MAIL.NIH.GOV Wed Oct 19 00:47:40 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Tue, 18 Oct 2005 18:47:40 -0400 Subject: megrealign Message-ID: Is it possible, working with CTF data, for megrealign to also interpolate the reference channels? -- Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Wed Oct 19 08:53:27 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 19 Oct 2005 08:53:27 +0200 Subject: megrealign In-Reply-To: <43557B8C.1010308@mail.nih.gov> Message-ID: Hi Tom, On 19-okt-2005, at 0:47, Tom Holroyd wrote: > Is it possible, working with CTF data, for megrealign to also > interpolate the reference channels? You mean the channels that are far away from the head (Rxx etc.)? In theory, yes, but in practice no. There is little MEG information around those channels and if you rotate the helmet around the subjects head, the shift will be the largest in those channels. Therefore, after rotation of the helmet those channels might even move completely outside of the range that they cover by themselves. Furthermore, the signal that is picked up by those sensors is poorly modelled by the dipoles in the brain that MEGREALIGN uses. That is the actual purpose of them, that they pick up mostly noise and little brain signal. If you want to incorporate those channels in realigning, the best that I can imagine is to do the inverse estimation towards the brain dipoles using MEG+REF on 3rd order balanced data, and then do the forward calculation using (rotated+shifted) MEG alone. However, support for the 3rd order balanced MEG signals is still not implemented in FieldTrip. It is a recurring topic, which I am not too enthousiastic about to put much effort in, since it relates to incomplete specified file formats and it is more engineering than science. best Robert From holroydt at MAIL.NIH.GOV Wed Oct 19 13:35:28 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Wed, 19 Oct 2005 07:35:28 -0400 Subject: megrealign In-Reply-To: <95362BFC-3452-4448-A097-26E9ABEE74DB@fcdonders.ru.nl> Message-ID: On Wed, 19 Oct 2005, Robert Oostenveld wrote: > If you want to incorporate those channels in realigning, the best that I can > imagine is to do the inverse estimation towards the brain dipoles using > MEG+REF on 3rd order balanced data, and then do the forward calculation using > (rotated+shifted) MEG alone. That is in fact what I am doing now, and it's fine. Never mind. > However, support for the 3rd order balanced MEG signals is > still not implemented in FieldTrip. It is a recurring topic, > which I am not too enthousiastic about to put much effort in, > since it relates to incomplete specified file formats and it is > more engineering than science. Hmm? The reference channel positions and orientations are specified in the res4 file, just like all the other channels. By the way, I have a .oct file for meg_leadfield1.m so it works fast in Octave (like 800 times faster), in case anybody is interested. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Fri Oct 21 14:13:38 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 21 Oct 2005 14:13:38 +0200 Subject: megrealign In-Reply-To: Message-ID: On 19-okt-2005, at 13:35, Tom Holroyd wrote: > Hmm? The reference channel positions and orientations are > specified in the res4 file, just like all the other channels. Yes, but not the linear weighting of all channels that is used to construct the offline synthetic gradient. That is also stored in the res4, but I do not know how to get it out of there. The synthetic 3rd order gradient computation is MEG_3rd = T03 * MEG_0th where MEG_3rd is a Nchan by Ntimepoints matrix, just like MEG_0th, and T03 is the linear transformation matrix from 0th (unbalanced 1st order gradients) to 3rd order gradients. Similarly, the res4 should include teh information for MEG_1rd = T01 * MEG_0th MEG_2rd = T02 * MEG_0th MEG_3rd = T03 * MEG_0th Using those, you can also go back between different synthetic gradients of course (using the inverse of the Txy matrices). The simplest example is MEG_0th = T00 * MEG_0th which means that T00 is eye(Nchans). The Txy matrices should be used to premultiply the grad.tra matrix which is used in the forward model (i.e. the transformation of the field at all coils to the channel output). > By the way, I have a .oct file for meg_leadfield1.m so it works > fast in Octave (like 800 times faster), in case anybody is interested. Do you want me to put it in the release version? If so, send it to me and I'll include it. Robert From litvak at TECHUNIX.TECHNION.AC.IL Thu Oct 27 12:20:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 27 Oct 2005 12:20:00 +0200 Subject: Comparing waveforms Message-ID: Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Oct 27 12:33:01 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 27 Oct 2005 12:33:01 +0200 Subject: Comparing waveforms Message-ID: Hi Vladimir, You have to do nothing special. A waveforms is just a spatiotemporal datamatrix in which "space" is a point and thus represented by a single row. Eric ----- Original Message ----- From: Vladimir Litvak To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, October 27, 2005 12:20 PM Subject: [FIELDTRIP] Comparing waveforms Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.buiatti at UNIV-PARIS5.FR Fri Oct 28 13:40:26 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 28 Oct 2005 13:40:26 +0200 Subject: about cluster randomization analysis Message-ID: Dear FieldTrippers, I'm using fieldtrip cluster randomization functions to investigate statistically significant differences between the ERPs of 8 subjects relative to two different experimental conditions. In order to prove the test performance, I'm using an experiment that shows an evident significant difference, easily detectable with a simple t-test. I have some difficulties though in interpreting the results, because they look to me very dependent on the parameters I use. My main question is therefore: is there any general rule of thumb you can propose in choosing the parameters? The procedure I am following now is a sort of two-steps method: in the first place, I choose a wide time interval and a low minimum number of channels. I end up with many clusters that are far from being significative. I then shorten the time interval to include just one cluster (starting from the most significant one), and increase the minimum number of channels, and run the analysis again. In this case, I eventually got a significative cluster where I was expecting it from a simple observation of the t-test. Do you think this procedure is right or am I doing something wrong? Is it correct to temporally focus on a cluster to check its significance? Another couple of questions: 1) Minnbchan. I understood it is the minimum number of significative neighbor (channel,time) points for a (channel,time) point to enter a cluster, no matter if adjacency is more in channel space or time direction. Am I right? Since time and channel space are quite different dimension, would it be better to set a minimum channel number separately for the two? 2) Maybe because my data are average-referenced, I often end up with a positive and negative cluster emerging almost at the same time. Have you thought about any way to include the search of dipole-like configurations? Thank you and have a good day. Marco -- Marco Buiatti - Post Doc ************************************************************** Cognitive Neuroimaging Unit - INSERM U562 Service Hospitalier Frederic Joliot, CEA/DRM/DSV 4 Place du general Leclerc, 91401 Orsay cedex, France Telephone: +33 1 69 86 77 65 Fax: +33 1 69 86 78 16 E-mail: marco.buiatti at gmail.com Web: www.unicog.org *************************************************************** From litvak at TECHUNIX.TECHNION.AC.IL Fri Oct 28 16:13:45 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Fri, 28 Oct 2005 15:13:45 +0100 Subject: about cluster randomization analysis In-Reply-To: <3172.172.20.62.10.1130499626.squirrel@webmail.univ-paris5.fr> Message-ID: Dear Marco, A quick comment about two of your points from someone who had similar experiences. 1) It is definitely wrong to zoom in on clusters the way you did. If you know in advance where you expect the effect you should make a window as narrow as possible around this time and then you will have higher detection power. If you take a large enough window you can get clusters of any size just by chance and then if you 'zoom in' on those clusters they will be significant but this is meaningless, the same as doing 100 t-tests and taking the 5 that crossed the threshold by chance as significant. 2) The clusterrandanalysis procedure can definitely be manipulated by re-referencing. So if you have a positive and a negative pole of the dipole none of which crosses the threshold, you can rereference to one of them and then there is a good chance the other will be significant. Again, this kind of manipulations is not quite 'kosher'. When I discussed that with Robert and Eric they said that one should decide in advance about a reasonable reference that is likely to reveal an effect. Best, Vladimir Litvak From maris at NICI.RU.NL Fri Oct 28 17:02:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 28 Oct 2005 17:02:00 +0200 Subject: about cluster randomization analysis Message-ID: Dear Marco, > The procedure I am following now is a sort of two-steps method: in the > first place, I choose a wide time interval and a low minimum number of > channels. I end up with many clusters that are far from being > significative. I then shorten the time interval to include just one > cluster (starting from the most significant one), and increase the minimum > number of channels, and run the analysis again. In this case, I eventually > got a significative cluster where I was expecting it from a simple > observation of the t-test. Do you think this procedure is right or am I > doing something wrong? Is it correct to temporally focus on a cluster to > check its significance? Clusterrandanalysis only controls the false alarm (type I error) rate if you choose the "tuning parameters" (latency interval, channel subset, the minnbchan-parameter; and if you use on TFRs, also the frequency interval) independent of the data. Instead, if you play around with these tuning parameters until you find a cluster whose p-value exceeds the critical alpha-level, you are not controlling the false alarm rate. In this case, the chosen tuning parameters depend on the data. An extreme example illustrates this even better. Assume you calculate T-statistics for all (channel, time point)-pairs and you select the pair with the largest T-statistic. Then, you select the latency interval that only contains this time point and the channel subset that only contains this channel. With these tuning parameters, you reduce your data to a single cell in the spatiotemporal matrix, and clusterrrandanalysis will produce a p-value that is very close to the p-value of a T-test. Since you have selected this (channel, time point)-pair on the basis of its T-statistic, this p-value is strongly biased. > Another couple of questions: > 1) Minnbchan. I understood it is the minimum number of significative > neighbor (channel,time) points for a (channel,time) point to enter a > cluster, no matter if adjacency is more in channel space or time > direction. Am I right? Since time and channel space are quite different > dimension, would it be better to set a minimum channel number separately > for the two? Minnbchan should also be chosen independent of the data. I introduced this tuning parameter because it turned out that in 3-dimensional analyses on TFRs (involving the dimensions time, space (i.e., sensors) and frequency), sometimes a cluster appeared that consisted of two or more 3-dimensional "blobs" that were connected by a single (channel, time, frequency)-element. >>From a physiological perspective, such a cluster does not make sense. To remove these physiologically implausible (and therefore probably random) connections, I introduced the minnbchan parameter. Because of this physiological rationale, I apply the minimum number criterium to the spatial, and not to the temporal dimension. Short-lived phenomena are very well possible from a physiological perspective, whereas effects at spatially isolated sensors are not. > 2) Maybe because my data are average-referenced, I often end up with a > positive and negative cluster emerging almost at the same time. Have you > thought about any way to include the search of dipole-like configurations? I have not thought about it, but it certainly makes sense to incorporate biophysical constraints (such dipolar patterns) in the test statistic. One should be aware of the fact that different hypotheses are tested before and after rereferencing. This is physical and not a statistical issue. As you most certainly know, EEG-signals are potential DIFFERENCES and therefore the underlying physiological events that are measured by EEG depend on the reference channel(s). If the experimental manipulation affects the current reference channel, then rereferencing to another channel (or set of channels) that is not affected by the experimental manipulation makes a difference for the result of the statistical test. greetings, Eric Maris From luis.patino at UNIKLINIK-FREIBURG.DE Mon Oct 31 09:46:47 2005 From: luis.patino at UNIKLINIK-FREIBURG.DE (Dr. Jose Luis Patino Vilchis) Date: Mon, 31 Oct 2005 09:46:47 +0100 Subject: Comparing waveforms In-Reply-To: <000601c5dadf$fce1dd30$90514484@dellgx240> Message-ID: Dear all, Could someone recommend me some litterature on the use of clusteranalysis on EEG data? Thanks in advance Luis Patino Zitat von Vladimir Litvak : > Dear Robert and Eric, > > > > What do you think is the best way to compare 1D waveforms in > clusterrandanalysis? Should I use the same settings I use for 2D > scalpmaps (clustering in time) or something like maximal value would be > better? If you think I should use something else please give me the > exact settings for it. > > > > Thanks, > > > > Vladimir > > From maris at NICI.RU.NL Mon Oct 31 10:29:02 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 31 Oct 2005 10:29:02 +0100 Subject: Comparing waveforms Message-ID: Hi Jose, There are two source of information on the Fieldtrip website: 1. A tutorial (Clusterrandanalysis.pdf), that you can find under Documentation. This tutorial uses data that can be found under Download. 2. A paper by Maris and Oostenveld (submitted) that shows why these calculations are statistically sound (i.e., result in decisions that control the false alarm rate) in a variety of designs. greetings, Eric Maris ----- Original Message ----- From: "Dr. Jose Luis Patino Vilchis" To: Sent: Monday, October 31, 2005 9:46 AM Subject: Re: [FIELDTRIP] Comparing waveforms > Dear all, > > Could someone recommend me some litterature on the use of clusteranalysis > on EEG > data? > > Thanks in advance > > Luis Patino > > Zitat von Vladimir Litvak : > >> Dear Robert and Eric, >> >> >> >> What do you think is the best way to compare 1D waveforms in >> clusterrandanalysis? Should I use the same settings I use for 2D >> scalpmaps (clustering in time) or something like maximal value would be >> better? If you think I should use something else please give me the >> exact settings for it. >> >> >> >> Thanks, >> >> >> >> Vladimir >> >> From kambiz.tavabi at UNI-MUENSTER.DE Wed Oct 5 15:46:00 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Wed, 5 Oct 2005 15:46:00 +0200 Subject: BESA avg - TF analysis Message-ID: Hello, I would like to know what is the starting point for performing time-freq analysis on data (MEG 275 CTF) preprocessed and averaged with BESA (5.1)? ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From d.talsma at PSY.VU.NL Mon Oct 10 12:15:15 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 12:15:15 +0200 Subject: Data concatination Message-ID: Hi Everybody, I have a question regarding the following: I would like to run a time/frequency analysis on some EEG data we collected. The data is collected over short 5-min runs, and each run is saved into a separate datafile (neuroscan.cnt format). So what I would like to try to do is the following (in pseudo code): for subj=1:12 for run =i:10 cfg.dataset = [subj run].cnt data(run) = preprocessing(cfg); end datacat = concatenate data(1:10) datafreq = freqanalysis(cfg, datacat) end Is there a way to do this? Thanks, Durk From G.vanElswijk at NEURO.UMCN.NL Mon Oct 10 12:20:43 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Mon, 10 Oct 2005 12:20:43 +0200 Subject: Data concatination Message-ID: Hi, APPENDDATA should do the job: "APPENDDATA combines multiple datasets that have been preprocessed separately into a single large dataset" Gijs > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Durk Talsma > Sent: Monday, October 10, 2005 12:15 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Data concatination > > Hi Everybody, > > I have a question regarding the following: I would like to > run a time/frequency analysis on some EEG data we collected. > The data is collected over short 5-min runs, and each run is > saved into a separate datafile (neuroscan.cnt format). So > what I would like to try to do is the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) end > > Is there a way to do this? > > Thanks, > Durk > From d.talsma at PSY.VU.NL Mon Oct 10 14:42:37 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 14:42:37 +0200 Subject: Data concatination In-Reply-To: <4CD85D348E46984983185B911CBF3ED18DA3CB@umcnet13.umcn.nl> Message-ID: HI Gijs, That works indeed. Thanks a lot. Cheers, Durk Gijs van Elswijk wrote: >Hi, > >APPENDDATA should do the job: > > "APPENDDATA combines multiple datasets that have been preprocessed >separately > into a single large dataset" > >Gijs > > > From d.talsma at PSY.VU.NL Tue Oct 11 10:29:16 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 11 Oct 2005 10:29:16 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434A3F33.6010907@psy.vu.nl> Message-ID: Okay, just to follow up on my own message: The skeleton code below, led to a "Too many files open" error after preprocessing four subjects, causing any I/O functions of MATLAB to freeze: After some debugging, I found that in the file private/read_neuroscan_cnt.m the read function returns when headeronly is given as an argument, without closing the filehandle first. Attached is a fix. Cheers, Durk Durk Talsma wrote: > Hi Everybody, > > I have a question regarding the following: I would like to run a > time/frequency analysis on some EEG data we collected. The data is > collected over short 5-min runs, and each run is saved into a separate > datafile (neuroscan.cnt format). So what I would like to try to do is > the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) > end > > Is there a way to do this? > > Thanks, > Durk > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_ns_cnt.m URL: From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 10:34:52 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 10:34:52 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434B77DC.2050507@psy.vu.nl> Message-ID: Hi Durk, Thanks for reporting and fixing the problem. I will incorporate your fix in our copy of the code, it will be in the next daily release. best, Robert On 11-okt-2005, at 10:29, Durk Talsma wrote: > Okay, just to follow up on my own message: The skeleton code below, > led to a "Too many files open" error after preprocessing four > subjects, causing any I/O functions of MATLAB to freeze: > > After some debugging, I found that in the file private/ > read_neuroscan_cnt.m the read function returns when headeronly is > given as an argument, without closing the filehandle first. > > Attached is a fix. > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From kambiz.tavabi at UNI-MUENSTER.DE Tue Oct 11 16:26:09 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Tue, 11 Oct 2005 16:26:09 +0200 Subject: Error using ==> nargout Message-ID: The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From G.vanElswijk at NEURO.UMCN.NL Tue Oct 11 21:56:33 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Tue, 11 Oct 2005 21:56:33 +0200 Subject: Error using ==> nargout Message-ID: Hi, You have defined a trial function with the name "trialfun_ctf_epoched" in the cfg structure. Supposedly, this function (.m file) does not exist (or is not found somewhere in the matlab path). Therefore, during preprocessing "nargout" is called with an non-existing .m file as parameter and returns with an error. I've had the same problem recently. The solution would normally be to set cfg.trialfun to an existing trial function or to create a trial function with name "trialfun_ctf_epoched". However, in the sample dataset of the tutorial no trial function was (is?) included, and I think it is a bit hard to make one if you don't know how trials are marked in the raw data. Jan-Mathijs has sent me an .m file with a trialfunction that worked for this tutorial. Jan-Mathijs, is it allright if I forward that file to Kambiz? Gijs -----Original Message----- From: FieldTrip discussion list on behalf of Kambiz Tavabi Sent: Tue 10/11/2005 4:26 PM To: FIELDTRIP at NIC.SURFNET.NL Cc: Subject: [FIELDTRIP] Error using ==> nargout The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 22:18:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 22:18:04 +0200 Subject: Error using ==> nargout In-Reply-To: <4CD85D348E46984983185B911CBF3ED1083B89@umcnet13.umcn.nl> Message-ID: Hi Kambiz, The subfunction "trialfun_ctf_epoched" is automatically selected if you specify a particular dataformat (CTF) in combination with particular cfg settings in preprocessing. The "trialfun_ctf_epoched" function is included in recent fieldtrip versions, and can be found in the private subdirectory. [Gijs, please update to a recent version]. Since it is not a functino that you should call directly, it is not included in the fieldtrip main directory. In general, user defined trialfunctions should return a "trl" matrix, but also can return a second structure with additional information. That second return argument is the "event" structure (see read_fcdc_event for more information). Fieldtrip is using the standard "nargout" function of Matlab to determine whether the trialfunction returns one or two output arguments. It seems that there is an incompatibility with the nargout function on specific combinations of Matlab with MS Windows. I have heard the problem from others as well, but have not been able to reproduce the problem myself since I do not have a Windows computer. Since 4 October I changed the nargout behaviour, and hope that that fixes the problem on Windows. Please download the latest version of fieldtrip from ftp:// ftp.fcdonders.nl/pub/fieldtrip, that should fix the problem. best regards, Robert On 11-okt-2005, at 21:56, Gijs van Elswijk wrote: > Hi, > > You have defined a trial function with the name > "trialfun_ctf_epoched" in the cfg structure. Supposedly, this > function (.m file) does not exist (or is not found somewhere in the > matlab path). Therefore, during preprocessing "nargout" is called > with an non-existing .m file as parameter and returns with an error. > > I've had the same problem recently. The solution would normally be > to set cfg.trialfun to an existing trial function or to create a > trial function with name "trialfun_ctf_epoched". However, in the > sample dataset of the tutorial no trial function was (is?) > included, and I think it is a bit hard to make one if you don't > know how trials are marked in the raw data. > > Jan-Mathijs has sent me an .m file with a trialfunction that worked > for this tutorial. Jan-Mathijs, is it allright if I forward that > file to Kambiz? > > Gijs > > -----Original Message----- > From: FieldTrip discussion list on behalf of Kambiz Tavabi > Sent: Tue 10/11/2005 4:26 PM > To: FIELDTRIP at NIC.SURFNET.NL > Cc: > Subject: [FIELDTRIP] Error using ==> nargout > > > > The errors below result from running the excerpt code provided > in the > FIELDTRIP tutorial/example MATLAB script for Time Frequency > analysis. My > MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which > contains the > folder 'Subject01.ds' and associated head shape/MRI files. > > Any suggestions on what I am doing wrong? > > >> cfg = []; > cfg.dataset = 'Subject01.ds'; > cfg.channel = {'MEG' 'STIM'}; > cfg.trialdef.excludeConditions = {'BAD'}; > cfg.trialdef.includeTrigger = 3; > cfg.detrend = 'yes'; > > dataFIC = preprocessing(cfg); > evaluating trialfunction 'trialfun_ctf_epoched' > > > ??? Error using ==> nargout > Not a valid M-file. > > Error in ==> definetrial at 141 > num = nargout(cfg.trialfun); > > Error in ==> preprocessing at 263 > [cfg] = definetrial(cfg); > > > ============================================ > Kambiz Tavabi, Dipl. Psych., MS. > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 > D-48149 Muenster > Germany > > phone: +49-(0)251-83-56884 > fax: +49-(0)251-83-56874 > e-Mail: Kambiz.Tavabi at uni-muenster.de > > ============================================ > > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From holroydt at MAIL.NIH.GOV Wed Oct 19 00:47:40 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Tue, 18 Oct 2005 18:47:40 -0400 Subject: megrealign Message-ID: Is it possible, working with CTF data, for megrealign to also interpolate the reference channels? -- Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Wed Oct 19 08:53:27 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 19 Oct 2005 08:53:27 +0200 Subject: megrealign In-Reply-To: <43557B8C.1010308@mail.nih.gov> Message-ID: Hi Tom, On 19-okt-2005, at 0:47, Tom Holroyd wrote: > Is it possible, working with CTF data, for megrealign to also > interpolate the reference channels? You mean the channels that are far away from the head (Rxx etc.)? In theory, yes, but in practice no. There is little MEG information around those channels and if you rotate the helmet around the subjects head, the shift will be the largest in those channels. Therefore, after rotation of the helmet those channels might even move completely outside of the range that they cover by themselves. Furthermore, the signal that is picked up by those sensors is poorly modelled by the dipoles in the brain that MEGREALIGN uses. That is the actual purpose of them, that they pick up mostly noise and little brain signal. If you want to incorporate those channels in realigning, the best that I can imagine is to do the inverse estimation towards the brain dipoles using MEG+REF on 3rd order balanced data, and then do the forward calculation using (rotated+shifted) MEG alone. However, support for the 3rd order balanced MEG signals is still not implemented in FieldTrip. It is a recurring topic, which I am not too enthousiastic about to put much effort in, since it relates to incomplete specified file formats and it is more engineering than science. best Robert From holroydt at MAIL.NIH.GOV Wed Oct 19 13:35:28 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Wed, 19 Oct 2005 07:35:28 -0400 Subject: megrealign In-Reply-To: <95362BFC-3452-4448-A097-26E9ABEE74DB@fcdonders.ru.nl> Message-ID: On Wed, 19 Oct 2005, Robert Oostenveld wrote: > If you want to incorporate those channels in realigning, the best that I can > imagine is to do the inverse estimation towards the brain dipoles using > MEG+REF on 3rd order balanced data, and then do the forward calculation using > (rotated+shifted) MEG alone. That is in fact what I am doing now, and it's fine. Never mind. > However, support for the 3rd order balanced MEG signals is > still not implemented in FieldTrip. It is a recurring topic, > which I am not too enthousiastic about to put much effort in, > since it relates to incomplete specified file formats and it is > more engineering than science. Hmm? The reference channel positions and orientations are specified in the res4 file, just like all the other channels. By the way, I have a .oct file for meg_leadfield1.m so it works fast in Octave (like 800 times faster), in case anybody is interested. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Fri Oct 21 14:13:38 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 21 Oct 2005 14:13:38 +0200 Subject: megrealign In-Reply-To: Message-ID: On 19-okt-2005, at 13:35, Tom Holroyd wrote: > Hmm? The reference channel positions and orientations are > specified in the res4 file, just like all the other channels. Yes, but not the linear weighting of all channels that is used to construct the offline synthetic gradient. That is also stored in the res4, but I do not know how to get it out of there. The synthetic 3rd order gradient computation is MEG_3rd = T03 * MEG_0th where MEG_3rd is a Nchan by Ntimepoints matrix, just like MEG_0th, and T03 is the linear transformation matrix from 0th (unbalanced 1st order gradients) to 3rd order gradients. Similarly, the res4 should include teh information for MEG_1rd = T01 * MEG_0th MEG_2rd = T02 * MEG_0th MEG_3rd = T03 * MEG_0th Using those, you can also go back between different synthetic gradients of course (using the inverse of the Txy matrices). The simplest example is MEG_0th = T00 * MEG_0th which means that T00 is eye(Nchans). The Txy matrices should be used to premultiply the grad.tra matrix which is used in the forward model (i.e. the transformation of the field at all coils to the channel output). > By the way, I have a .oct file for meg_leadfield1.m so it works > fast in Octave (like 800 times faster), in case anybody is interested. Do you want me to put it in the release version? If so, send it to me and I'll include it. Robert From litvak at TECHUNIX.TECHNION.AC.IL Thu Oct 27 12:20:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 27 Oct 2005 12:20:00 +0200 Subject: Comparing waveforms Message-ID: Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Oct 27 12:33:01 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 27 Oct 2005 12:33:01 +0200 Subject: Comparing waveforms Message-ID: Hi Vladimir, You have to do nothing special. A waveforms is just a spatiotemporal datamatrix in which "space" is a point and thus represented by a single row. Eric ----- Original Message ----- From: Vladimir Litvak To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, October 27, 2005 12:20 PM Subject: [FIELDTRIP] Comparing waveforms Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.buiatti at UNIV-PARIS5.FR Fri Oct 28 13:40:26 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 28 Oct 2005 13:40:26 +0200 Subject: about cluster randomization analysis Message-ID: Dear FieldTrippers, I'm using fieldtrip cluster randomization functions to investigate statistically significant differences between the ERPs of 8 subjects relative to two different experimental conditions. In order to prove the test performance, I'm using an experiment that shows an evident significant difference, easily detectable with a simple t-test. I have some difficulties though in interpreting the results, because they look to me very dependent on the parameters I use. My main question is therefore: is there any general rule of thumb you can propose in choosing the parameters? The procedure I am following now is a sort of two-steps method: in the first place, I choose a wide time interval and a low minimum number of channels. I end up with many clusters that are far from being significative. I then shorten the time interval to include just one cluster (starting from the most significant one), and increase the minimum number of channels, and run the analysis again. In this case, I eventually got a significative cluster where I was expecting it from a simple observation of the t-test. Do you think this procedure is right or am I doing something wrong? Is it correct to temporally focus on a cluster to check its significance? Another couple of questions: 1) Minnbchan. I understood it is the minimum number of significative neighbor (channel,time) points for a (channel,time) point to enter a cluster, no matter if adjacency is more in channel space or time direction. Am I right? Since time and channel space are quite different dimension, would it be better to set a minimum channel number separately for the two? 2) Maybe because my data are average-referenced, I often end up with a positive and negative cluster emerging almost at the same time. Have you thought about any way to include the search of dipole-like configurations? Thank you and have a good day. Marco -- Marco Buiatti - Post Doc ************************************************************** Cognitive Neuroimaging Unit - INSERM U562 Service Hospitalier Frederic Joliot, CEA/DRM/DSV 4 Place du general Leclerc, 91401 Orsay cedex, France Telephone: +33 1 69 86 77 65 Fax: +33 1 69 86 78 16 E-mail: marco.buiatti at gmail.com Web: www.unicog.org *************************************************************** From litvak at TECHUNIX.TECHNION.AC.IL Fri Oct 28 16:13:45 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Fri, 28 Oct 2005 15:13:45 +0100 Subject: about cluster randomization analysis In-Reply-To: <3172.172.20.62.10.1130499626.squirrel@webmail.univ-paris5.fr> Message-ID: Dear Marco, A quick comment about two of your points from someone who had similar experiences. 1) It is definitely wrong to zoom in on clusters the way you did. If you know in advance where you expect the effect you should make a window as narrow as possible around this time and then you will have higher detection power. If you take a large enough window you can get clusters of any size just by chance and then if you 'zoom in' on those clusters they will be significant but this is meaningless, the same as doing 100 t-tests and taking the 5 that crossed the threshold by chance as significant. 2) The clusterrandanalysis procedure can definitely be manipulated by re-referencing. So if you have a positive and a negative pole of the dipole none of which crosses the threshold, you can rereference to one of them and then there is a good chance the other will be significant. Again, this kind of manipulations is not quite 'kosher'. When I discussed that with Robert and Eric they said that one should decide in advance about a reasonable reference that is likely to reveal an effect. Best, Vladimir Litvak From maris at NICI.RU.NL Fri Oct 28 17:02:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 28 Oct 2005 17:02:00 +0200 Subject: about cluster randomization analysis Message-ID: Dear Marco, > The procedure I am following now is a sort of two-steps method: in the > first place, I choose a wide time interval and a low minimum number of > channels. I end up with many clusters that are far from being > significative. I then shorten the time interval to include just one > cluster (starting from the most significant one), and increase the minimum > number of channels, and run the analysis again. In this case, I eventually > got a significative cluster where I was expecting it from a simple > observation of the t-test. Do you think this procedure is right or am I > doing something wrong? Is it correct to temporally focus on a cluster to > check its significance? Clusterrandanalysis only controls the false alarm (type I error) rate if you choose the "tuning parameters" (latency interval, channel subset, the minnbchan-parameter; and if you use on TFRs, also the frequency interval) independent of the data. Instead, if you play around with these tuning parameters until you find a cluster whose p-value exceeds the critical alpha-level, you are not controlling the false alarm rate. In this case, the chosen tuning parameters depend on the data. An extreme example illustrates this even better. Assume you calculate T-statistics for all (channel, time point)-pairs and you select the pair with the largest T-statistic. Then, you select the latency interval that only contains this time point and the channel subset that only contains this channel. With these tuning parameters, you reduce your data to a single cell in the spatiotemporal matrix, and clusterrrandanalysis will produce a p-value that is very close to the p-value of a T-test. Since you have selected this (channel, time point)-pair on the basis of its T-statistic, this p-value is strongly biased. > Another couple of questions: > 1) Minnbchan. I understood it is the minimum number of significative > neighbor (channel,time) points for a (channel,time) point to enter a > cluster, no matter if adjacency is more in channel space or time > direction. Am I right? Since time and channel space are quite different > dimension, would it be better to set a minimum channel number separately > for the two? Minnbchan should also be chosen independent of the data. I introduced this tuning parameter because it turned out that in 3-dimensional analyses on TFRs (involving the dimensions time, space (i.e., sensors) and frequency), sometimes a cluster appeared that consisted of two or more 3-dimensional "blobs" that were connected by a single (channel, time, frequency)-element. >>From a physiological perspective, such a cluster does not make sense. To remove these physiologically implausible (and therefore probably random) connections, I introduced the minnbchan parameter. Because of this physiological rationale, I apply the minimum number criterium to the spatial, and not to the temporal dimension. Short-lived phenomena are very well possible from a physiological perspective, whereas effects at spatially isolated sensors are not. > 2) Maybe because my data are average-referenced, I often end up with a > positive and negative cluster emerging almost at the same time. Have you > thought about any way to include the search of dipole-like configurations? I have not thought about it, but it certainly makes sense to incorporate biophysical constraints (such dipolar patterns) in the test statistic. One should be aware of the fact that different hypotheses are tested before and after rereferencing. This is physical and not a statistical issue. As you most certainly know, EEG-signals are potential DIFFERENCES and therefore the underlying physiological events that are measured by EEG depend on the reference channel(s). If the experimental manipulation affects the current reference channel, then rereferencing to another channel (or set of channels) that is not affected by the experimental manipulation makes a difference for the result of the statistical test. greetings, Eric Maris From luis.patino at UNIKLINIK-FREIBURG.DE Mon Oct 31 09:46:47 2005 From: luis.patino at UNIKLINIK-FREIBURG.DE (Dr. Jose Luis Patino Vilchis) Date: Mon, 31 Oct 2005 09:46:47 +0100 Subject: Comparing waveforms In-Reply-To: <000601c5dadf$fce1dd30$90514484@dellgx240> Message-ID: Dear all, Could someone recommend me some litterature on the use of clusteranalysis on EEG data? Thanks in advance Luis Patino Zitat von Vladimir Litvak : > Dear Robert and Eric, > > > > What do you think is the best way to compare 1D waveforms in > clusterrandanalysis? Should I use the same settings I use for 2D > scalpmaps (clustering in time) or something like maximal value would be > better? If you think I should use something else please give me the > exact settings for it. > > > > Thanks, > > > > Vladimir > > From maris at NICI.RU.NL Mon Oct 31 10:29:02 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 31 Oct 2005 10:29:02 +0100 Subject: Comparing waveforms Message-ID: Hi Jose, There are two source of information on the Fieldtrip website: 1. A tutorial (Clusterrandanalysis.pdf), that you can find under Documentation. This tutorial uses data that can be found under Download. 2. A paper by Maris and Oostenveld (submitted) that shows why these calculations are statistically sound (i.e., result in decisions that control the false alarm rate) in a variety of designs. greetings, Eric Maris ----- Original Message ----- From: "Dr. Jose Luis Patino Vilchis" To: Sent: Monday, October 31, 2005 9:46 AM Subject: Re: [FIELDTRIP] Comparing waveforms > Dear all, > > Could someone recommend me some litterature on the use of clusteranalysis > on EEG > data? > > Thanks in advance > > Luis Patino > > Zitat von Vladimir Litvak : > >> Dear Robert and Eric, >> >> >> >> What do you think is the best way to compare 1D waveforms in >> clusterrandanalysis? Should I use the same settings I use for 2D >> scalpmaps (clustering in time) or something like maximal value would be >> better? If you think I should use something else please give me the >> exact settings for it. >> >> >> >> Thanks, >> >> >> >> Vladimir >> >> From kambiz.tavabi at UNI-MUENSTER.DE Wed Oct 5 15:46:00 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Wed, 5 Oct 2005 15:46:00 +0200 Subject: BESA avg - TF analysis Message-ID: Hello, I would like to know what is the starting point for performing time-freq analysis on data (MEG 275 CTF) preprocessed and averaged with BESA (5.1)? ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From d.talsma at PSY.VU.NL Mon Oct 10 12:15:15 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 12:15:15 +0200 Subject: Data concatination Message-ID: Hi Everybody, I have a question regarding the following: I would like to run a time/frequency analysis on some EEG data we collected. The data is collected over short 5-min runs, and each run is saved into a separate datafile (neuroscan.cnt format). So what I would like to try to do is the following (in pseudo code): for subj=1:12 for run =i:10 cfg.dataset = [subj run].cnt data(run) = preprocessing(cfg); end datacat = concatenate data(1:10) datafreq = freqanalysis(cfg, datacat) end Is there a way to do this? Thanks, Durk From G.vanElswijk at NEURO.UMCN.NL Mon Oct 10 12:20:43 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Mon, 10 Oct 2005 12:20:43 +0200 Subject: Data concatination Message-ID: Hi, APPENDDATA should do the job: "APPENDDATA combines multiple datasets that have been preprocessed separately into a single large dataset" Gijs > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Durk Talsma > Sent: Monday, October 10, 2005 12:15 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Data concatination > > Hi Everybody, > > I have a question regarding the following: I would like to > run a time/frequency analysis on some EEG data we collected. > The data is collected over short 5-min runs, and each run is > saved into a separate datafile (neuroscan.cnt format). So > what I would like to try to do is the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) end > > Is there a way to do this? > > Thanks, > Durk > From d.talsma at PSY.VU.NL Mon Oct 10 14:42:37 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Mon, 10 Oct 2005 14:42:37 +0200 Subject: Data concatination In-Reply-To: <4CD85D348E46984983185B911CBF3ED18DA3CB@umcnet13.umcn.nl> Message-ID: HI Gijs, That works indeed. Thanks a lot. Cheers, Durk Gijs van Elswijk wrote: >Hi, > >APPENDDATA should do the job: > > "APPENDDATA combines multiple datasets that have been preprocessed >separately > into a single large dataset" > >Gijs > > > From d.talsma at PSY.VU.NL Tue Oct 11 10:29:16 2005 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 11 Oct 2005 10:29:16 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434A3F33.6010907@psy.vu.nl> Message-ID: Okay, just to follow up on my own message: The skeleton code below, led to a "Too many files open" error after preprocessing four subjects, causing any I/O functions of MATLAB to freeze: After some debugging, I found that in the file private/read_neuroscan_cnt.m the read function returns when headeronly is given as an argument, without closing the filehandle first. Attached is a fix. Cheers, Durk Durk Talsma wrote: > Hi Everybody, > > I have a question regarding the following: I would like to run a > time/frequency analysis on some EEG data we collected. The data is > collected over short 5-min runs, and each run is saved into a separate > datafile (neuroscan.cnt format). So what I would like to try to do is > the following (in pseudo code): > > for subj=1:12 > for run =i:10 > cfg.dataset = [subj run].cnt > data(run) = preprocessing(cfg); > end > datacat = concatenate data(1:10) > datafreq = freqanalysis(cfg, datacat) > end > > Is there a way to do this? > > Thanks, > Durk > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_ns_cnt.m URL: From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 10:34:52 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 10:34:52 +0200 Subject: Neuroscan file close bug (Was: Data concatination) In-Reply-To: <434B77DC.2050507@psy.vu.nl> Message-ID: Hi Durk, Thanks for reporting and fixing the problem. I will incorporate your fix in our copy of the code, it will be in the next daily release. best, Robert On 11-okt-2005, at 10:29, Durk Talsma wrote: > Okay, just to follow up on my own message: The skeleton code below, > led to a "Too many files open" error after preprocessing four > subjects, causing any I/O functions of MATLAB to freeze: > > After some debugging, I found that in the file private/ > read_neuroscan_cnt.m the read function returns when headeronly is > given as an argument, without closing the filehandle first. > > Attached is a fix. > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From kambiz.tavabi at UNI-MUENSTER.DE Tue Oct 11 16:26:09 2005 From: kambiz.tavabi at UNI-MUENSTER.DE (Kambiz Tavabi) Date: Tue, 11 Oct 2005 16:26:09 +0200 Subject: Error using ==> nargout Message-ID: The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From G.vanElswijk at NEURO.UMCN.NL Tue Oct 11 21:56:33 2005 From: G.vanElswijk at NEURO.UMCN.NL (Gijs van Elswijk) Date: Tue, 11 Oct 2005 21:56:33 +0200 Subject: Error using ==> nargout Message-ID: Hi, You have defined a trial function with the name "trialfun_ctf_epoched" in the cfg structure. Supposedly, this function (.m file) does not exist (or is not found somewhere in the matlab path). Therefore, during preprocessing "nargout" is called with an non-existing .m file as parameter and returns with an error. I've had the same problem recently. The solution would normally be to set cfg.trialfun to an existing trial function or to create a trial function with name "trialfun_ctf_epoched". However, in the sample dataset of the tutorial no trial function was (is?) included, and I think it is a bit hard to make one if you don't know how trials are marked in the raw data. Jan-Mathijs has sent me an .m file with a trialfunction that worked for this tutorial. Jan-Mathijs, is it allright if I forward that file to Kambiz? Gijs -----Original Message----- From: FieldTrip discussion list on behalf of Kambiz Tavabi Sent: Tue 10/11/2005 4:26 PM To: FIELDTRIP at NIC.SURFNET.NL Cc: Subject: [FIELDTRIP] Error using ==> nargout The errors below result from running the excerpt code provided in the FIELDTRIP tutorial/example MATLAB script for Time Frequency analysis. My MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which contains the folder 'Subject01.ds' and associated head shape/MRI files. Any suggestions on what I am doing wrong? >> cfg = []; cfg.dataset = 'Subject01.ds'; cfg.channel = {'MEG' 'STIM'}; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; cfg.detrend = 'yes'; dataFIC = preprocessing(cfg); evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); ============================================ Kambiz Tavabi, Dipl. Psych., MS. Institute for Biomagnetism and Biosignalanalysis Muenster University Hospital Malmedyweg 15 D-48149 Muenster Germany phone: +49-(0)251-83-56884 fax: +49-(0)251-83-56874 e-Mail: Kambiz.Tavabi at uni-muenster.de ============================================ From r.oostenveld at FCDONDERS.RU.NL Tue Oct 11 22:18:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 11 Oct 2005 22:18:04 +0200 Subject: Error using ==> nargout In-Reply-To: <4CD85D348E46984983185B911CBF3ED1083B89@umcnet13.umcn.nl> Message-ID: Hi Kambiz, The subfunction "trialfun_ctf_epoched" is automatically selected if you specify a particular dataformat (CTF) in combination with particular cfg settings in preprocessing. The "trialfun_ctf_epoched" function is included in recent fieldtrip versions, and can be found in the private subdirectory. [Gijs, please update to a recent version]. Since it is not a functino that you should call directly, it is not included in the fieldtrip main directory. In general, user defined trialfunctions should return a "trl" matrix, but also can return a second structure with additional information. That second return argument is the "event" structure (see read_fcdc_event for more information). Fieldtrip is using the standard "nargout" function of Matlab to determine whether the trialfunction returns one or two output arguments. It seems that there is an incompatibility with the nargout function on specific combinations of Matlab with MS Windows. I have heard the problem from others as well, but have not been able to reproduce the problem myself since I do not have a Windows computer. Since 4 October I changed the nargout behaviour, and hope that that fixes the problem on Windows. Please download the latest version of fieldtrip from ftp:// ftp.fcdonders.nl/pub/fieldtrip, that should fix the problem. best regards, Robert On 11-okt-2005, at 21:56, Gijs van Elswijk wrote: > Hi, > > You have defined a trial function with the name > "trialfun_ctf_epoched" in the cfg structure. Supposedly, this > function (.m file) does not exist (or is not found somewhere in the > matlab path). Therefore, during preprocessing "nargout" is called > with an non-existing .m file as parameter and returns with an error. > > I've had the same problem recently. The solution would normally be > to set cfg.trialfun to an existing trial function or to create a > trial function with name "trialfun_ctf_epoched". However, in the > sample dataset of the tutorial no trial function was (is?) > included, and I think it is a bit hard to make one if you don't > know how trials are marked in the raw data. > > Jan-Mathijs has sent me an .m file with a trialfunction that worked > for this tutorial. Jan-Mathijs, is it allright if I forward that > file to Kambiz? > > Gijs > > -----Original Message----- > From: FieldTrip discussion list on behalf of Kambiz Tavabi > Sent: Tue 10/11/2005 4:26 PM > To: FIELDTRIP at NIC.SURFNET.NL > Cc: > Subject: [FIELDTRIP] Error using ==> nargout > > > > The errors below result from running the excerpt code provided > in the > FIELDTRIP tutorial/example MATLAB script for Time Frequency > analysis. My > MATLAB work directory is set to $:\Matlab\work\FIELDTRIP which > contains the > folder 'Subject01.ds' and associated head shape/MRI files. > > Any suggestions on what I am doing wrong? > > >> cfg = []; > cfg.dataset = 'Subject01.ds'; > cfg.channel = {'MEG' 'STIM'}; > cfg.trialdef.excludeConditions = {'BAD'}; > cfg.trialdef.includeTrigger = 3; > cfg.detrend = 'yes'; > > dataFIC = preprocessing(cfg); > evaluating trialfunction 'trialfun_ctf_epoched' > > > ??? Error using ==> nargout > Not a valid M-file. > > Error in ==> definetrial at 141 > num = nargout(cfg.trialfun); > > Error in ==> preprocessing at 263 > [cfg] = definetrial(cfg); > > > ============================================ > Kambiz Tavabi, Dipl. Psych., MS. > > Institute for Biomagnetism and Biosignalanalysis > Muenster University Hospital > > Malmedyweg 15 > D-48149 Muenster > Germany > > phone: +49-(0)251-83-56884 > fax: +49-(0)251-83-56874 > e-Mail: Kambiz.Tavabi at uni-muenster.de > > ============================================ > > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From holroydt at MAIL.NIH.GOV Wed Oct 19 00:47:40 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Tue, 18 Oct 2005 18:47:40 -0400 Subject: megrealign Message-ID: Is it possible, working with CTF data, for megrealign to also interpolate the reference channels? -- Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Wed Oct 19 08:53:27 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 19 Oct 2005 08:53:27 +0200 Subject: megrealign In-Reply-To: <43557B8C.1010308@mail.nih.gov> Message-ID: Hi Tom, On 19-okt-2005, at 0:47, Tom Holroyd wrote: > Is it possible, working with CTF data, for megrealign to also > interpolate the reference channels? You mean the channels that are far away from the head (Rxx etc.)? In theory, yes, but in practice no. There is little MEG information around those channels and if you rotate the helmet around the subjects head, the shift will be the largest in those channels. Therefore, after rotation of the helmet those channels might even move completely outside of the range that they cover by themselves. Furthermore, the signal that is picked up by those sensors is poorly modelled by the dipoles in the brain that MEGREALIGN uses. That is the actual purpose of them, that they pick up mostly noise and little brain signal. If you want to incorporate those channels in realigning, the best that I can imagine is to do the inverse estimation towards the brain dipoles using MEG+REF on 3rd order balanced data, and then do the forward calculation using (rotated+shifted) MEG alone. However, support for the 3rd order balanced MEG signals is still not implemented in FieldTrip. It is a recurring topic, which I am not too enthousiastic about to put much effort in, since it relates to incomplete specified file formats and it is more engineering than science. best Robert From holroydt at MAIL.NIH.GOV Wed Oct 19 13:35:28 2005 From: holroydt at MAIL.NIH.GOV (Tom Holroyd) Date: Wed, 19 Oct 2005 07:35:28 -0400 Subject: megrealign In-Reply-To: <95362BFC-3452-4448-A097-26E9ABEE74DB@fcdonders.ru.nl> Message-ID: On Wed, 19 Oct 2005, Robert Oostenveld wrote: > If you want to incorporate those channels in realigning, the best that I can > imagine is to do the inverse estimation towards the brain dipoles using > MEG+REF on 3rd order balanced data, and then do the forward calculation using > (rotated+shifted) MEG alone. That is in fact what I am doing now, and it's fine. Never mind. > However, support for the 3rd order balanced MEG signals is > still not implemented in FieldTrip. It is a recurring topic, > which I am not too enthousiastic about to put much effort in, > since it relates to incomplete specified file formats and it is > more engineering than science. Hmm? The reference channel positions and orientations are specified in the res4 file, just like all the other channels. By the way, I have a .oct file for meg_leadfield1.m so it works fast in Octave (like 800 times faster), in case anybody is interested. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From r.oostenveld at FCDONDERS.RU.NL Fri Oct 21 14:13:38 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 21 Oct 2005 14:13:38 +0200 Subject: megrealign In-Reply-To: Message-ID: On 19-okt-2005, at 13:35, Tom Holroyd wrote: > Hmm? The reference channel positions and orientations are > specified in the res4 file, just like all the other channels. Yes, but not the linear weighting of all channels that is used to construct the offline synthetic gradient. That is also stored in the res4, but I do not know how to get it out of there. The synthetic 3rd order gradient computation is MEG_3rd = T03 * MEG_0th where MEG_3rd is a Nchan by Ntimepoints matrix, just like MEG_0th, and T03 is the linear transformation matrix from 0th (unbalanced 1st order gradients) to 3rd order gradients. Similarly, the res4 should include teh information for MEG_1rd = T01 * MEG_0th MEG_2rd = T02 * MEG_0th MEG_3rd = T03 * MEG_0th Using those, you can also go back between different synthetic gradients of course (using the inverse of the Txy matrices). The simplest example is MEG_0th = T00 * MEG_0th which means that T00 is eye(Nchans). The Txy matrices should be used to premultiply the grad.tra matrix which is used in the forward model (i.e. the transformation of the field at all coils to the channel output). > By the way, I have a .oct file for meg_leadfield1.m so it works > fast in Octave (like 800 times faster), in case anybody is interested. Do you want me to put it in the release version? If so, send it to me and I'll include it. Robert From litvak at TECHUNIX.TECHNION.AC.IL Thu Oct 27 12:20:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 27 Oct 2005 12:20:00 +0200 Subject: Comparing waveforms Message-ID: Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Oct 27 12:33:01 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 27 Oct 2005 12:33:01 +0200 Subject: Comparing waveforms Message-ID: Hi Vladimir, You have to do nothing special. A waveforms is just a spatiotemporal datamatrix in which "space" is a point and thus represented by a single row. Eric ----- Original Message ----- From: Vladimir Litvak To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, October 27, 2005 12:20 PM Subject: [FIELDTRIP] Comparing waveforms Dear Robert and Eric, What do you think is the best way to compare 1D waveforms in clusterrandanalysis? Should I use the same settings I use for 2D scalpmaps (clustering in time) or something like maximal value would be better? If you think I should use something else please give me the exact settings for it. Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.buiatti at UNIV-PARIS5.FR Fri Oct 28 13:40:26 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 28 Oct 2005 13:40:26 +0200 Subject: about cluster randomization analysis Message-ID: Dear FieldTrippers, I'm using fieldtrip cluster randomization functions to investigate statistically significant differences between the ERPs of 8 subjects relative to two different experimental conditions. In order to prove the test performance, I'm using an experiment that shows an evident significant difference, easily detectable with a simple t-test. I have some difficulties though in interpreting the results, because they look to me very dependent on the parameters I use. My main question is therefore: is there any general rule of thumb you can propose in choosing the parameters? The procedure I am following now is a sort of two-steps method: in the first place, I choose a wide time interval and a low minimum number of channels. I end up with many clusters that are far from being significative. I then shorten the time interval to include just one cluster (starting from the most significant one), and increase the minimum number of channels, and run the analysis again. In this case, I eventually got a significative cluster where I was expecting it from a simple observation of the t-test. Do you think this procedure is right or am I doing something wrong? Is it correct to temporally focus on a cluster to check its significance? Another couple of questions: 1) Minnbchan. I understood it is the minimum number of significative neighbor (channel,time) points for a (channel,time) point to enter a cluster, no matter if adjacency is more in channel space or time direction. Am I right? Since time and channel space are quite different dimension, would it be better to set a minimum channel number separately for the two? 2) Maybe because my data are average-referenced, I often end up with a positive and negative cluster emerging almost at the same time. Have you thought about any way to include the search of dipole-like configurations? Thank you and have a good day. Marco -- Marco Buiatti - Post Doc ************************************************************** Cognitive Neuroimaging Unit - INSERM U562 Service Hospitalier Frederic Joliot, CEA/DRM/DSV 4 Place du general Leclerc, 91401 Orsay cedex, France Telephone: +33 1 69 86 77 65 Fax: +33 1 69 86 78 16 E-mail: marco.buiatti at gmail.com Web: www.unicog.org *************************************************************** From litvak at TECHUNIX.TECHNION.AC.IL Fri Oct 28 16:13:45 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Fri, 28 Oct 2005 15:13:45 +0100 Subject: about cluster randomization analysis In-Reply-To: <3172.172.20.62.10.1130499626.squirrel@webmail.univ-paris5.fr> Message-ID: Dear Marco, A quick comment about two of your points from someone who had similar experiences. 1) It is definitely wrong to zoom in on clusters the way you did. If you know in advance where you expect the effect you should make a window as narrow as possible around this time and then you will have higher detection power. If you take a large enough window you can get clusters of any size just by chance and then if you 'zoom in' on those clusters they will be significant but this is meaningless, the same as doing 100 t-tests and taking the 5 that crossed the threshold by chance as significant. 2) The clusterrandanalysis procedure can definitely be manipulated by re-referencing. So if you have a positive and a negative pole of the dipole none of which crosses the threshold, you can rereference to one of them and then there is a good chance the other will be significant. Again, this kind of manipulations is not quite 'kosher'. When I discussed that with Robert and Eric they said that one should decide in advance about a reasonable reference that is likely to reveal an effect. Best, Vladimir Litvak From maris at NICI.RU.NL Fri Oct 28 17:02:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 28 Oct 2005 17:02:00 +0200 Subject: about cluster randomization analysis Message-ID: Dear Marco, > The procedure I am following now is a sort of two-steps method: in the > first place, I choose a wide time interval and a low minimum number of > channels. I end up with many clusters that are far from being > significative. I then shorten the time interval to include just one > cluster (starting from the most significant one), and increase the minimum > number of channels, and run the analysis again. In this case, I eventually > got a significative cluster where I was expecting it from a simple > observation of the t-test. Do you think this procedure is right or am I > doing something wrong? Is it correct to temporally focus on a cluster to > check its significance? Clusterrandanalysis only controls the false alarm (type I error) rate if you choose the "tuning parameters" (latency interval, channel subset, the minnbchan-parameter; and if you use on TFRs, also the frequency interval) independent of the data. Instead, if you play around with these tuning parameters until you find a cluster whose p-value exceeds the critical alpha-level, you are not controlling the false alarm rate. In this case, the chosen tuning parameters depend on the data. An extreme example illustrates this even better. Assume you calculate T-statistics for all (channel, time point)-pairs and you select the pair with the largest T-statistic. Then, you select the latency interval that only contains this time point and the channel subset that only contains this channel. With these tuning parameters, you reduce your data to a single cell in the spatiotemporal matrix, and clusterrrandanalysis will produce a p-value that is very close to the p-value of a T-test. Since you have selected this (channel, time point)-pair on the basis of its T-statistic, this p-value is strongly biased. > Another couple of questions: > 1) Minnbchan. I understood it is the minimum number of significative > neighbor (channel,time) points for a (channel,time) point to enter a > cluster, no matter if adjacency is more in channel space or time > direction. Am I right? Since time and channel space are quite different > dimension, would it be better to set a minimum channel number separately > for the two? Minnbchan should also be chosen independent of the data. I introduced this tuning parameter because it turned out that in 3-dimensional analyses on TFRs (involving the dimensions time, space (i.e., sensors) and frequency), sometimes a cluster appeared that consisted of two or more 3-dimensional "blobs" that were connected by a single (channel, time, frequency)-element. >>From a physiological perspective, such a cluster does not make sense. To remove these physiologically implausible (and therefore probably random) connections, I introduced the minnbchan parameter. Because of this physiological rationale, I apply the minimum number criterium to the spatial, and not to the temporal dimension. Short-lived phenomena are very well possible from a physiological perspective, whereas effects at spatially isolated sensors are not. > 2) Maybe because my data are average-referenced, I often end up with a > positive and negative cluster emerging almost at the same time. Have you > thought about any way to include the search of dipole-like configurations? I have not thought about it, but it certainly makes sense to incorporate biophysical constraints (such dipolar patterns) in the test statistic. One should be aware of the fact that different hypotheses are tested before and after rereferencing. This is physical and not a statistical issue. As you most certainly know, EEG-signals are potential DIFFERENCES and therefore the underlying physiological events that are measured by EEG depend on the reference channel(s). If the experimental manipulation affects the current reference channel, then rereferencing to another channel (or set of channels) that is not affected by the experimental manipulation makes a difference for the result of the statistical test. greetings, Eric Maris From luis.patino at UNIKLINIK-FREIBURG.DE Mon Oct 31 09:46:47 2005 From: luis.patino at UNIKLINIK-FREIBURG.DE (Dr. Jose Luis Patino Vilchis) Date: Mon, 31 Oct 2005 09:46:47 +0100 Subject: Comparing waveforms In-Reply-To: <000601c5dadf$fce1dd30$90514484@dellgx240> Message-ID: Dear all, Could someone recommend me some litterature on the use of clusteranalysis on EEG data? Thanks in advance Luis Patino Zitat von Vladimir Litvak : > Dear Robert and Eric, > > > > What do you think is the best way to compare 1D waveforms in > clusterrandanalysis? Should I use the same settings I use for 2D > scalpmaps (clustering in time) or something like maximal value would be > better? If you think I should use something else please give me the > exact settings for it. > > > > Thanks, > > > > Vladimir > > From maris at NICI.RU.NL Mon Oct 31 10:29:02 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 31 Oct 2005 10:29:02 +0100 Subject: Comparing waveforms Message-ID: Hi Jose, There are two source of information on the Fieldtrip website: 1. A tutorial (Clusterrandanalysis.pdf), that you can find under Documentation. This tutorial uses data that can be found under Download. 2. A paper by Maris and Oostenveld (submitted) that shows why these calculations are statistically sound (i.e., result in decisions that control the false alarm rate) in a variety of designs. greetings, Eric Maris ----- Original Message ----- From: "Dr. Jose Luis Patino Vilchis" To: Sent: Monday, October 31, 2005 9:46 AM Subject: Re: [FIELDTRIP] Comparing waveforms > Dear all, > > Could someone recommend me some litterature on the use of clusteranalysis > on EEG > data? > > Thanks in advance > > Luis Patino > > Zitat von Vladimir Litvak : > >> Dear Robert and Eric, >> >> >> >> What do you think is the best way to compare 1D waveforms in >> clusterrandanalysis? Should I use the same settings I use for 2D >> scalpmaps (clustering in time) or something like maximal value would be >> better? If you think I should use something else please give me the >> exact settings for it. >> >> >> >> Thanks, >> >> >> >> Vladimir >> >>