From Andres.Posada at PSE.UNIGE.CH Wed Aug 1 15:15:25 2007 From: Andres.Posada at PSE.UNIGE.CH (Andres Posada) Date: Wed, 1 Aug 2007 15:15:25 +0200 Subject: 2 simple questions Message-ID: Dear Robert, Thanks for your advices, now it is working well! But I tried to apply beamforming methods in two different computers with SPM2 (and the template T1.mnc). I one it woks and in the other there is a error message: performing the segmentation on the specified volume ??? Cant map image file. Error in ==> spm_smoothto8bit>smoothto8bit at 51 img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); Error in ==> spm_smoothto8bit at 14 VO = smoothto8bit(V,fwhm); Error in ==> spm_segment>get_affine_mapping at 233 VFS = spm_smoothto8bit(VF(1),aflags.smosrc); Error in ==> spm_segment>init_sp at 567 MM = get_affine_mapping(VF,PG,flags.affreg); Error in ==> spm_segment at 91 SP = init_sp(flags.estimate,VF,PG); Error in ==> volumesegment at 246 spm_segment(Va,cfg.template,flags); Error in ==> temp at 7 [segmentedmri] = volumesegment(cfg, mri); The only difference between the two computers is the Matlab version. In one, the working one, is version 7 R14 SP1; in the other (the error message), is version 7 R14 SP3. Do you know if the newest version of matlab is incompatible with SPM2 and FieldTrip. Thanks Andres ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 1 15:36:25 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 1 Aug 2007 09:36:25 -0400 Subject: 2 simple questions In-Reply-To: Message-ID: Hi Andres, I have had exactly the same "cant map image file" problem tyring to plot beamforming data on the SPM2 MRI subject. However, the problem only seems to come up using the volumesegment function, if you plot the data without calling volumesegment Fieldtrip can open the MRI image file (presumably without a call to SPM2?). But in this case Fieldtrip created a headmodel based on the subject's headshpae from a *.pos file and the gradiometer info from CTF. But does anyone know if the "cant map image file" error is because of the specific Matlab version and SPM2 ? andy ----- Original Message ----- From: Andres Posada Date: Wednesday, August 1, 2007 9:15 am Subject: Re: [FIELDTRIP] 2 simple questions To: FIELDTRIP at NIC.SURFNET.NL > Dear Robert, > > Thanks for your advices, now it is working well! > But I tried to apply beamforming methods in two different computers with > SPM2 (and the template T1.mnc). I one it woks and in the other there > is a > error message: > > performing the segmentation on the specified volume > ??? Cant map image file. > > Error in ==> spm_smoothto8bit>smoothto8bit at 51 > img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); > > Error in ==> spm_smoothto8bit at 14 > VO = smoothto8bit(V,fwhm); > > Error in ==> spm_segment>get_affine_mapping at 233 > VFS = spm_smoothto8bit(VF(1),aflags.smosrc); > > Error in ==> spm_segment>init_sp at 567 > MM = get_affine_mapping(VF,PG,flags.affreg); > > Error in ==> spm_segment at 91 > SP = init_sp(flags.estimate,VF,PG); > > Error in ==> volumesegment at 246 > spm_segment(Va,cfg.template,flags); > > Error in ==> temp at 7 > [segmentedmri] = volumesegment(cfg, mri); > > The only difference between the two computers is the Matlab version. > In one, > the working one, is version 7 R14 SP1; in the other (the error > message), is > version 7 R14 SP3. > Do you know if the newest version of matlab is incompatible with SPM2 > and > FieldTrip. > Thanks > Andres > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 10:14:52 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 10:14:52 +0200 Subject: one-sided clusteranalysis Message-ID: i'm testing acivation versus baseline of distinct time-frequency windows consisting of power-increase or decrease using clusterrandanalysis with cfg.onetwo = 'onesided_act Message-ID: Dear Claudia, > i'm testing acivation versus baseline of distinct time-frequency windows > consisting of power-increase or decrease using clusterrandanalysis with > cfg.onetwo = 'onesided_act to obtain only positive clusters by this analysis but most often it > results in positive and negative clusters. is this right? an why do > negative clusters reach significance in a one-sided test? Could you send me the code and the data that you use for this analysis? Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > thanks > claudia > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf > Körperschaft des öffentlichen Rechts > Gerichtsstand: Hamburg > > Vorstandsmitglieder: > Prof. Dr. Jörg F. Debatin (Vorsitzender) > Dr. Alexander Kirstein > Ricarda Klein > Prof. Dr. Dr. Uwe Koch-Gromus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 12:35:21 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 12:35:21 +0200 Subject: one-sided clusteranalysis Message-ID: hi eric, this is the code for a decrease in power, data are too large to be attached. cfg = []; cfg.channel = {'all', '-e32', '-e103', '-e120'}; cfg.latency = 'all'; cfg.frequency = 'all'; cfg.statistic = 'actvsblT'; cfg.alphathresh = 0.05; cfg.clusterteststat = 'maxsum'; cfg.minnbchan = 2; cfg.onetwo = 'onesided_bl Dear Claudia, > > > >> i'm testing acivation versus baseline of distinct time-frequency windows >> consisting of power-increase or decrease using clusterrandanalysis with >> cfg.onetwo = 'onesided_act> to obtain only positive clusters by this analysis but most often it >> results in positive and negative clusters. is this right? an why do >> negative clusters reach significance in a one-sided test? >> > > Could you send me the code and the data that you use for this analysis? > > > Eric Maris > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > > > > > > >> thanks >> claudia >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf >> Körperschaft des öffentlichen Rechts >> Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: >> Prof. Dr. Jörg F. Debatin (Vorsitzender) >> Dr. Alexander Kirstein >> Ricarda Klein >> Prof. Dr. Dr. Uwe Koch-Gromus >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ The original MIME headers for this attachment are: Content-Type: application/octet-stream; name="grandavg_hi_un_h4_ind.mat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="grandavg_hi_un_h4_ind.mat" -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Dr. Uwe Koch-Gromus From tillmann at MPIH-FRANKFURT.MPG.DE Mon Aug 6 16:42:04 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Mon, 6 Aug 2007 16:42:04 +0200 Subject: Trial definition and artifact rejection Message-ID: Dear all, I have a question concerning data preprocessing; does anybody know how to specify different time windows for 1) the definition of correct trials and 2) artifact rejection? So far, I have used a function that looks for correct data segments defined by a stimulus trigger and the button press following within a 1sec window after the trigger. These segments are then further analysed with artifact rejection. Since I lose a lot of trials with this procedure because reaction times seem to be a little longer, I wanna use a longer time window, e.g. 2 sec., for defining correct trials, and then shorten the segments again so that the artifact rejection and all further analysis steps are only performed with 1sec. long windows.... I would be glad if anyone had an idea how to solve this problem! Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:40:19 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:40:19 +0200 Subject: Trial definition and artifact rejection In-Reply-To: <07080616420492_2800013E@mpih-frankfurt.mpg.de> Message-ID: Dear Cristine On 6 Aug 2007, at 16:42, Christine Tillmann wrote: > I have a question concerning data preprocessing; > does anybody know how to specify different time windows > for 1) the definition of correct trials and 2) artifact rejection? I presume that you are referring to the automatic artifact detection (ARTFACT_XXX) and the REJECTARTIFACT function. > So far, I have used a function that looks for correct data segments > defined by a stimulus trigger and the button press following within a > 1sec window after the trigger. These segments are then further > analysed > with artifact rejection. Since I lose a lot of trials with this > procedure because reaction times seem to be a little longer, I > wanna use > a longer time window, e.g. 2 sec., for defining correct trials, and > then > shorten the segments again so that the artifact rejection and all > further analysis steps are only performed with 1sec. long windows.... > > I would be glad if anyone had an idea how to solve this problem! By default the artifact_xxx functions scan the segments that you have marked in cfg.trl (i.e. using definetrial and your custom trial function) plus some additional padding. See figure 1 on http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:artifactdetect This also means that you can specify a different cfg.trl for the artifact_xxx detection functions than in rejectartifact. E.g. you can do cfg = [] cfg = ... cfg1 = definetrial(cfg) % condition 1 cfg2 = definetrial(cfg) % condition 2 cfg.trl = [cfg1.trl; cfg2.trl];; cfg = artifact_eog(cfg); % scan all trials for artifacts simultaneously cfg.trl = cfg1.trl % condition 1 cfg1_clean = rejectartifact(cfg); cfg.trl = cfg2.trl % condition 2 cfg2_clean = rejectartifact(cfg); data1 = preprocessing(cfg1_clean) data2 = preprocessing(cfg2_clean) The padded data is read into memory, bandpass filterend and hilbert transformed to estimate the instntaneous amplitude of the signal in that specific frequency band. The filtering and hilbert transformation often results in edge artifacts, hence the filter padding is required. The filter padding is removed from each segment before further processing and thersholding of the data. That you loose a lot of trials may be related to not specifying enough filter padding. Shortening the trials then will not help. If you specify cfg.artfctdef.xxx.feedback=yes, then you can look in detail at the reason why trials are rejected. Note that the output of artifact_xxx is an updated cfg.artfctdef.xxx structure. You can look in cfg.artfctdef.xxx.artifact (and e.g. preprocess those segments) to see where the artifacts were. That is a Nx2 matrix similar to "trl" (see definetrial) but without the offset in the last column (which should be added, e.g. with zeros, if you wish to use it to read in he data with preprocessing). If the automatic artifact rejection is too difficult to get to work on your data (it was designed for continuous CTF data and is not guaranteed to work on other data), then I suggest that you use REJECTVISUAL instead. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:47:50 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:47:50 +0200 Subject: problems using dics In-Reply-To: Message-ID: On 30 Jul 2007, at 15:08, Nathan Weisz wrote: > the problem here is that the noise is set to 0. while executing the > code this warning message appears: > Warning: cross-spectral density matrix is rank deficient > > In beamformer_dics at 161 > In sourceanalysis at 855 > > a look at the code shows that in this case that the noise is set to > lambda (empty and set to 0 per default). I then tried different > lamdas but as results varied quite a lot I have an uneasy feeling > doing it this way. > > question: is there something apparently wrong with the configs that > leads to the problem of not being able to make a noise estimate > from the CSD? Hi Nathan The noise floor is estimated by the smallest singular value of the CSD/COV matrix. Since yours is rank deficient, it seems as if the noise level is zero. The estimated projected noise scales linearly with the estimated noise in the CSD, and since nai=pow/noise, it will be Inf if noise=0. Once you start tweaking lambda, you are both influencing the spatial filters (regularization) and the estimate of the noise floor (in case of a rank deficient CSD matrix). Since your data probably is sufficiently cleaned by ICA, the regularisation is probably not required. Than means that if you specify a very small lambda, the regularisation will not yet be noticeable. The noise projection however will already be linearly scaled with the lambda (now the assumed noise floor) and nai can be computed. Note that nai is proportional to 1/lambda. So just specify a lambda that is very small (compared to the svd spectrum of the CSD) and please check that the nai scales linearly with it without the spatial distribution of the nai changing. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jaredvs at GMAIL.COM Mon Aug 6 21:59:31 2007 From: jaredvs at GMAIL.COM (Jared Van Snellenberg) Date: Mon, 6 Aug 2007 15:59:31 -0400 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: Message-ID: Hi Robert, I'm using the BEM head model you supplied, and have a quick question about it. From plotting the results of this approach, the grid appears to only extend as low as the level of the anterior commisure. Is this intended? If so, I presume it's because of the difficulty in localizing deep sources? Thanks in advance. -Jared On 7/7/07, Robert Oostenveld wrote: > > On 7 Jul 2007, at 5:12, Jared Van Snellenberg wrote: > > > Quick question about the BEM model you supplied--is it correct to > > just pass in the vol structure contained in the standard_vol.mat > > along with an elec structure containing the nx3 array of electrode > > coordinates in MNI space? That is, is the following correct: > > > > load standard_vol.mat > > cfg.vol=vol; > > cfg.elec=elec; %predefined; 59 electrode coordinates in MNI > > results=sourceanalysis(cfg,data); > > Yes, but only if the electrode labels in your data match with the > complete set or a subset of the labels in elec (it is case > sensitive). The intersection of data.label and elec.label will be > used for sourecanalysis. However, for EEG source analysis your data > should be average referenced. And that is something that you do > during preprocessing (or optionally timelockanalysis). That means > that all channels in your data for which there is a corresponding > electrode position in the elec structure should be average referenced. > > Prior to sourceanalysis, you can use the headmodelplot function (or > electroderealign with method=interactive) to check that the > electrodes ly on the skin compartment of the MNI head model. > > regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- Jared Van Snellenberg Social Cognitive Affective Neuroscience Unit http://scan.psych.columbia.edu (212) 854-7858 p (212) 854-3609 f Department of Psychology, Columbia University 406 Schermerhorn Hall 1190 Amsterdam Avenue, Mail Code 5501 New York, NY 10027 _______________________________ "Luck is the residue of design" -Attributed to Branch Rickey, former US Baseball Administrator, and also to John Milton. Go figure. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Mon Aug 6 22:38:31 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 6 Aug 2007 16:38:31 -0400 Subject: plotting clusters Message-ID: Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Aug 7 09:33:26 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Aug 2007 09:33:26 +0200 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: <51d499680708061259x243aa152l12665451085738ee@mail.gmail.com> Message-ID: On 6 Aug 2007, at 21:59, Jared Van Snellenberg wrote: > I'm using the BEM head model you supplied, and have a quick > question about it. From plotting the results of this approach, the > grid appears to only extend as low as the level of the anterior > commisure. Is this intended? If so, I presume it's because of the > difficulty in localizing deep sources? Thanks in advance. Hi Jared, There is no reason not to let the grid extend all the way down to the bottom of the cerebellum. At the lower locations it will be less sensitive and more blurred, but that should not stop you from looking there. If you use cfg.grid.xgrid='auto' etc. for sourceanalysis/ prepare_leadfield, then the grid is determined from a box that tightly fits the electrodes. Probably that is why you don't see low grid locations, because you do not have sufficiently low electrodes. Just do cfg.grid.xgrid = -100:10:100 % in milimeter, since MNI coordinates cfg.grid.ygrid = -140:10:120 cfg.grid.zgrid = -70:10:120 cfg.tightgrid = 'yes' and you probably should get a complete coverage (you may want to play with the numbers to get it right). The tightgrid option makes the bounding box of the grid as tight as possible around the brain compartment after making the grid and after checking which locations are in the brain. That helps in reducing the number of irrelevant/ outside-brain grid locations. So starting with a grid from -300:10:300 in each direction would also be fine, since tightgrid=yes ensures that the bounding box will be as tight as can be. It will just be slower if you start with a grid that is too wide around the brain. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 7 10:55:25 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 7 Aug 2007 10:55:25 +0200 Subject: plotting clusters In-Reply-To: Message-ID: Hi Sameer, If I understand correctly you want to not plot data but just the sensors that are significant in one color and the rest in another. If you look in the help of the function topoplot.m (this function is called both by topoplotER and topoplotTFR) you can see many extra options, including highlighting options. If you want the sensors themselves to be colored and no data underneath you could use a cfg like this: Cfg.style = 'blank'; Cfg.highlight = electrode numbers you want to highlight Cfg.hlcolor = color you want for the highlight Cfg.ecolor = color you want for the other electrodes If you call topoplotER or topopltTFR the cfg is passed on to topoplot.m, but you could also call topoplot.m directly. But if you do that look in the help of topoplot.m how it wants it's data. You do have to give in some structure as data even if the style is blank, but since it isn't plotted it doesn't matter what is in it. On the FieldTrip page there is also a tutorial on plotting containing more information: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tu torial:plotting Hope this is what you meant. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, August 06, 2007 10:39 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] plotting clusters Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marie at PSY.GLA.AC.UK Wed Aug 15 15:58:32 2007 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Wed, 15 Aug 2007 14:58:32 +0100 Subject: Converting from fieldtrip output to anatomical regions Message-ID: I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Wed Aug 15 20:43:58 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 15 Aug 2007 14:43:58 -0400 Subject: cfg.width in freqanalysis_wltconvol Message-ID: Hello, For freqanalysis_wltconvol, cfg.toi dictates the times on which the analysis windows should be centered. How do I use cfg.width and cfg.gwidth such that I can define the width of the window in terms of seconds (or msecs) I want? It will have to be constant across all frequencies. Also, if I calculate for width w, will freqanalysis_wltconvol use [t-w/2 t+w/2] or [t-w t+w]? thanks, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Thu Aug 16 10:44:20 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 10:44:20 +0200 Subject: Statistical testing of coherence differences Message-ID: Dear Fieldtrip Discussion List Readers, I have received several emails froms FT-users who want to statistically test coherence differences in single subjects. This methodology was described in a recent paper in the Journal of Neuroscience Methods (Maris, Schoffelen, and Fries, 2007). To perform the same analysis on your own data using FT, you should take the following into account: 1. You must use the FT-function clusterrandanalysis. This is the oldest statistics function in FT, and was written for the most part by Eric Maris. Robert Oostenveld has recently set up a completely new statistics framework. However, this framework does not yet contain functionality to do statistical testing of coherence differences. This is in the pipeline, but at this moment you still have to use the old clusterrandanalysis. 2. You can test coherence differences for (1) all channel pairs or (2) for all channel pairs that have a common reference channel. Only the latter analysis was described in JNM paper and is also the one that was most extensively tested. I strongly advice you to stick to the reference channel analysis. Most likely, you will get memory problem with the other option. >>From now on, I assume that you will be doing a reference channel analysis. 3. The input data for clusterrandanalysis is the output of two freqanalysis runs, one every experimental condition. 4. cfg.statistic must be 'indepsamplesZcoh'. 5. cfg.channelcmb must contain a Mx2 cell array of pairs of channel labels that all contain the reference channel. 6. cfg.chancmbgeom must be 'refchan'. Good luck, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Aug 16 11:11:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 11:11:10 +0200 Subject: clusterrandanalysis questions Message-ID: Dear Sameer, > 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >From my understanding, it seems that one sided tests only look for > positive clusters i.e. the test statistic higher than cfg.alphathresh. > Thus clusters showing up as posclusters for coherence difference in one > case should not show up at all in the other. Yet, both the tests seem to > give me same clusters. If this is the case, then there is an error in the code. Can you send me your config and screen output of clusterrandanalysis? > > 2) using cfg.onetwo = twosided I should get clusters which in some > way are union of the two sets above. Yet, I seem to get completely > different clusters, sometimes with nothing in common between twosided and > onsesided tests. The clusters with the twosided-option should NOT be the union of the clusters with the two onesided options. This is because the thresholding values with the twosided-option are at cfg.alphathresh/2 and (1-cfg.alphathresh/2), whereas for the two onesided options they should be at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > 3) Most clusters I find seem to have a high p-value. Would the > confidence increase if I use a different alphathresh which I think is used > for thresholding the Z-statistic for defining clusters. (I just realized > that I neglected to define cfg.alphathresh and though I could not find a > default value used in clusterandanalysis, the program is obviously using > some). On the basis of my experience, I do not expect a substantial influence of the cfg.alphathresh value on the p-values. > 4) What is the motivation behind cfg.minnbchan ? Should it be based > upon the neurobiological effect I am investigating? The motivation behind cfg.minnbchan is that some samples (i.e., channel-frequency-pairs or channel-frequency-time-triplets) with a big sample-specific statistic may have a few neighbouring samples with also a big sample-specific statistic, just by chance. To "prune out" these chance connections, set cfg.minnbchan high (e.g., 3). Kind regards, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Fri Aug 17 20:25:30 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 17 Aug 2007 14:25:30 -0400 Subject: clusterrandanalysis questions In-Reply-To: <00ca01c7dfe5$631ae400$b0ccae83@fcdonders.nl> Message-ID: Thanks Eric for your email, Given below is the info you have asked. best, sameer cfg = []; cfg.channelcmb = ['MEG1833' 'MEG']; cfg.statistic = 'indepsamplesZcoh' ; cfg.alphathres = 0.05 ; cfg.alpha = 0.05 ; cfg.clusterteststat = 'maxsum' ; cfg.onetwo = 'onesided_1<2' ; cfg.makeclusters = 'yes' ; cfg.minnbchan = 2; cfg.nranddraws = 500; [clusrand] = clusterrandanalysis(cfg, CSD1 , CSD2); screen O/P Selecting and formatting the data. selected 511 channelcombinations selected 1 time bins selected 13 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the gradiometer configuration from the first dataset. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 500 . . . randomization 499 500 randomization 500 500 clusrand = stats: [205x13 double] raweffect: [205x13 double] obsmeanc1: [205x13 double] obsmeanc2: [205x13 double] posclusters: [1x7 struct] negclusters: [] posclusterslabelmat: [205x13 double] negclusterslabelmat: [] critvals: 204.1906 labelcmb: {205x2 cell} freq: [6 8 10 12 14 16 18 20 22 24 26 28 30] time: NaN cfg: [1x1 struct] On Thu, 16 Aug 2007, Eric Maris wrote: > Dear Sameer, > > > > > >> 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >>> From my understanding, it seems that one sided tests only look for > >> positive clusters i.e. the test statistic higher than cfg.alphathresh. > >> Thus clusters showing up as posclusters for coherence difference in one > >> case should not show up at all in the other. Yet, both the tests seem to > >> give me same clusters. > > > > If this is the case, then there is an error in the code. Can you send me > your config and screen output of clusterrandanalysis? > > > >> > >> 2) using cfg.onetwo = twosided I should get clusters which in some > >> way are union of the two sets above. Yet, I seem to get completely > >> different clusters, sometimes with nothing in common between twosided and > >> onsesided tests. > > > > The clusters with the twosided-option should NOT be the union of the > clusters with the two onesided options. This is because the thresholding > values with the twosided-option are at cfg.alphathresh/2 and > (1-cfg.alphathresh/2), whereas for the two onesided options they should be > at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > > > > > >> 3) Most clusters I find seem to have a high p-value. Would the > >> confidence increase if I use a different alphathresh which I think is used > >> for thresholding the Z-statistic for defining clusters. (I just realized > >> that I neglected to define cfg.alphathresh and though I could not find a > >> default value used in clusterandanalysis, the program is obviously using > >> some). > > > > On the basis of my experience, I do not expect a substantial influence of > the cfg.alphathresh value on the p-values. > > > >> 4) What is the motivation behind cfg.minnbchan ? Should it be based > >> upon the neurobiological effect I am investigating? > > > > The motivation behind cfg.minnbchan is that some samples (i.e., > channel-frequency-pairs or channel-frequency-time-triplets) with a big > sample-specific statistic may have a few neighbouring samples with also a > big sample-specific statistic, just by chance. To "prune out" these chance > connections, set cfg.minnbchan high (e.g., 3). > > > > > > Kind regards, > > > > Eric Maris > > > > > > > > > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience : > www.ru.nl/master/cns/ > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Aug 21 09:36:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 21 Aug 2007 09:36:11 +0200 Subject: EEG & lcmv Message-ID: Hi, I am struggling with the sourceanalysis of EEG data which was recorded with Biosemi 128 electrodes. the data are visual evoked potentials. the topographies look very good and dipolar. below some code attached. one thing i find suspicious is that the 'avg.pow' field after sourceanalysis contains some negative values ... i reckon this shouldn't be the case. the call to sourceanalysis is very close to calls i did with MEG data yielding good localizations. the greatest potential error source i see is that i use electrode positions from the standard_1005 file in order to use the standard BEM model. this is done by choosing the index from the standard-1005 closest to the biosemi elecrode locations (placed on a sphere). for this i use matlabs dsearchn function. mistakes at this step would seriously screw up the forward model. however checking the electrode locations on the standard MRI using sourceplot looks sensible however ... so at this stage i am not sure whether it's a headmodelproblem or something else i am missing / overlooked. as always, any help is greatly appreciated. cheers, n %first search for electrodes closest in the standard 1005 elec4grid=data.elec; elec4grid.pnt=[-data.elec.pnt(:,2),data.elec.pnt(:,1),data.elec.pnt(:, 3)]*85; stelec=read_fcdc_elec('standard_1005.elc'); ind=zeros(1,128); for i=1:128 ind(i)=dsearchn(stelec.pnt,elec4grid.pnt(i,:)); stelec.pnt(ind(i),:)=NaN; %avoids double choosing of electrodes end stelec=read_fcdc_elec('standard_1005.elc'); elec4grid.pnt=stelec.pnt(ind,:); cfg=[]; cfg.grid=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.grid.resolution=10; cfg.vol=vol; %this is the standard BEM from Fieldtrip / eeglab cfg.elec=elec4grid; grid=prepare_leadfield(cfg); cfg=[]; cfg.covariance='yes'; cfg.preproc.reref='yes';%it should be average reference already. just to be sure. cfg.preproc.refchannel='all'; cfg.latency=[-.3 -.1]; cfg.covariancewindow = [-.3 .1]; baseERP=timelockanalysis(cfg,data); cfg.latency=[0.1 .3]; cfg.covariancewindow = [.1 .3]; visuERP=timelockanalysis(cfg,data); cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=elec4grid; cfg.grid=grid; baseS=sourceanalysis(cfg,baseERP); visuS=sourceanalysis(cfg,visuERP); visuSn=visuS; motorSn=motorS; visuSn.avg.pow=visuS.avg.pow./baseS.avg.noise; motorSn.avg.pow=motorS.avg.pow./baseS.avg.pow; %%%COMMENT 17: %%%The solutions then have to be interpolated on the standard MRI. cfg = []; cfg.downsample = 2; cfg.sourceunits='mm'; visuS_int = sourceinterpolate(cfg, visuSn, mri); motorS_int = sourceinterpolate(cfg, motorSn, mri); -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 16:50:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 16:50:02 +0200 Subject: multitapers and high gamma band activity Message-ID: Hi all, I'm doing time-frequency analysis based on multitapers. Do you have any suggestions how many tapers should optimally be used when analysing activity in the higher gamma band (30-150Hz)and how I would implement this in the freqanalysis function? Currently I'm using the following parameters: cfg.t_ftimwin = 5./cfg.foi and cfg.tapsmofrq = 0.4*cfg.foi Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 17:03:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 17:03:02 +0200 Subject: baselinetype zscore? Message-ID: Hi everyone, I got another question concerning time-frequency analysis: I wanna compute the relative change in power from baseline based on z scores. I saw that there is this option 'baselinetype' = 'zscore' in the freqbaseline function, but the TFzscore subfunction is currently uncommented. Is it possible to use this option? Best regards, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Pascal.Fries at FCDONDERS.RU.NL Tue Aug 21 22:16:39 2007 From: Pascal.Fries at FCDONDERS.RU.NL (Pascal Fries) Date: Tue, 21 Aug 2007 22:16:39 +0200 Subject: multitapers and high gamma band activity In-Reply-To: <07082116500234_2800013E@mpih-frankfurt.mpg.de> Message-ID: Hi Christine, The parameters that you specified are OK and can be used. In general, you should make sure that the cfg.foi contains integer multiples of the Rayleigh frequency (1/cfg.t_ftimwin) and the spectral concentration should also be small integer multiples of the Rayleigh frequencies, e.g. between 3 and 11. Cfg.tapsmofrq specifies half the spectral concentration and thus, your configuration gives a spectral concentration of 4 times the Rayleigh frequency - approximately, because two tapers (with poor concentration properties) are dismissed. Thus: You're configuration is fully OK. But: I generally discourage to use window lengths and spectral concentrations that change as a function of frequency. Such an approach is often inspired by Wavelet analyses. But it precludes any intepretation of a spectral pattern, because the analysis at different frequencies is based on different data segments and different degrees of freedom. This is what we typically use for the gamma frequencies: T_ftimwin of 0.25 s -> Rayleigh frequency of 4 Hz Spectral concentration (tapsmofrq) of plus/minus 12 Hz (up to 20 Hz). All the best, Pascal Pascal Fries Principal Investigator F.C. Donders Centre for Cognitive Neuroimaging Kapittelweg 29, 6525 EN Nijmegen, Netherlands E-mail: pascal.fries at fcdonders.ru.nl Website: www.ru.nl/fcdonders/ Phone: (+31) (0)24 36 10657 Fax: (+31) (0)24 36 10989 > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christine Tillmann > Sent: Tuesday, August 21, 2007 4:50 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] multitapers and high gamma band activity > > Hi all, > > I'm doing time-frequency analysis based on multitapers. Do > you have any suggestions how many tapers should optimally be > used when analysing activity in the higher gamma band > (30-150Hz)and how I would implement this in the freqanalysis function? > > Currently I'm using the following parameters: > cfg.t_ftimwin = 5./cfg.foi and > cfg.tapsmofrq = 0.4*cfg.foi > > Thanks in advance, > Christine > > ---------------------------------- > The aim of this list is to facilitate the discussion between > users of the FieldTrip toolbox, to share experiences and to > discuss new ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Thu Aug 23 19:10:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 23 Aug 2007 19:10:32 +0200 Subject: artifact threshold and TFR trial length Message-ID: Hi, In the artifact_threshold hold function it says one should specify the thresholds or range in uV/T, is this �V/T? And what are useful values for this function for MEG data? I have been trying different values but could use some guidance. Also, I have a dataset from a CTF 275 channel machine using epoched recording (ie non- continuous) and it was recorded with only a 100 ms prestimulus baseline and a 900 ms post-stim length. I would like to do time-frequency and beamforming analysis but am having trouble. So far for example I have used this code to look at the alpha frequency, but would like to look at all frequencies: load PreprocData cfg = []; cfg.toilim = [0 0.5]; %t to avoid NaNs in the ouput datacond1 = redefinetrial(cfg,dataSP); cfg = []; cfg.method='mtmfft'; cfg.output='powandcsd'; cfg.tapsmofrq=4; cfg.foilim =[10 12]; freqcond1 = freqanalysis(cfg,datacond1); Do you have any suggestions for this situation? Is the trial length simply too short for using the TFR functions? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Fri Aug 24 18:41:10 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 24 Aug 2007 18:41:10 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters Message-ID: Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 10:49:17 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 10:49:17 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, You can find the option cfg.highlight in the function topoplot.m, this function is called by topoplotER (also by topoplotTFR by the way). It should contain the channel numbers which you want to highlight. Why your plot doesn't give any highlighted sensors is hard to say without knowing your data (what did you give in to timelockstatistics with which cfg). - It could be that the time you plot (0:0.05:0.5) does not contain the clusters - It could be the specification of m [1:15:301], this is exactly copied from the tutorial, but it is based on the sample frequency of the data used there. In the tutorial a second of data is used, cut up in 21 pieces from 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 pieces 1:15:301. You should adjust m to you own time settings and sample frequency. - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of this? For the highlighting to work it should contain the sensor numbers to be highlighted. If your m is not specified correctly I would guess that pos_int and neg_int are not specified correctly and cfg.highlight turnes up empty and therefore no highlights are plotted. Hope this give you some ideas to find out what's wrong. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Friday, August 24, 2007 6:41 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 16:14:38 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 16:14:38 +0200 Subject: Converting from fieldtrip output to anatomical regions In-Reply-To: Message-ID: Dear Marie, Currently this is not build in the sourceplot function yet. What you could do is use a template from SPM and use volumenormalize to transform it to that template. I know there is a MNI template in SPM2 (T1.mnc), but I don't know about Talairach though. If you then use sourceplot with cfg.interactive = 'yes' and you click on a place in the brain, it spits out a location, which I think is then in MNI space, but you should confirm this with an atlas because I'm not sure. I'm sorry I can't help you anymore, maybe someone with more fMRI experience can add to this. What I usually do is just look up the location in an atlas, the spatial resolution is so poor that you should not report things on a mm precision anyway. Hope this helps a little bit. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marie Smith Sent: Wednesday, August 15, 2007 3:59 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Converting from fieldtrip output to anatomical regions I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 17:41:05 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 11:41:05 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, Thank you for the answer. The output of cfg.highlight = find(pos_int==1|neg_int==-1) is in fact empty as you say, so this might depend on giving the wrong sampling frequency in m? The data I have is sampled at 600. So should m be then something like m= [1:30:600] if my time window of interst is 0-500 ms? I did find topoplot eventually and tried the different settings but I think the problem is as you suggest with the inputs to the plot. I use the within-subjects input to the statistics function given in the tutorial as: cfg = []; cfg.channel = {'MEG'}; cfg.latency = [0.0 0.5]; % so the effect shouldn't be outside this % time interval, correct? cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; cfg.layout = 'CTF275.lay'; subj = 16; design=zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = timelockstatistics(cfg, grandavgID, grandavgUN); Thank you for your help! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 20:02:14 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 14:02:14 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Aug 30 15:28:59 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Aug 2007 15:28:59 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, - where does this size come from if my sample rate is 600?: The size 267x301 means 267 channels x 301 samples. You have 301 samples because your latency in timelockanalysis was cfg.latency = [0.0 0.5]; so that's 301 samples with sample rate 600 Plotting the output from the randomization can be quite tricky, because you have 301 moments in time where you can have a cluster. In the tutorial a trick was used. There they also had 301 time points, but a sample rate of 300 -> spanning one second. If you exactly want to know where the clusters are you would have to plot all the 301 time points. Because that doesn't make sense they average over 50 millisecond time windows. If for instance k=10 -> pos_int = mean(pos(:,m(k):m(k+1))')' -> an average is made over samples 136-151 time is 0.45-0.5s giving the 10th plot in the figure. Only those sensors that are part of the cluster for this whole time window (all 15 time points) give out a mean of 1 or -1 and are plotted. In the tutorial data the cluster was present over a long time window in many sensors, therefore there were many sensors with 1 or -1. For your data this doesn't work, but you do have significant clusters. "I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270)" For instance this means that the positive clusters are in channel 59:168 at time points 149:172, with a sample rate of 600 this means from 0.248 to 0.287 seconds. You should adjust the loop in such a way that you put the settings that they fit your data. So for instance make the time resolution higher (by adjusting j and m) since you have clusters that are short lived in time, and to have not to many plots, plot around the time where you know your clusters are. Hope this solves your stuck-ness, Good luck again. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Wednesday, August 29, 2007 8:02 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Thu Aug 30 22:53:00 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 30 Aug 2007 16:53:00 -0400 Subject: using freqanalysis_wltconvol Message-ID: Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Jan.Schoffelen at FCDONDERS.RU.NL Fri Aug 31 09:09:11 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 31 Aug 2007 09:09:11 +0200 Subject: using freqanalysis_wltconvol In-Reply-To: Message-ID: Dear Sameer, If you want to have equal window sizes for all frequencies, you should use freqanalysis_mtmconvol. Yours, JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, August 30, 2007 10:53 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] using freqanalysis_wltconvol Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Andres.Posada at PSE.UNIGE.CH Wed Aug 1 15:15:25 2007 From: Andres.Posada at PSE.UNIGE.CH (Andres Posada) Date: Wed, 1 Aug 2007 15:15:25 +0200 Subject: 2 simple questions Message-ID: Dear Robert, Thanks for your advices, now it is working well! But I tried to apply beamforming methods in two different computers with SPM2 (and the template T1.mnc). I one it woks and in the other there is a error message: performing the segmentation on the specified volume ??? Cant map image file. Error in ==> spm_smoothto8bit>smoothto8bit at 51 img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); Error in ==> spm_smoothto8bit at 14 VO = smoothto8bit(V,fwhm); Error in ==> spm_segment>get_affine_mapping at 233 VFS = spm_smoothto8bit(VF(1),aflags.smosrc); Error in ==> spm_segment>init_sp at 567 MM = get_affine_mapping(VF,PG,flags.affreg); Error in ==> spm_segment at 91 SP = init_sp(flags.estimate,VF,PG); Error in ==> volumesegment at 246 spm_segment(Va,cfg.template,flags); Error in ==> temp at 7 [segmentedmri] = volumesegment(cfg, mri); The only difference between the two computers is the Matlab version. In one, the working one, is version 7 R14 SP1; in the other (the error message), is version 7 R14 SP3. Do you know if the newest version of matlab is incompatible with SPM2 and FieldTrip. Thanks Andres ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 1 15:36:25 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 1 Aug 2007 09:36:25 -0400 Subject: 2 simple questions In-Reply-To: Message-ID: Hi Andres, I have had exactly the same "cant map image file" problem tyring to plot beamforming data on the SPM2 MRI subject. However, the problem only seems to come up using the volumesegment function, if you plot the data without calling volumesegment Fieldtrip can open the MRI image file (presumably without a call to SPM2?). But in this case Fieldtrip created a headmodel based on the subject's headshpae from a *.pos file and the gradiometer info from CTF. But does anyone know if the "cant map image file" error is because of the specific Matlab version and SPM2 ? andy ----- Original Message ----- From: Andres Posada Date: Wednesday, August 1, 2007 9:15 am Subject: Re: [FIELDTRIP] 2 simple questions To: FIELDTRIP at NIC.SURFNET.NL > Dear Robert, > > Thanks for your advices, now it is working well! > But I tried to apply beamforming methods in two different computers with > SPM2 (and the template T1.mnc). I one it woks and in the other there > is a > error message: > > performing the segmentation on the specified volume > ??? Cant map image file. > > Error in ==> spm_smoothto8bit>smoothto8bit at 51 > img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); > > Error in ==> spm_smoothto8bit at 14 > VO = smoothto8bit(V,fwhm); > > Error in ==> spm_segment>get_affine_mapping at 233 > VFS = spm_smoothto8bit(VF(1),aflags.smosrc); > > Error in ==> spm_segment>init_sp at 567 > MM = get_affine_mapping(VF,PG,flags.affreg); > > Error in ==> spm_segment at 91 > SP = init_sp(flags.estimate,VF,PG); > > Error in ==> volumesegment at 246 > spm_segment(Va,cfg.template,flags); > > Error in ==> temp at 7 > [segmentedmri] = volumesegment(cfg, mri); > > The only difference between the two computers is the Matlab version. > In one, > the working one, is version 7 R14 SP1; in the other (the error > message), is > version 7 R14 SP3. > Do you know if the newest version of matlab is incompatible with SPM2 > and > FieldTrip. > Thanks > Andres > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 10:14:52 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 10:14:52 +0200 Subject: one-sided clusteranalysis Message-ID: i'm testing acivation versus baseline of distinct time-frequency windows consisting of power-increase or decrease using clusterrandanalysis with cfg.onetwo = 'onesided_act Message-ID: Dear Claudia, > i'm testing acivation versus baseline of distinct time-frequency windows > consisting of power-increase or decrease using clusterrandanalysis with > cfg.onetwo = 'onesided_act to obtain only positive clusters by this analysis but most often it > results in positive and negative clusters. is this right? an why do > negative clusters reach significance in a one-sided test? Could you send me the code and the data that you use for this analysis? Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > thanks > claudia > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf > Körperschaft des öffentlichen Rechts > Gerichtsstand: Hamburg > > Vorstandsmitglieder: > Prof. Dr. Jörg F. Debatin (Vorsitzender) > Dr. Alexander Kirstein > Ricarda Klein > Prof. Dr. Dr. Uwe Koch-Gromus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 12:35:21 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 12:35:21 +0200 Subject: one-sided clusteranalysis Message-ID: hi eric, this is the code for a decrease in power, data are too large to be attached. cfg = []; cfg.channel = {'all', '-e32', '-e103', '-e120'}; cfg.latency = 'all'; cfg.frequency = 'all'; cfg.statistic = 'actvsblT'; cfg.alphathresh = 0.05; cfg.clusterteststat = 'maxsum'; cfg.minnbchan = 2; cfg.onetwo = 'onesided_bl Dear Claudia, > > > >> i'm testing acivation versus baseline of distinct time-frequency windows >> consisting of power-increase or decrease using clusterrandanalysis with >> cfg.onetwo = 'onesided_act> to obtain only positive clusters by this analysis but most often it >> results in positive and negative clusters. is this right? an why do >> negative clusters reach significance in a one-sided test? >> > > Could you send me the code and the data that you use for this analysis? > > > Eric Maris > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > > > > > > >> thanks >> claudia >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf >> Körperschaft des öffentlichen Rechts >> Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: >> Prof. Dr. Jörg F. Debatin (Vorsitzender) >> Dr. Alexander Kirstein >> Ricarda Klein >> Prof. Dr. Dr. Uwe Koch-Gromus >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ The original MIME headers for this attachment are: Content-Type: application/octet-stream; name="grandavg_hi_un_h4_ind.mat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="grandavg_hi_un_h4_ind.mat" -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Dr. Uwe Koch-Gromus From tillmann at MPIH-FRANKFURT.MPG.DE Mon Aug 6 16:42:04 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Mon, 6 Aug 2007 16:42:04 +0200 Subject: Trial definition and artifact rejection Message-ID: Dear all, I have a question concerning data preprocessing; does anybody know how to specify different time windows for 1) the definition of correct trials and 2) artifact rejection? So far, I have used a function that looks for correct data segments defined by a stimulus trigger and the button press following within a 1sec window after the trigger. These segments are then further analysed with artifact rejection. Since I lose a lot of trials with this procedure because reaction times seem to be a little longer, I wanna use a longer time window, e.g. 2 sec., for defining correct trials, and then shorten the segments again so that the artifact rejection and all further analysis steps are only performed with 1sec. long windows.... I would be glad if anyone had an idea how to solve this problem! Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:40:19 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:40:19 +0200 Subject: Trial definition and artifact rejection In-Reply-To: <07080616420492_2800013E@mpih-frankfurt.mpg.de> Message-ID: Dear Cristine On 6 Aug 2007, at 16:42, Christine Tillmann wrote: > I have a question concerning data preprocessing; > does anybody know how to specify different time windows > for 1) the definition of correct trials and 2) artifact rejection? I presume that you are referring to the automatic artifact detection (ARTFACT_XXX) and the REJECTARTIFACT function. > So far, I have used a function that looks for correct data segments > defined by a stimulus trigger and the button press following within a > 1sec window after the trigger. These segments are then further > analysed > with artifact rejection. Since I lose a lot of trials with this > procedure because reaction times seem to be a little longer, I > wanna use > a longer time window, e.g. 2 sec., for defining correct trials, and > then > shorten the segments again so that the artifact rejection and all > further analysis steps are only performed with 1sec. long windows.... > > I would be glad if anyone had an idea how to solve this problem! By default the artifact_xxx functions scan the segments that you have marked in cfg.trl (i.e. using definetrial and your custom trial function) plus some additional padding. See figure 1 on http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:artifactdetect This also means that you can specify a different cfg.trl for the artifact_xxx detection functions than in rejectartifact. E.g. you can do cfg = [] cfg = ... cfg1 = definetrial(cfg) % condition 1 cfg2 = definetrial(cfg) % condition 2 cfg.trl = [cfg1.trl; cfg2.trl];; cfg = artifact_eog(cfg); % scan all trials for artifacts simultaneously cfg.trl = cfg1.trl % condition 1 cfg1_clean = rejectartifact(cfg); cfg.trl = cfg2.trl % condition 2 cfg2_clean = rejectartifact(cfg); data1 = preprocessing(cfg1_clean) data2 = preprocessing(cfg2_clean) The padded data is read into memory, bandpass filterend and hilbert transformed to estimate the instntaneous amplitude of the signal in that specific frequency band. The filtering and hilbert transformation often results in edge artifacts, hence the filter padding is required. The filter padding is removed from each segment before further processing and thersholding of the data. That you loose a lot of trials may be related to not specifying enough filter padding. Shortening the trials then will not help. If you specify cfg.artfctdef.xxx.feedback=yes, then you can look in detail at the reason why trials are rejected. Note that the output of artifact_xxx is an updated cfg.artfctdef.xxx structure. You can look in cfg.artfctdef.xxx.artifact (and e.g. preprocess those segments) to see where the artifacts were. That is a Nx2 matrix similar to "trl" (see definetrial) but without the offset in the last column (which should be added, e.g. with zeros, if you wish to use it to read in he data with preprocessing). If the automatic artifact rejection is too difficult to get to work on your data (it was designed for continuous CTF data and is not guaranteed to work on other data), then I suggest that you use REJECTVISUAL instead. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:47:50 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:47:50 +0200 Subject: problems using dics In-Reply-To: Message-ID: On 30 Jul 2007, at 15:08, Nathan Weisz wrote: > the problem here is that the noise is set to 0. while executing the > code this warning message appears: > Warning: cross-spectral density matrix is rank deficient > > In beamformer_dics at 161 > In sourceanalysis at 855 > > a look at the code shows that in this case that the noise is set to > lambda (empty and set to 0 per default). I then tried different > lamdas but as results varied quite a lot I have an uneasy feeling > doing it this way. > > question: is there something apparently wrong with the configs that > leads to the problem of not being able to make a noise estimate > from the CSD? Hi Nathan The noise floor is estimated by the smallest singular value of the CSD/COV matrix. Since yours is rank deficient, it seems as if the noise level is zero. The estimated projected noise scales linearly with the estimated noise in the CSD, and since nai=pow/noise, it will be Inf if noise=0. Once you start tweaking lambda, you are both influencing the spatial filters (regularization) and the estimate of the noise floor (in case of a rank deficient CSD matrix). Since your data probably is sufficiently cleaned by ICA, the regularisation is probably not required. Than means that if you specify a very small lambda, the regularisation will not yet be noticeable. The noise projection however will already be linearly scaled with the lambda (now the assumed noise floor) and nai can be computed. Note that nai is proportional to 1/lambda. So just specify a lambda that is very small (compared to the svd spectrum of the CSD) and please check that the nai scales linearly with it without the spatial distribution of the nai changing. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jaredvs at GMAIL.COM Mon Aug 6 21:59:31 2007 From: jaredvs at GMAIL.COM (Jared Van Snellenberg) Date: Mon, 6 Aug 2007 15:59:31 -0400 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: Message-ID: Hi Robert, I'm using the BEM head model you supplied, and have a quick question about it. From plotting the results of this approach, the grid appears to only extend as low as the level of the anterior commisure. Is this intended? If so, I presume it's because of the difficulty in localizing deep sources? Thanks in advance. -Jared On 7/7/07, Robert Oostenveld wrote: > > On 7 Jul 2007, at 5:12, Jared Van Snellenberg wrote: > > > Quick question about the BEM model you supplied--is it correct to > > just pass in the vol structure contained in the standard_vol.mat > > along with an elec structure containing the nx3 array of electrode > > coordinates in MNI space? That is, is the following correct: > > > > load standard_vol.mat > > cfg.vol=vol; > > cfg.elec=elec; %predefined; 59 electrode coordinates in MNI > > results=sourceanalysis(cfg,data); > > Yes, but only if the electrode labels in your data match with the > complete set or a subset of the labels in elec (it is case > sensitive). The intersection of data.label and elec.label will be > used for sourecanalysis. However, for EEG source analysis your data > should be average referenced. And that is something that you do > during preprocessing (or optionally timelockanalysis). That means > that all channels in your data for which there is a corresponding > electrode position in the elec structure should be average referenced. > > Prior to sourceanalysis, you can use the headmodelplot function (or > electroderealign with method=interactive) to check that the > electrodes ly on the skin compartment of the MNI head model. > > regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- Jared Van Snellenberg Social Cognitive Affective Neuroscience Unit http://scan.psych.columbia.edu (212) 854-7858 p (212) 854-3609 f Department of Psychology, Columbia University 406 Schermerhorn Hall 1190 Amsterdam Avenue, Mail Code 5501 New York, NY 10027 _______________________________ "Luck is the residue of design" -Attributed to Branch Rickey, former US Baseball Administrator, and also to John Milton. Go figure. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Mon Aug 6 22:38:31 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 6 Aug 2007 16:38:31 -0400 Subject: plotting clusters Message-ID: Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Aug 7 09:33:26 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Aug 2007 09:33:26 +0200 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: <51d499680708061259x243aa152l12665451085738ee@mail.gmail.com> Message-ID: On 6 Aug 2007, at 21:59, Jared Van Snellenberg wrote: > I'm using the BEM head model you supplied, and have a quick > question about it. From plotting the results of this approach, the > grid appears to only extend as low as the level of the anterior > commisure. Is this intended? If so, I presume it's because of the > difficulty in localizing deep sources? Thanks in advance. Hi Jared, There is no reason not to let the grid extend all the way down to the bottom of the cerebellum. At the lower locations it will be less sensitive and more blurred, but that should not stop you from looking there. If you use cfg.grid.xgrid='auto' etc. for sourceanalysis/ prepare_leadfield, then the grid is determined from a box that tightly fits the electrodes. Probably that is why you don't see low grid locations, because you do not have sufficiently low electrodes. Just do cfg.grid.xgrid = -100:10:100 % in milimeter, since MNI coordinates cfg.grid.ygrid = -140:10:120 cfg.grid.zgrid = -70:10:120 cfg.tightgrid = 'yes' and you probably should get a complete coverage (you may want to play with the numbers to get it right). The tightgrid option makes the bounding box of the grid as tight as possible around the brain compartment after making the grid and after checking which locations are in the brain. That helps in reducing the number of irrelevant/ outside-brain grid locations. So starting with a grid from -300:10:300 in each direction would also be fine, since tightgrid=yes ensures that the bounding box will be as tight as can be. It will just be slower if you start with a grid that is too wide around the brain. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 7 10:55:25 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 7 Aug 2007 10:55:25 +0200 Subject: plotting clusters In-Reply-To: Message-ID: Hi Sameer, If I understand correctly you want to not plot data but just the sensors that are significant in one color and the rest in another. If you look in the help of the function topoplot.m (this function is called both by topoplotER and topoplotTFR) you can see many extra options, including highlighting options. If you want the sensors themselves to be colored and no data underneath you could use a cfg like this: Cfg.style = 'blank'; Cfg.highlight = electrode numbers you want to highlight Cfg.hlcolor = color you want for the highlight Cfg.ecolor = color you want for the other electrodes If you call topoplotER or topopltTFR the cfg is passed on to topoplot.m, but you could also call topoplot.m directly. But if you do that look in the help of topoplot.m how it wants it's data. You do have to give in some structure as data even if the style is blank, but since it isn't plotted it doesn't matter what is in it. On the FieldTrip page there is also a tutorial on plotting containing more information: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tu torial:plotting Hope this is what you meant. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, August 06, 2007 10:39 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] plotting clusters Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marie at PSY.GLA.AC.UK Wed Aug 15 15:58:32 2007 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Wed, 15 Aug 2007 14:58:32 +0100 Subject: Converting from fieldtrip output to anatomical regions Message-ID: I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Wed Aug 15 20:43:58 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 15 Aug 2007 14:43:58 -0400 Subject: cfg.width in freqanalysis_wltconvol Message-ID: Hello, For freqanalysis_wltconvol, cfg.toi dictates the times on which the analysis windows should be centered. How do I use cfg.width and cfg.gwidth such that I can define the width of the window in terms of seconds (or msecs) I want? It will have to be constant across all frequencies. Also, if I calculate for width w, will freqanalysis_wltconvol use [t-w/2 t+w/2] or [t-w t+w]? thanks, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Thu Aug 16 10:44:20 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 10:44:20 +0200 Subject: Statistical testing of coherence differences Message-ID: Dear Fieldtrip Discussion List Readers, I have received several emails froms FT-users who want to statistically test coherence differences in single subjects. This methodology was described in a recent paper in the Journal of Neuroscience Methods (Maris, Schoffelen, and Fries, 2007). To perform the same analysis on your own data using FT, you should take the following into account: 1. You must use the FT-function clusterrandanalysis. This is the oldest statistics function in FT, and was written for the most part by Eric Maris. Robert Oostenveld has recently set up a completely new statistics framework. However, this framework does not yet contain functionality to do statistical testing of coherence differences. This is in the pipeline, but at this moment you still have to use the old clusterrandanalysis. 2. You can test coherence differences for (1) all channel pairs or (2) for all channel pairs that have a common reference channel. Only the latter analysis was described in JNM paper and is also the one that was most extensively tested. I strongly advice you to stick to the reference channel analysis. Most likely, you will get memory problem with the other option. >>From now on, I assume that you will be doing a reference channel analysis. 3. The input data for clusterrandanalysis is the output of two freqanalysis runs, one every experimental condition. 4. cfg.statistic must be 'indepsamplesZcoh'. 5. cfg.channelcmb must contain a Mx2 cell array of pairs of channel labels that all contain the reference channel. 6. cfg.chancmbgeom must be 'refchan'. Good luck, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Aug 16 11:11:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 11:11:10 +0200 Subject: clusterrandanalysis questions Message-ID: Dear Sameer, > 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >From my understanding, it seems that one sided tests only look for > positive clusters i.e. the test statistic higher than cfg.alphathresh. > Thus clusters showing up as posclusters for coherence difference in one > case should not show up at all in the other. Yet, both the tests seem to > give me same clusters. If this is the case, then there is an error in the code. Can you send me your config and screen output of clusterrandanalysis? > > 2) using cfg.onetwo = twosided I should get clusters which in some > way are union of the two sets above. Yet, I seem to get completely > different clusters, sometimes with nothing in common between twosided and > onsesided tests. The clusters with the twosided-option should NOT be the union of the clusters with the two onesided options. This is because the thresholding values with the twosided-option are at cfg.alphathresh/2 and (1-cfg.alphathresh/2), whereas for the two onesided options they should be at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > 3) Most clusters I find seem to have a high p-value. Would the > confidence increase if I use a different alphathresh which I think is used > for thresholding the Z-statistic for defining clusters. (I just realized > that I neglected to define cfg.alphathresh and though I could not find a > default value used in clusterandanalysis, the program is obviously using > some). On the basis of my experience, I do not expect a substantial influence of the cfg.alphathresh value on the p-values. > 4) What is the motivation behind cfg.minnbchan ? Should it be based > upon the neurobiological effect I am investigating? The motivation behind cfg.minnbchan is that some samples (i.e., channel-frequency-pairs or channel-frequency-time-triplets) with a big sample-specific statistic may have a few neighbouring samples with also a big sample-specific statistic, just by chance. To "prune out" these chance connections, set cfg.minnbchan high (e.g., 3). Kind regards, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Fri Aug 17 20:25:30 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 17 Aug 2007 14:25:30 -0400 Subject: clusterrandanalysis questions In-Reply-To: <00ca01c7dfe5$631ae400$b0ccae83@fcdonders.nl> Message-ID: Thanks Eric for your email, Given below is the info you have asked. best, sameer cfg = []; cfg.channelcmb = ['MEG1833' 'MEG']; cfg.statistic = 'indepsamplesZcoh' ; cfg.alphathres = 0.05 ; cfg.alpha = 0.05 ; cfg.clusterteststat = 'maxsum' ; cfg.onetwo = 'onesided_1<2' ; cfg.makeclusters = 'yes' ; cfg.minnbchan = 2; cfg.nranddraws = 500; [clusrand] = clusterrandanalysis(cfg, CSD1 , CSD2); screen O/P Selecting and formatting the data. selected 511 channelcombinations selected 1 time bins selected 13 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the gradiometer configuration from the first dataset. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 500 . . . randomization 499 500 randomization 500 500 clusrand = stats: [205x13 double] raweffect: [205x13 double] obsmeanc1: [205x13 double] obsmeanc2: [205x13 double] posclusters: [1x7 struct] negclusters: [] posclusterslabelmat: [205x13 double] negclusterslabelmat: [] critvals: 204.1906 labelcmb: {205x2 cell} freq: [6 8 10 12 14 16 18 20 22 24 26 28 30] time: NaN cfg: [1x1 struct] On Thu, 16 Aug 2007, Eric Maris wrote: > Dear Sameer, > > > > > >> 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >>> From my understanding, it seems that one sided tests only look for > >> positive clusters i.e. the test statistic higher than cfg.alphathresh. > >> Thus clusters showing up as posclusters for coherence difference in one > >> case should not show up at all in the other. Yet, both the tests seem to > >> give me same clusters. > > > > If this is the case, then there is an error in the code. Can you send me > your config and screen output of clusterrandanalysis? > > > >> > >> 2) using cfg.onetwo = twosided I should get clusters which in some > >> way are union of the two sets above. Yet, I seem to get completely > >> different clusters, sometimes with nothing in common between twosided and > >> onsesided tests. > > > > The clusters with the twosided-option should NOT be the union of the > clusters with the two onesided options. This is because the thresholding > values with the twosided-option are at cfg.alphathresh/2 and > (1-cfg.alphathresh/2), whereas for the two onesided options they should be > at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > > > > > >> 3) Most clusters I find seem to have a high p-value. Would the > >> confidence increase if I use a different alphathresh which I think is used > >> for thresholding the Z-statistic for defining clusters. (I just realized > >> that I neglected to define cfg.alphathresh and though I could not find a > >> default value used in clusterandanalysis, the program is obviously using > >> some). > > > > On the basis of my experience, I do not expect a substantial influence of > the cfg.alphathresh value on the p-values. > > > >> 4) What is the motivation behind cfg.minnbchan ? Should it be based > >> upon the neurobiological effect I am investigating? > > > > The motivation behind cfg.minnbchan is that some samples (i.e., > channel-frequency-pairs or channel-frequency-time-triplets) with a big > sample-specific statistic may have a few neighbouring samples with also a > big sample-specific statistic, just by chance. To "prune out" these chance > connections, set cfg.minnbchan high (e.g., 3). > > > > > > Kind regards, > > > > Eric Maris > > > > > > > > > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience : > www.ru.nl/master/cns/ > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Aug 21 09:36:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 21 Aug 2007 09:36:11 +0200 Subject: EEG & lcmv Message-ID: Hi, I am struggling with the sourceanalysis of EEG data which was recorded with Biosemi 128 electrodes. the data are visual evoked potentials. the topographies look very good and dipolar. below some code attached. one thing i find suspicious is that the 'avg.pow' field after sourceanalysis contains some negative values ... i reckon this shouldn't be the case. the call to sourceanalysis is very close to calls i did with MEG data yielding good localizations. the greatest potential error source i see is that i use electrode positions from the standard_1005 file in order to use the standard BEM model. this is done by choosing the index from the standard-1005 closest to the biosemi elecrode locations (placed on a sphere). for this i use matlabs dsearchn function. mistakes at this step would seriously screw up the forward model. however checking the electrode locations on the standard MRI using sourceplot looks sensible however ... so at this stage i am not sure whether it's a headmodelproblem or something else i am missing / overlooked. as always, any help is greatly appreciated. cheers, n %first search for electrodes closest in the standard 1005 elec4grid=data.elec; elec4grid.pnt=[-data.elec.pnt(:,2),data.elec.pnt(:,1),data.elec.pnt(:, 3)]*85; stelec=read_fcdc_elec('standard_1005.elc'); ind=zeros(1,128); for i=1:128 ind(i)=dsearchn(stelec.pnt,elec4grid.pnt(i,:)); stelec.pnt(ind(i),:)=NaN; %avoids double choosing of electrodes end stelec=read_fcdc_elec('standard_1005.elc'); elec4grid.pnt=stelec.pnt(ind,:); cfg=[]; cfg.grid=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.grid.resolution=10; cfg.vol=vol; %this is the standard BEM from Fieldtrip / eeglab cfg.elec=elec4grid; grid=prepare_leadfield(cfg); cfg=[]; cfg.covariance='yes'; cfg.preproc.reref='yes';%it should be average reference already. just to be sure. cfg.preproc.refchannel='all'; cfg.latency=[-.3 -.1]; cfg.covariancewindow = [-.3 .1]; baseERP=timelockanalysis(cfg,data); cfg.latency=[0.1 .3]; cfg.covariancewindow = [.1 .3]; visuERP=timelockanalysis(cfg,data); cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=elec4grid; cfg.grid=grid; baseS=sourceanalysis(cfg,baseERP); visuS=sourceanalysis(cfg,visuERP); visuSn=visuS; motorSn=motorS; visuSn.avg.pow=visuS.avg.pow./baseS.avg.noise; motorSn.avg.pow=motorS.avg.pow./baseS.avg.pow; %%%COMMENT 17: %%%The solutions then have to be interpolated on the standard MRI. cfg = []; cfg.downsample = 2; cfg.sourceunits='mm'; visuS_int = sourceinterpolate(cfg, visuSn, mri); motorS_int = sourceinterpolate(cfg, motorSn, mri); -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 16:50:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 16:50:02 +0200 Subject: multitapers and high gamma band activity Message-ID: Hi all, I'm doing time-frequency analysis based on multitapers. Do you have any suggestions how many tapers should optimally be used when analysing activity in the higher gamma band (30-150Hz)and how I would implement this in the freqanalysis function? Currently I'm using the following parameters: cfg.t_ftimwin = 5./cfg.foi and cfg.tapsmofrq = 0.4*cfg.foi Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 17:03:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 17:03:02 +0200 Subject: baselinetype zscore? Message-ID: Hi everyone, I got another question concerning time-frequency analysis: I wanna compute the relative change in power from baseline based on z scores. I saw that there is this option 'baselinetype' = 'zscore' in the freqbaseline function, but the TFzscore subfunction is currently uncommented. Is it possible to use this option? Best regards, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Pascal.Fries at FCDONDERS.RU.NL Tue Aug 21 22:16:39 2007 From: Pascal.Fries at FCDONDERS.RU.NL (Pascal Fries) Date: Tue, 21 Aug 2007 22:16:39 +0200 Subject: multitapers and high gamma band activity In-Reply-To: <07082116500234_2800013E@mpih-frankfurt.mpg.de> Message-ID: Hi Christine, The parameters that you specified are OK and can be used. In general, you should make sure that the cfg.foi contains integer multiples of the Rayleigh frequency (1/cfg.t_ftimwin) and the spectral concentration should also be small integer multiples of the Rayleigh frequencies, e.g. between 3 and 11. Cfg.tapsmofrq specifies half the spectral concentration and thus, your configuration gives a spectral concentration of 4 times the Rayleigh frequency - approximately, because two tapers (with poor concentration properties) are dismissed. Thus: You're configuration is fully OK. But: I generally discourage to use window lengths and spectral concentrations that change as a function of frequency. Such an approach is often inspired by Wavelet analyses. But it precludes any intepretation of a spectral pattern, because the analysis at different frequencies is based on different data segments and different degrees of freedom. This is what we typically use for the gamma frequencies: T_ftimwin of 0.25 s -> Rayleigh frequency of 4 Hz Spectral concentration (tapsmofrq) of plus/minus 12 Hz (up to 20 Hz). All the best, Pascal Pascal Fries Principal Investigator F.C. Donders Centre for Cognitive Neuroimaging Kapittelweg 29, 6525 EN Nijmegen, Netherlands E-mail: pascal.fries at fcdonders.ru.nl Website: www.ru.nl/fcdonders/ Phone: (+31) (0)24 36 10657 Fax: (+31) (0)24 36 10989 > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christine Tillmann > Sent: Tuesday, August 21, 2007 4:50 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] multitapers and high gamma band activity > > Hi all, > > I'm doing time-frequency analysis based on multitapers. Do > you have any suggestions how many tapers should optimally be > used when analysing activity in the higher gamma band > (30-150Hz)and how I would implement this in the freqanalysis function? > > Currently I'm using the following parameters: > cfg.t_ftimwin = 5./cfg.foi and > cfg.tapsmofrq = 0.4*cfg.foi > > Thanks in advance, > Christine > > ---------------------------------- > The aim of this list is to facilitate the discussion between > users of the FieldTrip toolbox, to share experiences and to > discuss new ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Thu Aug 23 19:10:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 23 Aug 2007 19:10:32 +0200 Subject: artifact threshold and TFR trial length Message-ID: Hi, In the artifact_threshold hold function it says one should specify the thresholds or range in uV/T, is this �V/T? And what are useful values for this function for MEG data? I have been trying different values but could use some guidance. Also, I have a dataset from a CTF 275 channel machine using epoched recording (ie non- continuous) and it was recorded with only a 100 ms prestimulus baseline and a 900 ms post-stim length. I would like to do time-frequency and beamforming analysis but am having trouble. So far for example I have used this code to look at the alpha frequency, but would like to look at all frequencies: load PreprocData cfg = []; cfg.toilim = [0 0.5]; %t to avoid NaNs in the ouput datacond1 = redefinetrial(cfg,dataSP); cfg = []; cfg.method='mtmfft'; cfg.output='powandcsd'; cfg.tapsmofrq=4; cfg.foilim =[10 12]; freqcond1 = freqanalysis(cfg,datacond1); Do you have any suggestions for this situation? Is the trial length simply too short for using the TFR functions? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Fri Aug 24 18:41:10 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 24 Aug 2007 18:41:10 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters Message-ID: Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 10:49:17 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 10:49:17 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, You can find the option cfg.highlight in the function topoplot.m, this function is called by topoplotER (also by topoplotTFR by the way). It should contain the channel numbers which you want to highlight. Why your plot doesn't give any highlighted sensors is hard to say without knowing your data (what did you give in to timelockstatistics with which cfg). - It could be that the time you plot (0:0.05:0.5) does not contain the clusters - It could be the specification of m [1:15:301], this is exactly copied from the tutorial, but it is based on the sample frequency of the data used there. In the tutorial a second of data is used, cut up in 21 pieces from 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 pieces 1:15:301. You should adjust m to you own time settings and sample frequency. - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of this? For the highlighting to work it should contain the sensor numbers to be highlighted. If your m is not specified correctly I would guess that pos_int and neg_int are not specified correctly and cfg.highlight turnes up empty and therefore no highlights are plotted. Hope this give you some ideas to find out what's wrong. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Friday, August 24, 2007 6:41 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 16:14:38 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 16:14:38 +0200 Subject: Converting from fieldtrip output to anatomical regions In-Reply-To: Message-ID: Dear Marie, Currently this is not build in the sourceplot function yet. What you could do is use a template from SPM and use volumenormalize to transform it to that template. I know there is a MNI template in SPM2 (T1.mnc), but I don't know about Talairach though. If you then use sourceplot with cfg.interactive = 'yes' and you click on a place in the brain, it spits out a location, which I think is then in MNI space, but you should confirm this with an atlas because I'm not sure. I'm sorry I can't help you anymore, maybe someone with more fMRI experience can add to this. What I usually do is just look up the location in an atlas, the spatial resolution is so poor that you should not report things on a mm precision anyway. Hope this helps a little bit. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marie Smith Sent: Wednesday, August 15, 2007 3:59 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Converting from fieldtrip output to anatomical regions I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 17:41:05 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 11:41:05 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, Thank you for the answer. The output of cfg.highlight = find(pos_int==1|neg_int==-1) is in fact empty as you say, so this might depend on giving the wrong sampling frequency in m? The data I have is sampled at 600. So should m be then something like m= [1:30:600] if my time window of interst is 0-500 ms? I did find topoplot eventually and tried the different settings but I think the problem is as you suggest with the inputs to the plot. I use the within-subjects input to the statistics function given in the tutorial as: cfg = []; cfg.channel = {'MEG'}; cfg.latency = [0.0 0.5]; % so the effect shouldn't be outside this % time interval, correct? cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; cfg.layout = 'CTF275.lay'; subj = 16; design=zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = timelockstatistics(cfg, grandavgID, grandavgUN); Thank you for your help! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 20:02:14 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 14:02:14 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Aug 30 15:28:59 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Aug 2007 15:28:59 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, - where does this size come from if my sample rate is 600?: The size 267x301 means 267 channels x 301 samples. You have 301 samples because your latency in timelockanalysis was cfg.latency = [0.0 0.5]; so that's 301 samples with sample rate 600 Plotting the output from the randomization can be quite tricky, because you have 301 moments in time where you can have a cluster. In the tutorial a trick was used. There they also had 301 time points, but a sample rate of 300 -> spanning one second. If you exactly want to know where the clusters are you would have to plot all the 301 time points. Because that doesn't make sense they average over 50 millisecond time windows. If for instance k=10 -> pos_int = mean(pos(:,m(k):m(k+1))')' -> an average is made over samples 136-151 time is 0.45-0.5s giving the 10th plot in the figure. Only those sensors that are part of the cluster for this whole time window (all 15 time points) give out a mean of 1 or -1 and are plotted. In the tutorial data the cluster was present over a long time window in many sensors, therefore there were many sensors with 1 or -1. For your data this doesn't work, but you do have significant clusters. "I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270)" For instance this means that the positive clusters are in channel 59:168 at time points 149:172, with a sample rate of 600 this means from 0.248 to 0.287 seconds. You should adjust the loop in such a way that you put the settings that they fit your data. So for instance make the time resolution higher (by adjusting j and m) since you have clusters that are short lived in time, and to have not to many plots, plot around the time where you know your clusters are. Hope this solves your stuck-ness, Good luck again. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Wednesday, August 29, 2007 8:02 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Thu Aug 30 22:53:00 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 30 Aug 2007 16:53:00 -0400 Subject: using freqanalysis_wltconvol Message-ID: Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Jan.Schoffelen at FCDONDERS.RU.NL Fri Aug 31 09:09:11 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 31 Aug 2007 09:09:11 +0200 Subject: using freqanalysis_wltconvol In-Reply-To: Message-ID: Dear Sameer, If you want to have equal window sizes for all frequencies, you should use freqanalysis_mtmconvol. Yours, JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, August 30, 2007 10:53 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] using freqanalysis_wltconvol Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Andres.Posada at PSE.UNIGE.CH Wed Aug 1 15:15:25 2007 From: Andres.Posada at PSE.UNIGE.CH (Andres Posada) Date: Wed, 1 Aug 2007 15:15:25 +0200 Subject: 2 simple questions Message-ID: Dear Robert, Thanks for your advices, now it is working well! But I tried to apply beamforming methods in two different computers with SPM2 (and the template T1.mnc). I one it woks and in the other there is a error message: performing the segmentation on the specified volume ??? Cant map image file. Error in ==> spm_smoothto8bit>smoothto8bit at 51 img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); Error in ==> spm_smoothto8bit at 14 VO = smoothto8bit(V,fwhm); Error in ==> spm_segment>get_affine_mapping at 233 VFS = spm_smoothto8bit(VF(1),aflags.smosrc); Error in ==> spm_segment>init_sp at 567 MM = get_affine_mapping(VF,PG,flags.affreg); Error in ==> spm_segment at 91 SP = init_sp(flags.estimate,VF,PG); Error in ==> volumesegment at 246 spm_segment(Va,cfg.template,flags); Error in ==> temp at 7 [segmentedmri] = volumesegment(cfg, mri); The only difference between the two computers is the Matlab version. In one, the working one, is version 7 R14 SP1; in the other (the error message), is version 7 R14 SP3. Do you know if the newest version of matlab is incompatible with SPM2 and FieldTrip. Thanks Andres ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 1 15:36:25 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 1 Aug 2007 09:36:25 -0400 Subject: 2 simple questions In-Reply-To: Message-ID: Hi Andres, I have had exactly the same "cant map image file" problem tyring to plot beamforming data on the SPM2 MRI subject. However, the problem only seems to come up using the volumesegment function, if you plot the data without calling volumesegment Fieldtrip can open the MRI image file (presumably without a call to SPM2?). But in this case Fieldtrip created a headmodel based on the subject's headshpae from a *.pos file and the gradiometer info from CTF. But does anyone know if the "cant map image file" error is because of the specific Matlab version and SPM2 ? andy ----- Original Message ----- From: Andres Posada Date: Wednesday, August 1, 2007 9:15 am Subject: Re: [FIELDTRIP] 2 simple questions To: FIELDTRIP at NIC.SURFNET.NL > Dear Robert, > > Thanks for your advices, now it is working well! > But I tried to apply beamforming methods in two different computers with > SPM2 (and the template T1.mnc). I one it woks and in the other there > is a > error message: > > performing the segmentation on the specified volume > ??? Cant map image file. > > Error in ==> spm_smoothto8bit>smoothto8bit at 51 > img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0); > > Error in ==> spm_smoothto8bit at 14 > VO = smoothto8bit(V,fwhm); > > Error in ==> spm_segment>get_affine_mapping at 233 > VFS = spm_smoothto8bit(VF(1),aflags.smosrc); > > Error in ==> spm_segment>init_sp at 567 > MM = get_affine_mapping(VF,PG,flags.affreg); > > Error in ==> spm_segment at 91 > SP = init_sp(flags.estimate,VF,PG); > > Error in ==> volumesegment at 246 > spm_segment(Va,cfg.template,flags); > > Error in ==> temp at 7 > [segmentedmri] = volumesegment(cfg, mri); > > The only difference between the two computers is the Matlab version. > In one, > the working one, is version 7 R14 SP1; in the other (the error > message), is > version 7 R14 SP3. > Do you know if the newest version of matlab is incompatible with SPM2 > and > FieldTrip. > Thanks > Andres > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 10:14:52 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 10:14:52 +0200 Subject: one-sided clusteranalysis Message-ID: i'm testing acivation versus baseline of distinct time-frequency windows consisting of power-increase or decrease using clusterrandanalysis with cfg.onetwo = 'onesided_act Message-ID: Dear Claudia, > i'm testing acivation versus baseline of distinct time-frequency windows > consisting of power-increase or decrease using clusterrandanalysis with > cfg.onetwo = 'onesided_act to obtain only positive clusters by this analysis but most often it > results in positive and negative clusters. is this right? an why do > negative clusters reach significance in a one-sided test? Could you send me the code and the data that you use for this analysis? Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > thanks > claudia > > > -- > Pflichtangaben gemäß Gesetz über elektronische Handelsregister und > Genossenschaftsregister sowie das Unternehmensregister (EHUG): > > Universitätsklinikum Hamburg-Eppendorf > Körperschaft des öffentlichen Rechts > Gerichtsstand: Hamburg > > Vorstandsmitglieder: > Prof. Dr. Jörg F. Debatin (Vorsitzender) > Dr. Alexander Kirstein > Ricarda Klein > Prof. Dr. Dr. Uwe Koch-Gromus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.nohn at UKE.DE Thu Aug 2 12:35:21 2007 From: c.nohn at UKE.DE (Claudia Nohn) Date: Thu, 2 Aug 2007 12:35:21 +0200 Subject: one-sided clusteranalysis Message-ID: hi eric, this is the code for a decrease in power, data are too large to be attached. cfg = []; cfg.channel = {'all', '-e32', '-e103', '-e120'}; cfg.latency = 'all'; cfg.frequency = 'all'; cfg.statistic = 'actvsblT'; cfg.alphathresh = 0.05; cfg.clusterteststat = 'maxsum'; cfg.minnbchan = 2; cfg.onetwo = 'onesided_bl Dear Claudia, > > > >> i'm testing acivation versus baseline of distinct time-frequency windows >> consisting of power-increase or decrease using clusterrandanalysis with >> cfg.onetwo = 'onesided_act> to obtain only positive clusters by this analysis but most often it >> results in positive and negative clusters. is this right? an why do >> negative clusters reach significance in a one-sided test? >> > > Could you send me the code and the data that you use for this analysis? > > > Eric Maris > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience :www.ru.nl/master/cns/ > > > > > > >> thanks >> claudia >> >> >> -- >> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >> Genossenschaftsregister sowie das Unternehmensregister (EHUG): >> >> Universitätsklinikum Hamburg-Eppendorf >> Körperschaft des öffentlichen Rechts >> Gerichtsstand: Hamburg >> >> Vorstandsmitglieder: >> Prof. Dr. Jörg F. Debatin (Vorsitzender) >> Dr. Alexander Kirstein >> Ricarda Klein >> Prof. Dr. Dr. Uwe Koch-Gromus >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ The original MIME headers for this attachment are: Content-Type: application/octet-stream; name="grandavg_hi_un_h4_ind.mat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="grandavg_hi_un_h4_ind.mat" -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Dr. Uwe Koch-Gromus From tillmann at MPIH-FRANKFURT.MPG.DE Mon Aug 6 16:42:04 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Mon, 6 Aug 2007 16:42:04 +0200 Subject: Trial definition and artifact rejection Message-ID: Dear all, I have a question concerning data preprocessing; does anybody know how to specify different time windows for 1) the definition of correct trials and 2) artifact rejection? So far, I have used a function that looks for correct data segments defined by a stimulus trigger and the button press following within a 1sec window after the trigger. These segments are then further analysed with artifact rejection. Since I lose a lot of trials with this procedure because reaction times seem to be a little longer, I wanna use a longer time window, e.g. 2 sec., for defining correct trials, and then shorten the segments again so that the artifact rejection and all further analysis steps are only performed with 1sec. long windows.... I would be glad if anyone had an idea how to solve this problem! Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:40:19 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:40:19 +0200 Subject: Trial definition and artifact rejection In-Reply-To: <07080616420492_2800013E@mpih-frankfurt.mpg.de> Message-ID: Dear Cristine On 6 Aug 2007, at 16:42, Christine Tillmann wrote: > I have a question concerning data preprocessing; > does anybody know how to specify different time windows > for 1) the definition of correct trials and 2) artifact rejection? I presume that you are referring to the automatic artifact detection (ARTFACT_XXX) and the REJECTARTIFACT function. > So far, I have used a function that looks for correct data segments > defined by a stimulus trigger and the button press following within a > 1sec window after the trigger. These segments are then further > analysed > with artifact rejection. Since I lose a lot of trials with this > procedure because reaction times seem to be a little longer, I > wanna use > a longer time window, e.g. 2 sec., for defining correct trials, and > then > shorten the segments again so that the artifact rejection and all > further analysis steps are only performed with 1sec. long windows.... > > I would be glad if anyone had an idea how to solve this problem! By default the artifact_xxx functions scan the segments that you have marked in cfg.trl (i.e. using definetrial and your custom trial function) plus some additional padding. See figure 1 on http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:artifactdetect This also means that you can specify a different cfg.trl for the artifact_xxx detection functions than in rejectartifact. E.g. you can do cfg = [] cfg = ... cfg1 = definetrial(cfg) % condition 1 cfg2 = definetrial(cfg) % condition 2 cfg.trl = [cfg1.trl; cfg2.trl];; cfg = artifact_eog(cfg); % scan all trials for artifacts simultaneously cfg.trl = cfg1.trl % condition 1 cfg1_clean = rejectartifact(cfg); cfg.trl = cfg2.trl % condition 2 cfg2_clean = rejectartifact(cfg); data1 = preprocessing(cfg1_clean) data2 = preprocessing(cfg2_clean) The padded data is read into memory, bandpass filterend and hilbert transformed to estimate the instntaneous amplitude of the signal in that specific frequency band. The filtering and hilbert transformation often results in edge artifacts, hence the filter padding is required. The filter padding is removed from each segment before further processing and thersholding of the data. That you loose a lot of trials may be related to not specifying enough filter padding. Shortening the trials then will not help. If you specify cfg.artfctdef.xxx.feedback=yes, then you can look in detail at the reason why trials are rejected. Note that the output of artifact_xxx is an updated cfg.artfctdef.xxx structure. You can look in cfg.artfctdef.xxx.artifact (and e.g. preprocess those segments) to see where the artifacts were. That is a Nx2 matrix similar to "trl" (see definetrial) but without the offset in the last column (which should be added, e.g. with zeros, if you wish to use it to read in he data with preprocessing). If the automatic artifact rejection is too difficult to get to work on your data (it was designed for continuous CTF data and is not guaranteed to work on other data), then I suggest that you use REJECTVISUAL instead. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 6 17:47:50 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 6 Aug 2007 17:47:50 +0200 Subject: problems using dics In-Reply-To: Message-ID: On 30 Jul 2007, at 15:08, Nathan Weisz wrote: > the problem here is that the noise is set to 0. while executing the > code this warning message appears: > Warning: cross-spectral density matrix is rank deficient > > In beamformer_dics at 161 > In sourceanalysis at 855 > > a look at the code shows that in this case that the noise is set to > lambda (empty and set to 0 per default). I then tried different > lamdas but as results varied quite a lot I have an uneasy feeling > doing it this way. > > question: is there something apparently wrong with the configs that > leads to the problem of not being able to make a noise estimate > from the CSD? Hi Nathan The noise floor is estimated by the smallest singular value of the CSD/COV matrix. Since yours is rank deficient, it seems as if the noise level is zero. The estimated projected noise scales linearly with the estimated noise in the CSD, and since nai=pow/noise, it will be Inf if noise=0. Once you start tweaking lambda, you are both influencing the spatial filters (regularization) and the estimate of the noise floor (in case of a rank deficient CSD matrix). Since your data probably is sufficiently cleaned by ICA, the regularisation is probably not required. Than means that if you specify a very small lambda, the regularisation will not yet be noticeable. The noise projection however will already be linearly scaled with the lambda (now the assumed noise floor) and nai can be computed. Note that nai is proportional to 1/lambda. So just specify a lambda that is very small (compared to the svd spectrum of the CSD) and please check that the nai scales linearly with it without the spatial distribution of the nai changing. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jaredvs at GMAIL.COM Mon Aug 6 21:59:31 2007 From: jaredvs at GMAIL.COM (Jared Van Snellenberg) Date: Mon, 6 Aug 2007 15:59:31 -0400 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: Message-ID: Hi Robert, I'm using the BEM head model you supplied, and have a quick question about it. From plotting the results of this approach, the grid appears to only extend as low as the level of the anterior commisure. Is this intended? If so, I presume it's because of the difficulty in localizing deep sources? Thanks in advance. -Jared On 7/7/07, Robert Oostenveld wrote: > > On 7 Jul 2007, at 5:12, Jared Van Snellenberg wrote: > > > Quick question about the BEM model you supplied--is it correct to > > just pass in the vol structure contained in the standard_vol.mat > > along with an elec structure containing the nx3 array of electrode > > coordinates in MNI space? That is, is the following correct: > > > > load standard_vol.mat > > cfg.vol=vol; > > cfg.elec=elec; %predefined; 59 electrode coordinates in MNI > > results=sourceanalysis(cfg,data); > > Yes, but only if the electrode labels in your data match with the > complete set or a subset of the labels in elec (it is case > sensitive). The intersection of data.label and elec.label will be > used for sourecanalysis. However, for EEG source analysis your data > should be average referenced. And that is something that you do > during preprocessing (or optionally timelockanalysis). That means > that all channels in your data for which there is a corresponding > electrode position in the elec structure should be average referenced. > > Prior to sourceanalysis, you can use the headmodelplot function (or > electroderealign with method=interactive) to check that the > electrodes ly on the skin compartment of the MNI head model. > > regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- Jared Van Snellenberg Social Cognitive Affective Neuroscience Unit http://scan.psych.columbia.edu (212) 854-7858 p (212) 854-3609 f Department of Psychology, Columbia University 406 Schermerhorn Hall 1190 Amsterdam Avenue, Mail Code 5501 New York, NY 10027 _______________________________ "Luck is the residue of design" -Attributed to Branch Rickey, former US Baseball Administrator, and also to John Milton. Go figure. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Mon Aug 6 22:38:31 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 6 Aug 2007 16:38:31 -0400 Subject: plotting clusters Message-ID: Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue Aug 7 09:33:26 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Aug 2007 09:33:26 +0200 Subject: Volume conduction model for EEG DICS beamforming In-Reply-To: <51d499680708061259x243aa152l12665451085738ee@mail.gmail.com> Message-ID: On 6 Aug 2007, at 21:59, Jared Van Snellenberg wrote: > I'm using the BEM head model you supplied, and have a quick > question about it. From plotting the results of this approach, the > grid appears to only extend as low as the level of the anterior > commisure. Is this intended? If so, I presume it's because of the > difficulty in localizing deep sources? Thanks in advance. Hi Jared, There is no reason not to let the grid extend all the way down to the bottom of the cerebellum. At the lower locations it will be less sensitive and more blurred, but that should not stop you from looking there. If you use cfg.grid.xgrid='auto' etc. for sourceanalysis/ prepare_leadfield, then the grid is determined from a box that tightly fits the electrodes. Probably that is why you don't see low grid locations, because you do not have sufficiently low electrodes. Just do cfg.grid.xgrid = -100:10:100 % in milimeter, since MNI coordinates cfg.grid.ygrid = -140:10:120 cfg.grid.zgrid = -70:10:120 cfg.tightgrid = 'yes' and you probably should get a complete coverage (you may want to play with the numbers to get it right). The tightgrid option makes the bounding box of the grid as tight as possible around the brain compartment after making the grid and after checking which locations are in the brain. That helps in reducing the number of irrelevant/ outside-brain grid locations. So starting with a grid from -300:10:300 in each direction would also be fine, since tightgrid=yes ensures that the bounding box will be as tight as can be. It will just be slower if you start with a grid that is too wide around the brain. Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 7 10:55:25 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 7 Aug 2007 10:55:25 +0200 Subject: plotting clusters In-Reply-To: Message-ID: Hi Sameer, If I understand correctly you want to not plot data but just the sensors that are significant in one color and the rest in another. If you look in the help of the function topoplot.m (this function is called both by topoplotER and topoplotTFR) you can see many extra options, including highlighting options. If you want the sensors themselves to be colored and no data underneath you could use a cfg like this: Cfg.style = 'blank'; Cfg.highlight = electrode numbers you want to highlight Cfg.hlcolor = color you want for the highlight Cfg.ecolor = color you want for the other electrodes If you call topoplotER or topopltTFR the cfg is passed on to topoplot.m, but you could also call topoplot.m directly. But if you do that look in the help of topoplot.m how it wants it's data. You do have to give in some structure as data even if the style is blank, but since it isn't plotted it doesn't matter what is in it. On the FieldTrip page there is also a tutorial on plotting containing more information: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tu torial:plotting Hope this is what you meant. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, August 06, 2007 10:39 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] plotting clusters Hello, After doing clusterandanalysis, I want to plot the significant clusters (say the most significant) in a binary fashion: such that that all sensors in the significant clusters get a single colour highlighting (say red) and the rest a different (say blue). The current method I am using gives me plots which colour code the values of significant clusters and also some contours over sensors which should just be shut out by the masking. I am using plotdata=[]; mask=squeeze((clusrand.posclusterslabelmat==1) ); plotdata.maskedraweffect= mask; %clusrand.raweffect.*mask; maxabs=max(abs(plotdata.maskedraweffect(:))); plotdata.labelcmb =clusrand.labelcmb; plotdata.dimord='chan_freq'; plotdata.freq = clusrand.freq plotdata.label = clusrand.labelcmb(:,2); figure cfg=[]; cfg.xparam = 'freq'; cfg.zparam='maskedraweffect'; cfg.xlim = [min(clusrand.freq) max(clusrand.freq)]; cfg.layout = 'NM306planar.lay'; fg.colorbar='no'; clf; topoplotER(cfg,plotdata); Any suggestions about what I should be using? Thanks in advance for your time. best, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marie at PSY.GLA.AC.UK Wed Aug 15 15:58:32 2007 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Wed, 15 Aug 2007 14:58:32 +0100 Subject: Converting from fieldtrip output to anatomical regions Message-ID: I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Wed Aug 15 20:43:58 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 15 Aug 2007 14:43:58 -0400 Subject: cfg.width in freqanalysis_wltconvol Message-ID: Hello, For freqanalysis_wltconvol, cfg.toi dictates the times on which the analysis windows should be centered. How do I use cfg.width and cfg.gwidth such that I can define the width of the window in terms of seconds (or msecs) I want? It will have to be constant across all frequencies. Also, if I calculate for width w, will freqanalysis_wltconvol use [t-w/2 t+w/2] or [t-w t+w]? thanks, sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From maris at NICI.RU.NL Thu Aug 16 10:44:20 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 10:44:20 +0200 Subject: Statistical testing of coherence differences Message-ID: Dear Fieldtrip Discussion List Readers, I have received several emails froms FT-users who want to statistically test coherence differences in single subjects. This methodology was described in a recent paper in the Journal of Neuroscience Methods (Maris, Schoffelen, and Fries, 2007). To perform the same analysis on your own data using FT, you should take the following into account: 1. You must use the FT-function clusterrandanalysis. This is the oldest statistics function in FT, and was written for the most part by Eric Maris. Robert Oostenveld has recently set up a completely new statistics framework. However, this framework does not yet contain functionality to do statistical testing of coherence differences. This is in the pipeline, but at this moment you still have to use the old clusterrandanalysis. 2. You can test coherence differences for (1) all channel pairs or (2) for all channel pairs that have a common reference channel. Only the latter analysis was described in JNM paper and is also the one that was most extensively tested. I strongly advice you to stick to the reference channel analysis. Most likely, you will get memory problem with the other option. >>From now on, I assume that you will be doing a reference channel analysis. 3. The input data for clusterrandanalysis is the output of two freqanalysis runs, one every experimental condition. 4. cfg.statistic must be 'indepsamplesZcoh'. 5. cfg.channelcmb must contain a Mx2 cell array of pairs of channel labels that all contain the reference channel. 6. cfg.chancmbgeom must be 'refchan'. Good luck, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Thu Aug 16 11:11:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 16 Aug 2007 11:11:10 +0200 Subject: clusterrandanalysis questions Message-ID: Dear Sameer, > 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >From my understanding, it seems that one sided tests only look for > positive clusters i.e. the test statistic higher than cfg.alphathresh. > Thus clusters showing up as posclusters for coherence difference in one > case should not show up at all in the other. Yet, both the tests seem to > give me same clusters. If this is the case, then there is an error in the code. Can you send me your config and screen output of clusterrandanalysis? > > 2) using cfg.onetwo = twosided I should get clusters which in some > way are union of the two sets above. Yet, I seem to get completely > different clusters, sometimes with nothing in common between twosided and > onsesided tests. The clusters with the twosided-option should NOT be the union of the clusters with the two onesided options. This is because the thresholding values with the twosided-option are at cfg.alphathresh/2 and (1-cfg.alphathresh/2), whereas for the two onesided options they should be at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > 3) Most clusters I find seem to have a high p-value. Would the > confidence increase if I use a different alphathresh which I think is used > for thresholding the Z-statistic for defining clusters. (I just realized > that I neglected to define cfg.alphathresh and though I could not find a > default value used in clusterandanalysis, the program is obviously using > some). On the basis of my experience, I do not expect a substantial influence of the cfg.alphathresh value on the p-values. > 4) What is the motivation behind cfg.minnbchan ? Should it be based > upon the neurobiological effect I am investigating? The motivation behind cfg.minnbchan is that some samples (i.e., channel-frequency-pairs or channel-frequency-time-triplets) with a big sample-specific statistic may have a few neighbouring samples with also a big sample-specific statistic, just by chance. To "prune out" these chance connections, set cfg.minnbchan high (e.g., 3). Kind regards, Eric Maris dr. Eric Maris NICI/Biological Psychology and F.C. Donders Center for Cognitive NeuroImaging University of Nijmegen P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 (NICI) T:+31 24 3610754 (FCDC) F:+31 24 3616066 (NICI) E: maris at nici.ru.nl MSc Cognitive Neuroscience : www.ru.nl/master/cns/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Fri Aug 17 20:25:30 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 17 Aug 2007 14:25:30 -0400 Subject: clusterrandanalysis questions In-Reply-To: <00ca01c7dfe5$631ae400$b0ccae83@fcdonders.nl> Message-ID: Thanks Eric for your email, Given below is the info you have asked. best, sameer cfg = []; cfg.channelcmb = ['MEG1833' 'MEG']; cfg.statistic = 'indepsamplesZcoh' ; cfg.alphathres = 0.05 ; cfg.alpha = 0.05 ; cfg.clusterteststat = 'maxsum' ; cfg.onetwo = 'onesided_1<2' ; cfg.makeclusters = 'yes' ; cfg.minnbchan = 2; cfg.nranddraws = 500; [clusrand] = clusterrandanalysis(cfg, CSD1 , CSD2); screen O/P Selecting and formatting the data. selected 511 channelcombinations selected 1 time bins selected 13 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the gradiometer configuration from the first dataset. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 500 . . . randomization 499 500 randomization 500 500 clusrand = stats: [205x13 double] raweffect: [205x13 double] obsmeanc1: [205x13 double] obsmeanc2: [205x13 double] posclusters: [1x7 struct] negclusters: [] posclusterslabelmat: [205x13 double] negclusterslabelmat: [] critvals: 204.1906 labelcmb: {205x2 cell} freq: [6 8 10 12 14 16 18 20 22 24 26 28 30] time: NaN cfg: [1x1 struct] On Thu, 16 Aug 2007, Eric Maris wrote: > Dear Sameer, > > > > > >> 1) cfg.onetwo = 'onesided_2<1' vs cfg.onetwo = 'onesided_1<2 > >>> From my understanding, it seems that one sided tests only look for > >> positive clusters i.e. the test statistic higher than cfg.alphathresh. > >> Thus clusters showing up as posclusters for coherence difference in one > >> case should not show up at all in the other. Yet, both the tests seem to > >> give me same clusters. > > > > If this is the case, then there is an error in the code. Can you send me > your config and screen output of clusterrandanalysis? > > > >> > >> 2) using cfg.onetwo = twosided I should get clusters which in some > >> way are union of the two sets above. Yet, I seem to get completely > >> different clusters, sometimes with nothing in common between twosided and > >> onsesided tests. > > > > The clusters with the twosided-option should NOT be the union of the > clusters with the two onesided options. This is because the thresholding > values with the twosided-option are at cfg.alphathresh/2 and > (1-cfg.alphathresh/2), whereas for the two onesided options they should be > at, respectively, cfg.alphathresh and (1-cfg.alphathresh). > > > > > >> 3) Most clusters I find seem to have a high p-value. Would the > >> confidence increase if I use a different alphathresh which I think is used > >> for thresholding the Z-statistic for defining clusters. (I just realized > >> that I neglected to define cfg.alphathresh and though I could not find a > >> default value used in clusterandanalysis, the program is obviously using > >> some). > > > > On the basis of my experience, I do not expect a substantial influence of > the cfg.alphathresh value on the p-values. > > > >> 4) What is the motivation behind cfg.minnbchan ? Should it be based > >> upon the neurobiological effect I am investigating? > > > > The motivation behind cfg.minnbchan is that some samples (i.e., > channel-frequency-pairs or channel-frequency-time-triplets) with a big > sample-specific statistic may have a few neighbouring samples with also a > big sample-specific statistic, just by chance. To "prune out" these chance > connections, set cfg.minnbchan high (e.g., 3). > > > > > > Kind regards, > > > > Eric Maris > > > > > > > > > > dr. Eric Maris > > NICI/Biological Psychology and > > F.C. Donders Center for Cognitive NeuroImaging > > University of Nijmegen > > P.O. Box 9104 > > 6500 HE Nijmegen > > The Netherlands > > T:+31 24 3612651 (NICI) > > T:+31 24 3610754 (FCDC) > > F:+31 24 3616066 (NICI) > > E: maris at nici.ru.nl > > MSc Cognitive Neuroscience : > www.ru.nl/master/cns/ > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From weisz at LYON.INSERM.FR Tue Aug 21 09:36:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Tue, 21 Aug 2007 09:36:11 +0200 Subject: EEG & lcmv Message-ID: Hi, I am struggling with the sourceanalysis of EEG data which was recorded with Biosemi 128 electrodes. the data are visual evoked potentials. the topographies look very good and dipolar. below some code attached. one thing i find suspicious is that the 'avg.pow' field after sourceanalysis contains some negative values ... i reckon this shouldn't be the case. the call to sourceanalysis is very close to calls i did with MEG data yielding good localizations. the greatest potential error source i see is that i use electrode positions from the standard_1005 file in order to use the standard BEM model. this is done by choosing the index from the standard-1005 closest to the biosemi elecrode locations (placed on a sphere). for this i use matlabs dsearchn function. mistakes at this step would seriously screw up the forward model. however checking the electrode locations on the standard MRI using sourceplot looks sensible however ... so at this stage i am not sure whether it's a headmodelproblem or something else i am missing / overlooked. as always, any help is greatly appreciated. cheers, n %first search for electrodes closest in the standard 1005 elec4grid=data.elec; elec4grid.pnt=[-data.elec.pnt(:,2),data.elec.pnt(:,1),data.elec.pnt(:, 3)]*85; stelec=read_fcdc_elec('standard_1005.elc'); ind=zeros(1,128); for i=1:128 ind(i)=dsearchn(stelec.pnt,elec4grid.pnt(i,:)); stelec.pnt(ind(i),:)=NaN; %avoids double choosing of electrodes end stelec=read_fcdc_elec('standard_1005.elc'); elec4grid.pnt=stelec.pnt(ind,:); cfg=[]; cfg.grid=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.grid.resolution=10; cfg.vol=vol; %this is the standard BEM from Fieldtrip / eeglab cfg.elec=elec4grid; grid=prepare_leadfield(cfg); cfg=[]; cfg.covariance='yes'; cfg.preproc.reref='yes';%it should be average reference already. just to be sure. cfg.preproc.refchannel='all'; cfg.latency=[-.3 -.1]; cfg.covariancewindow = [-.3 .1]; baseERP=timelockanalysis(cfg,data); cfg.latency=[0.1 .3]; cfg.covariancewindow = [.1 .3]; visuERP=timelockanalysis(cfg,data); cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=elec4grid; cfg.grid=grid; baseS=sourceanalysis(cfg,baseERP); visuS=sourceanalysis(cfg,visuERP); visuSn=visuS; motorSn=motorS; visuSn.avg.pow=visuS.avg.pow./baseS.avg.noise; motorSn.avg.pow=motorS.avg.pow./baseS.avg.pow; %%%COMMENT 17: %%%The solutions then have to be interpolated on the standard MRI. cfg = []; cfg.downsample = 2; cfg.sourceunits='mm'; visuS_int = sourceinterpolate(cfg, visuSn, mri); motorS_int = sourceinterpolate(cfg, motorSn, mri); -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: weisz at lyon.inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 16:50:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 16:50:02 +0200 Subject: multitapers and high gamma band activity Message-ID: Hi all, I'm doing time-frequency analysis based on multitapers. Do you have any suggestions how many tapers should optimally be used when analysing activity in the higher gamma band (30-150Hz)and how I would implement this in the freqanalysis function? Currently I'm using the following parameters: cfg.t_ftimwin = 5./cfg.foi and cfg.tapsmofrq = 0.4*cfg.foi Thanks in advance, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tillmann at MPIH-FRANKFURT.MPG.DE Tue Aug 21 17:03:02 2007 From: tillmann at MPIH-FRANKFURT.MPG.DE (Christine Tillmann) Date: Tue, 21 Aug 2007 17:03:02 +0200 Subject: baselinetype zscore? Message-ID: Hi everyone, I got another question concerning time-frequency analysis: I wanna compute the relative change in power from baseline based on z scores. I saw that there is this option 'baselinetype' = 'zscore' in the freqbaseline function, but the TFzscore subfunction is currently uncommented. Is it possible to use this option? Best regards, Christine ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Pascal.Fries at FCDONDERS.RU.NL Tue Aug 21 22:16:39 2007 From: Pascal.Fries at FCDONDERS.RU.NL (Pascal Fries) Date: Tue, 21 Aug 2007 22:16:39 +0200 Subject: multitapers and high gamma band activity In-Reply-To: <07082116500234_2800013E@mpih-frankfurt.mpg.de> Message-ID: Hi Christine, The parameters that you specified are OK and can be used. In general, you should make sure that the cfg.foi contains integer multiples of the Rayleigh frequency (1/cfg.t_ftimwin) and the spectral concentration should also be small integer multiples of the Rayleigh frequencies, e.g. between 3 and 11. Cfg.tapsmofrq specifies half the spectral concentration and thus, your configuration gives a spectral concentration of 4 times the Rayleigh frequency - approximately, because two tapers (with poor concentration properties) are dismissed. Thus: You're configuration is fully OK. But: I generally discourage to use window lengths and spectral concentrations that change as a function of frequency. Such an approach is often inspired by Wavelet analyses. But it precludes any intepretation of a spectral pattern, because the analysis at different frequencies is based on different data segments and different degrees of freedom. This is what we typically use for the gamma frequencies: T_ftimwin of 0.25 s -> Rayleigh frequency of 4 Hz Spectral concentration (tapsmofrq) of plus/minus 12 Hz (up to 20 Hz). All the best, Pascal Pascal Fries Principal Investigator F.C. Donders Centre for Cognitive Neuroimaging Kapittelweg 29, 6525 EN Nijmegen, Netherlands E-mail: pascal.fries at fcdonders.ru.nl Website: www.ru.nl/fcdonders/ Phone: (+31) (0)24 36 10657 Fax: (+31) (0)24 36 10989 > -----Original Message----- > From: FieldTrip discussion list > [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christine Tillmann > Sent: Tuesday, August 21, 2007 4:50 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] multitapers and high gamma band activity > > Hi all, > > I'm doing time-frequency analysis based on multitapers. Do > you have any suggestions how many tapers should optimally be > used when analysing activity in the higher gamma band > (30-150Hz)and how I would implement this in the freqanalysis function? > > Currently I'm using the following parameters: > cfg.t_ftimwin = 5./cfg.foi and > cfg.tapsmofrq = 0.4*cfg.foi > > Thanks in advance, > Christine > > ---------------------------------- > The aim of this list is to facilitate the discussion between > users of the FieldTrip toolbox, to share experiences and to > discuss new ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Thu Aug 23 19:10:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 23 Aug 2007 19:10:32 +0200 Subject: artifact threshold and TFR trial length Message-ID: Hi, In the artifact_threshold hold function it says one should specify the thresholds or range in uV/T, is this �V/T? And what are useful values for this function for MEG data? I have been trying different values but could use some guidance. Also, I have a dataset from a CTF 275 channel machine using epoched recording (ie non- continuous) and it was recorded with only a 100 ms prestimulus baseline and a 900 ms post-stim length. I would like to do time-frequency and beamforming analysis but am having trouble. So far for example I have used this code to look at the alpha frequency, but would like to look at all frequencies: load PreprocData cfg = []; cfg.toilim = [0 0.5]; %t to avoid NaNs in the ouput datacond1 = redefinetrial(cfg,dataSP); cfg = []; cfg.method='mtmfft'; cfg.output='powandcsd'; cfg.tapsmofrq=4; cfg.foilim =[10 12]; freqcond1 = freqanalysis(cfg,datacond1); Do you have any suggestions for this situation? Is the trial length simply too short for using the TFR functions? Thank you! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Fri Aug 24 18:41:10 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 24 Aug 2007 18:41:10 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters Message-ID: Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 10:49:17 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 10:49:17 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, You can find the option cfg.highlight in the function topoplot.m, this function is called by topoplotER (also by topoplotTFR by the way). It should contain the channel numbers which you want to highlight. Why your plot doesn't give any highlighted sensors is hard to say without knowing your data (what did you give in to timelockstatistics with which cfg). - It could be that the time you plot (0:0.05:0.5) does not contain the clusters - It could be the specification of m [1:15:301], this is exactly copied from the tutorial, but it is based on the sample frequency of the data used there. In the tutorial a second of data is used, cut up in 21 pieces from 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 pieces 1:15:301. You should adjust m to you own time settings and sample frequency. - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of this? For the highlighting to work it should contain the sensor numbers to be highlighted. If your m is not specified correctly I would guess that pos_int and neg_int are not specified correctly and cfg.highlight turnes up empty and therefore no highlights are plotted. Hope this give you some ideas to find out what's wrong. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Friday, August 24, 2007 6:41 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi, I have run a cluster analysis comparing two conditions on channel data and have 1 pos significant cluster and 1 negative significant cluster. When I run the following code from the tutorial to plot: UNvsID=grandavgUN; UNvsID.avg=UNvsID.avg-grandavgID.avg; pos=stat.posclusterslabelmat==1; neg=(stat.negclusterslabelmat==1)*(-1); j = [0:0.05:0.5]; m = [1:15:301]; for k=1:10; subplot(4,5,k); cfg=[]; cfg.xlim=[j(k) j(k+1)]; pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; cfg.highlight=find(pos_int==1|neg_int==-1); cfg.comment = 'xlim'; cfg.commentpos = 'title'; cfg.layout = 'CTF275.lay'; topoplotER(cfg,UNvsID) end the raw effect is plotting but the samples belonging to the significant clusters are not highlighted, as on the tutorial page. So I can't tell when and where the effect is. When looking at the topoplot function cfg.highlight does not appear to be an option anywhere. Do I need a newer version of Fieldtrip? The one I am using now is from 2007/08/01. Thanks for any help! andy ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Aug 28 16:14:38 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 28 Aug 2007 16:14:38 +0200 Subject: Converting from fieldtrip output to anatomical regions In-Reply-To: Message-ID: Dear Marie, Currently this is not build in the sourceplot function yet. What you could do is use a template from SPM and use volumenormalize to transform it to that template. I know there is a MNI template in SPM2 (T1.mnc), but I don't know about Talairach though. If you then use sourceplot with cfg.interactive = 'yes' and you click on a place in the brain, it spits out a location, which I think is then in MNI space, but you should confirm this with an atlas because I'm not sure. I'm sorry I can't help you anymore, maybe someone with more fMRI experience can add to this. What I usually do is just look up the location in an atlas, the spatial resolution is so poor that you should not report things on a mm precision anyway. Hope this helps a little bit. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marie Smith Sent: Wednesday, August 15, 2007 3:59 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Converting from fieldtrip output to anatomical regions I would like to take the output of the fieldtrip sourceanalysis + sourceinterpolate functions and identify the anatomical regions that correspond to highest activation locations. I was wondering if anyone could tell me how to go about transforming from the results space to Talairach space, or an alternative that would allow me to do this easily. I have anatomical mri's for my subjects in ctf .mri format. I noted there are some undocumented options related to this in the sourceplot function and wondered if they could help? Thanks, Marie Smith CCNI Dept. of Psychology University of Glasgow Scotland, UK. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 17:41:05 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 11:41:05 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, Thank you for the answer. The output of cfg.highlight = find(pos_int==1|neg_int==-1) is in fact empty as you say, so this might depend on giving the wrong sampling frequency in m? The data I have is sampled at 600. So should m be then something like m= [1:30:600] if my time window of interst is 0-500 ms? I did find topoplot eventually and tried the different settings but I think the problem is as you suggest with the inputs to the plot. I use the within-subjects input to the statistics function given in the tutorial as: cfg = []; cfg.channel = {'MEG'}; cfg.latency = [0.0 0.5]; % so the effect shouldn't be outside this % time interval, correct? cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; cfg.layout = 'CTF275.lay'; subj = 16; design=zeros(2,2*subj); for i = 1:subj design(1,i) = i; end for i = 1:subj design(1,subj+i) = i; end design(2,1:subj) = 1; design(2,subj+1:2*subj) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = timelockstatistics(cfg, grandavgID, grandavgUN); Thank you for your help! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From andrew.smart at NYU.EDU Wed Aug 29 20:02:14 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 29 Aug 2007 14:02:14 -0400 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: <014101c7e950$51797bc0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Aug 30 15:28:59 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Aug 2007 15:28:59 +0200 Subject: problem w/ cfg.highlight using topoplot to show samples in sig clusters In-Reply-To: Message-ID: Hi Andrew, - where does this size come from if my sample rate is 600?: The size 267x301 means 267 channels x 301 samples. You have 301 samples because your latency in timelockanalysis was cfg.latency = [0.0 0.5]; so that's 301 samples with sample rate 600 Plotting the output from the randomization can be quite tricky, because you have 301 moments in time where you can have a cluster. In the tutorial a trick was used. There they also had 301 time points, but a sample rate of 300 -> spanning one second. If you exactly want to know where the clusters are you would have to plot all the 301 time points. Because that doesn't make sense they average over 50 millisecond time windows. If for instance k=10 -> pos_int = mean(pos(:,m(k):m(k+1))')' -> an average is made over samples 136-151 time is 0.45-0.5s giving the 10th plot in the figure. Only those sensors that are part of the cluster for this whole time window (all 15 time points) give out a mean of 1 or -1 and are plotted. In the tutorial data the cluster was present over a long time window in many sensors, therefore there were many sensors with 1 or -1. For your data this doesn't work, but you do have significant clusters. "I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270)" For instance this means that the positive clusters are in channel 59:168 at time points 149:172, with a sample rate of 600 this means from 0.248 to 0.287 seconds. You should adjust the loop in such a way that you put the settings that they fit your data. So for instance make the time resolution higher (by adjusting j and m) since you have clusters that are short lived in time, and to have not to many plots, plot around the time where you know your clusters are. Hope this solves your stuck-ness, Good luck again. Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Wednesday, August 29, 2007 8:02 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters Hi Ingrid again, Inspecting the variables more I find that the output of the timelockstatistics on my data gives: 28 pos clusters and 36 neg clusters (1 significant pos cluster and 1 sig neg cluster) and posclusterslabelmat and negclusterslabelmet as 267x301 (where does this size come from if my sample rate is 600?) then using pos = stat.posclusterslabelmat==1; neg = (stat.negclusterslabelmat==1)*(-1); pos and neg are obviously 267x301, and I can find the elements of pos and neg that = 1 and = -1 respectively. elements =1 are spread out between roughly pos(59:168,149:172) and =-1 between neg(152:240,242:270). however, using pos_int = mean(pos(:,m(k):m(k+1))')'; neg_int = mean(neg(:,m(k):m(k+1))')'; in the for loop, gives pos_int as 267x1 but all the elements are zeros. and in neg_int some elements are values like -0.1667 for example. so for the highlight to work do the values in pos_int and neg_int have to be either 1 or -1? i have tried various parameters in m and but nothing i have tried seems to work. i am stuck! thanks! andy ----- Original Message ----- From: Ingrid Nieuwenhuis Date: Wednesday, August 29, 2007 5:12 am Subject: Re: [FIELDTRIP] problem w/ cfg.highlight using topoplot to show samples in sig clusters To: FIELDTRIP at NIC.SURFNET.NL > Hi Andrew, > > You can find the option cfg.highlight in the function topoplot.m, this > function is called by topoplotER (also by topoplotTFR by the way). It > should > contain the channel numbers which you want to highlight. > > Why your plot doesn't give any highlighted sensors is hard to say without > knowing your data (what did you give in to timelockstatistics with which > cfg). > - It could be that the time you plot (0:0.05:0.5) does not contain the > clusters > - It could be the specification of m [1:15:301], this is exactly > copied from > the tutorial, but it is based on the sample frequency of the data used > there. In the tutorial a second of data is used, cut up in 21 pieces from > 0:0.05:1 and that data has a sample frequency of 301 also cut up in 21 > pieces 1:15:301. You should adjust m to you own time settings and sample > frequency. > - cfg.highlight = find(pos_int==1|neg_int==-1), what is the outcome of > this? > For the highlighting to work it should contain the sensor numbers to be > highlighted. If your m is not specified correctly I would guess that pos_int > and neg_int are not specified correctly and cfg.highlight turnes up empty > and therefore no highlights are plotted. > > Hope this give you some ideas to find out what's wrong. > > Good luck, > Ingrid > > > -----Original Message----- > From: FieldTrip discussion list [ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From sameer at ANDREW.CMU.EDU Thu Aug 30 22:53:00 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 30 Aug 2007 16:53:00 -0400 Subject: using freqanalysis_wltconvol Message-ID: Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Jan.Schoffelen at FCDONDERS.RU.NL Fri Aug 31 09:09:11 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 31 Aug 2007 09:09:11 +0200 Subject: using freqanalysis_wltconvol In-Reply-To: Message-ID: Dear Sameer, If you want to have equal window sizes for all frequencies, you should use freqanalysis_mtmconvol. Yours, JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, August 30, 2007 10:53 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] using freqanalysis_wltconvol Hi, My question is about using freqanalysis_wltconvol instead of freqanalysis_mtmfft. Currently I use mtmfft to calculate cross-spectra for segments of the data (usually 200 ms long and with some padding). >>From what I can understand from the help of freqanalysis_wltconvol, it seems to me that while cfg.toi determines times on which the analysis window is centered, while cfg.width and cfg.gwidth end up using different time windows for different frequencies. What cfg parameters will allow me to use wavelets for equal window size for all frequency? Also how can I determine what number in ms does a particular cfg.width amount to? Thanks in advance. Best, Sameer ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.