From Brian.Roach at YALE.EDU Mon Apr 2 20:06:47 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 2 Apr 2007 14:06:47 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070329124424.01cda650@email.med.yale.edu> Message-ID: After re-running the sourceanalysis and sourceinterpolate, I seem to get a better looking plot using cfg.funparameter = 'pow', but when I use cfg.funparameter = 'nai', I get this error message: >> sliceinterp(cfg, sourceInterp) ??? Error using ==> sliceinterp at 175 no functional data supplied I did not get this before, and the only thing that I have changed is the specification of the units, as listed below in the previous e-mail. Has anyone else seen this error or have ideas about a fix? thanks, Brian At 12:44 PM 3/30/2007, you wrote: >Thanks for these replies. I have now specified > >cfg.mriunits = 'mm' >cfg.sourceunits = 'mm' > >Then, I should re-run sourceinterpolate.m? That seems to produce the new >results, but the same new results whether I specify both units as 'cm' or >'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you >supposed to use? > > >thanks, >Brian >At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >>On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>>a very likely cause is the incorrect specification of cfg.mriunits, >>>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>>find back in the code you sent in your mail that you actually >>>called it, but I assume you did). If not specified, fieldtrip puts >>>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>>discrepancy in your data there. Perhaps you even explicitly have to >>>check, whether your headmodel (in hdmfile) is defined in cm. At >>>least the dipole-grid on which sourceanalysis performs the >>>beamformer-scanning is defined in cm, and I guess the units should >>>be identical here as well. >> >>The standard BEM EEG volume conduction model that you might have >>copied from EEGLAB is one that is based on the MNI template brain. It >>is in MNI coordinates (linked to the AC and PC) and the units are in >>mm (corresponding with SPM standards). >> >>Robert > From ychen at BME.UFL.EDU Mon Apr 2 22:33:25 2007 From: ychen at BME.UFL.EDU (Chen) Date: Mon, 2 Apr 2007 22:33:25 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Hello, I am trying to generate a BEM headmodel using volumesegment.m for t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following error message: - SPM2: spm_vol ------------------------------------------------- Error reading information on: ..ome/common/matlab/spm2/templates/T1.mnc Please check that it is in the correct format. ----------------------------------------- 16:11:50 - 02/04/2007 ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> BEM_headmodel at 20 seg = volumesegment(cfg, temp_mri); Thanks anybody who can help me on this issue. Chen From sameer at ANDREW.CMU.EDU Mon Apr 2 22:47:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:47:22 -0400 Subject: SPM2 related error message when doing volumesegment In-Reply-To: Message-ID: Hi Chen, unless you define cfg.template = 'full path to T1.mnc file'; spm2 will look for T1.mnc in a predesignated directory and give that error. sameer On Mon, 2 Apr 2007, Chen wrote: > Hello, > > I am trying to generate a BEM headmodel using volumesegment.m for > t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following > error message: > > - SPM2: spm_vol ------------------------------------------------- > > Error reading information on: > ..ome/common/matlab/spm2/templates/T1.mnc > > Please check that it is in the correct format. > > ----------------------------------------- 16:11:50 - 02/04/2007 > > ??? Error using ==> spm_vol>subfunc1 > Can't get volume information > for '/home/common/matlab/spm2/templates/T1.mnc' > > Error in ==> spm_vol>subfunc2 at 51 > V = subfunc1(P); > > Error in ==> spm_vol at 37 > V = subfunc2(P); > > Error in ==> spm_segment>get_affine_mapping at 226 > if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; > > 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 235 > spm_segment(Va,cfg.template,flags); > > Error in ==> BEM_headmodel at 20 > seg = volumesegment(cfg, temp_mri); > > Thanks anybody who can help me on this issue. > > Chen > > From sameer at ANDREW.CMU.EDU Mon Apr 2 22:48:11 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:48:11 -0400 Subject: definetrial crashes matlab Message-ID: Hi, I am having an instance of matlab crashing when I try to run definetrial. The error message I get on my ssh client is [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! No such file or directory terminate called after throwing an instance of 'MathWorks::System::_utException' [1] Abort matlab the file clearly exists. [sameer at master SA]$ ls SA_040207_One.fif STI101.mat and the following command works. [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); I get the error message when I use cfgLL = [] ; cfgLL.dataset = 'SA_040207_One.fif' ; cfgLL.headerfile = 'SA_040207_One.fif' ; cfgLL.datatype = 'continuous' ; cfgLL.trialdef.eventtype = 'STI101' ; cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; cfgLL.trialdef.poststim = .500; cfgLL = definetrial(cfgLL); If I use a different data file instead of the one mentioned above (after changing to corresponding directory), the setup shown above works, and has consistently worked in the past. How could i troubleshoot it? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Mon Apr 2 23:07:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 17:07:34 -0400 Subject: choosing time windows in freqanalysis_mtmfft. Message-ID: Hello, I want to be able to see the coherences between different channels (using topoplotER). To that end, I know that I must implement freqdescriptives after first implementing freqanalysis_mtmfft. freqanalysis_mtmfft does not seem to allow me to choose the time window from which the data can be selected and then analyzed (I think so primarily because it does not seem to allow cfg.toilim or some such method). Is there a simple way around it that I am missing, or will I have to define new datasets with the data form the time window I want each time? thanks, sameer From c.hesse at FCDONDERS.RU.NL Tue Apr 3 09:23:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 3 Apr 2007 09:23:57 +0200 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Sameer, does the file you're trying to read have the gradiometer and magnetometer information actually in it? This seems very similar to (some of the) errors that Matt was reporting previously. Regards, Christian > I am having an instance of matlab crashing when I try to run > definetrial. The error message I get on my ssh client is > > [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! > No such file or directory > terminate called after throwing an instance of > 'MathWorks::System::_utException' > > [1] Abort matlab > > > the file clearly exists. > [sameer at master SA]$ ls > SA_040207_One.fif STI101.mat > > > and the following command works. > [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); > > I get the error message when I use > > cfgLL = [] ; > cfgLL.dataset = 'SA_040207_One.fif' ; > cfgLL.headerfile = 'SA_040207_One.fif' ; > cfgLL.datatype = 'continuous' ; > cfgLL.trialdef.eventtype = 'STI101' ; > cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; > cfgLL.trialdef.poststim = .500; > > cfgLL = definetrial(cfgLL); > > If I use a different data file instead of the one mentioned above > (after changing to corresponding directory), the setup shown above > works, and has consistently worked in the past. > > How could i troubleshoot it? > > thanks for your time. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Wed Apr 4 15:59:21 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 4 Apr 2007 09:59:21 -0400 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Christian, yes it does have the gradiometer and magnetometer information in it. I could extract the inf0 using fiffaccess. >> ls SA_040207_One.fif STI101.mat >> processContinousRawdata('SA_040207_One') >> ls channames.mat SA_040207_One.fif SA_040207_One.mat STI101.mat >> load SA_040207_One.mat size(C) ans = 312 250000 Thus I have all 306 MEG channels, plus eog and ekg plus the 3 stim channels. processContinousRawdata is essentially (from fiffaccess) status = 'ok'; rawdata('any',fileraw); C = []; while strcmp(status,'ok') [B, status] = rawdata('next'); %process_data(B) ; C = [C B] ; % As this is just one continous recording end filename = strcat(trial,'.mat'); save(filename,'C','-mat') rawdata('close'); thanks, sameer On Tue, 3 Apr 2007, Christian Hesse wrote: > Hi Sameer, > > does the file you're trying to read have the gradiometer and magnetometer > information actually in it? This seems very similar to (some of the) errors > that Matt was reporting previously. > > Regards, > Christian > > >> I am having an instance of matlab crashing when I try to run definetrial. >> The error message I get on my ssh client is >> >> [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! >> No such file or directory >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> [1] Abort matlab >> >> >> the file clearly exists. >> [sameer at master SA]$ ls >> SA_040207_One.fif STI101.mat >> >> >> and the following command works. >> [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); >> >> I get the error message when I use >> >> cfgLL = [] ; >> cfgLL.dataset = 'SA_040207_One.fif' ; >> cfgLL.headerfile = 'SA_040207_One.fif' ; >> cfgLL.datatype = 'continuous' ; >> cfgLL.trialdef.eventtype = 'STI101' ; >> cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; >> cfgLL.trialdef.poststim = .500; >> >> cfgLL = definetrial(cfgLL); >> >> If I use a different data file instead of the one mentioned above (after >> changing to corresponding directory), the setup shown above works, and has >> consistently worked in the past. >> >> How could i troubleshoot it? >> >> thanks for your time. >> >> best, >> sameer >> > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > From maris at NICI.RU.NL Thu Apr 5 14:57:31 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 5 Apr 2007 14:57:31 +0200 Subject: [SPAM]Re: [FIELDTRIP] timelockstatistics In-Reply-To: Message-ID: Hi Harald, Within 2 weeks, there will be a statistics tutorial on the Fieldtrip homepage that deals with timelock and freqstatistics. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Yes you can. Kind regards, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 5 17:34:48 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 5 Apr 2007 17:34:48 +0200 Subject: maximum statistic correction for mulitple comparisons Message-ID: when using the maximum statistic correction for multiple comparisons what are the values on the colorbar and in the image? are they the corrected p-values? also, i cannot find the cfg.correctm documented anywhere, on the index or in the scripts. is there a documentation for this? thanks! andy From sameer at ANDREW.CMU.EDU Sat Apr 7 22:42:33 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 16:42:33 -0400 Subject: covariance in timelockanalysis Message-ID: Hello, I use the following command to run timelockanalysis to get both averages and covariance. cfgTLA = []; cfgTLA.covariance = 'yes' ; cfgTLA.covariancewindow = [.100 .300]; cov_avg = timelockanalysis(cfgTLA,data) ; (Data actually runs from [-.499 2.0] This returns avg: [308x2500 double] var: [308x2500 double] fsample: 1000 numsamples: [29x1 double] time: [1x2500 double] dofvec: [1x2500 double] label: {308x1 cell} dimord: 'chan_time' cov: [308x308 double] numcovsamples: [29x1 double] grad: [1x1 struct] cfg: [1x1 struct] however, cov_avg.cov is essentially all zeros. Is there something I am missing here? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Sat Apr 7 23:03:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 17:03:19 -0400 Subject: troubleshooting topoplotER Message-ID: Hello, While using topoplotER using, cfgTLA = []; cfgTLA.xlim = [0 .3] ; cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/DataNeuroMagCondor2/Analysis/NM306grad.lay'; figure topoplotER(cfgTLA,avgLL_1_One) I get the following error. ??? Undefined function or variable "pnt". Error in ==> createlayout at 209 pnt = pnt(ind,:); To troubleshoot, on line 198, sel is empty matrix. So Line 205 pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); does not get executed. So I changed ch1 = sprintf('MEG %03d1', i); ch2 = sprintf('MEG %03d2', i); ch3 = sprintf('MEG %03d3', i); to ch1 = sprintf('MEG%03d1', i); ch2 = sprintf('MEG%03d2', i); ch3 = sprintf('MEG%03d3', i); ANow things both work and seem sensible. I just wanted to both bring it to your attention and make sure that it is indeed an o.k fix. Best, sameer From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:24:26 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:24:26 +0200 Subject: covariance in timelockanalysis In-Reply-To: Message-ID: Hi Sameer, > I use the following command to run timelockanalysis to get both > averages and covariance. > > cfgTLA = []; > cfgTLA.covariance = 'yes' ; > cfgTLA.covariancewindow = [.100 .300]; > cov_avg = timelockanalysis(cfgTLA,data) ; > > (Data actually runs from [-.499 2.0] > > This returns > > avg: [308x2500 double] > var: [308x2500 double] > fsample: 1000 > numsamples: [29x1 double] > time: [1x2500 double] > dofvec: [1x2500 double] > label: {308x1 cell} > dimord: 'chan_time' > cov: [308x308 double] > numcovsamples: [29x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? the scaling in the covariance matrix depends on the scaling of your signals - if you have the data in units of Tesla (as opposed to femto) then of course the covariances are going to be very small. This can cause some covariance based analysis methods to "think" that your data is rank deficient, etc ... In any event you can try this and see which message you get: if (length(cov_avg.label) == rank(cov_avg.cov)) disp('everything is fine'); else disp('you have a problem'); end If you get the second one you may want to try rescaling your data to femto Tesla first, that way you get "better behaved" covariance values. Hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:30:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:30:06 +0200 Subject: troubleshooting topoplotER In-Reply-To: Message-ID: Hi Sameer, given that the error you report involves a call to the function CREATELAYOUT it seems that you are using a relatively old version of Fieldtrip. There were some changes made in early March to how layouts are handled using a new function PREPARE_LAYOUT. I recommend that you download the latest version of FT - if this error persists, please let me know. Also, it is worth periodically checking the "recent changes" section of the FT website to see if there are any updates that are relevant to you. Regards, Christian On 7 Apr 2007, at 23:03, Sameer Walawalkar wrote: > Hello, > > While using topoplotER using, > > cfgTLA = []; > cfgTLA.xlim = [0 .3] ; > cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/ > DataNeuroMagCondor2/Analysis/NM306grad.lay'; > > figure > topoplotER(cfgTLA,avgLL_1_One) > > I get the following error. > ??? Undefined function or variable "pnt". > > Error in ==> createlayout at 209 > pnt = pnt(ind,:); > > > > To troubleshoot, on line 198, sel is empty matrix. So Line 205 > > pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); > > does not get executed. > > So I changed > ch1 = sprintf('MEG %03d1', i); > ch2 = sprintf('MEG %03d2', i); > ch3 = sprintf('MEG %03d3', i); > > to > ch1 = sprintf('MEG%03d1', i); > ch2 = sprintf('MEG%03d2', i); > ch3 = sprintf('MEG%03d3', i); > > ANow things both work and seem sensible. I just wanted to both > bring it to your attention and make sure that it is indeed an o.k fix. > > Best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:45:51 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:45:51 +0200 Subject: choosing time windows in freqanalysis_mtmfft. In-Reply-To: Message-ID: Hi Sameer, yes, not being able to specify a time window is a "feature" of FREQANALYSIS_MTMFFT that is somewhat misleading and counter intuitive. The easy way around it is to use FREQANALYSIS_MTMCONVOL with appropriate window selection parameters: cfg.toi = [the centre of the time window you want to analyse]; cfg.foi = [the frequencies of interest]; cfg.t_ftimwin = ones(length(cfg.foi),1).*duration of the window you want to analyse; Hope this helps, Christian On 2 Apr 2007, at 23:07, Sameer Walawalkar wrote: > Hello, > > I want to be able to see the coherences between different channels > (using topoplotER). To that end, I know that I must implement > freqdescriptives after first implementing freqanalysis_mtmfft. > > freqanalysis_mtmfft does not seem to allow me to choose the time > window from which the data can be selected and then analyzed (I > think so primarily because it does not seem to allow cfg.toilim or > some such method). > > Is there a simple way around it that I am missing, or will I have > to define new datasets with the data form the time window I want > each time? > > thanks, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:10:01 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:10:01 +0200 Subject: sensortype In-Reply-To: <929188.13557.qm@web56612.mail.re3.yahoo.com> Message-ID: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian On 30 Mar 2007, at 09:21, alotof eve wrote: > Sorry for sending so many emails. The error for combine channel is > due to sensortype.m cannot get my neuromag data type. I checked the > length(grad.label). It's 612, double of 306 which is supposed. How > can I settle it? > Thanks in advance. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 20:48:06 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis, combine channel > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > I checked the script of freqanalysis_wltconvol and founf the > default for output was 'powandcsd'. This output needs combine > channels. My meuromag data seems has problem on something related > "combine channels". > It works when I change output as 'pow'. However, I wonder what > might happen when using combining channels? I suppose it relates > layout? > Thanks for suggestion. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 04:59:42 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > Could you give me ome suggestion for wavelet analysis? These > parameters are OK in EEG data I count using ohter software. I don't > think it's different for MEG data but the error happened... > > >> cfg=[]; > >> cfg.sgn='MEG'; > >> cfg.method='wltconvol'; > >> cfg.width=3; > >> cfg.foi=4:1:30; > >> cfg.toi=-0.4:0.05:1.4; > >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); > ??? Error using ==> zeros > Out of memory. Type HELP MEMORY for your options. > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328 > \freqanalysis_wltconvol.m > On line 234 ==> if csdflg, crsspctrm = complex(zeros > (numsgncmb,numfoi,numtoi)); end > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m > On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower > (cfg.method)), cfg, data); > Any suggestions are appreciated. > > Best, > Eve > Sucker-punch spam with award-winning protection. > Try the free Yahoo! Mail Beta. > > 8:00? 8:25? 8:40? Find a flick in no time > with theYahoo! Search movie showtime shortcut. > > > Now that's room service! Choose from over 150,000 hotels > in 45,000 destinations on Yahoo! Travel to find your fit. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:23:20 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:23:20 +0200 Subject: Field Trip and MNE Localization In-Reply-To: <4602B269.9010106@nmr.mgh.harvard.edu> Message-ID: Hi Rob, Fieldtrip (FT) is very good at source analysis in both time and frequency domains and can supports neuromag MEG data so you should be able to do everything you need using FT. Moreover, there is powerful functionality for statistical analysis at the sensor and source levels. All the relevant documentation and example script for MEG data should be applicable to your MEG data. Hope this helps, Christian On 22 Mar 2007, at 17:44, Robert Levy wrote: > Hello, > > I just discovered Fieldtrip, and it seems like a very powerful tool > for spectral analysis of MEG data. Our lab uses Matti Hamalainen's > Neuromag MNE tools to localize ERMF generator sources. A spectral > analysis feature is in development for these tools, but at present > it can be done using Matlab either from scratch or potentially it > seems with the help Fieldtrip. So as not to attempt reinventing > the wheel I was wondering if anyone here has used Fieldtrip in > conjunction with the Neuromag tools to both localize MEG data and > analyze it spectrally. If anyone has done this already I would > appreciate any suggestions, pointers or references to papers. > > Thanks, > Rob > > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Sun Apr 8 16:59:34 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 8 Apr 2007 07:59:34 -0700 Subject: sensortype In-Reply-To: Message-ID: Dear Christian, Thanks. But could you tell me the way that keep only magnetometers or gradiometers in my data structure? I know that's ture both of them in my data structure at the same time. I really feel confused by this. Thanks. Best, Eve Christian Hesse wrote: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abastos at BERKELEY.EDU Mon Apr 9 06:11:53 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Sun, 8 Apr 2007 21:11:53 -0700 Subject: issues with clusterrandanalysis In-Reply-To: Message-ID: Dear Fieldtrippers, I am beginning to use the clusterrandanalysis function, but have not been finding any significant clusters in my EEG data. I changed alpha and alphathresh to be 0.5, but this still didn't produce any results (posclusters and negclusters are both empty). To test whether the config settings were actually working, I generated some random time frequency data using the following commands: s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time steps) rpow = rand(s); (produces pseudorandom nums between 0 and 1) TFR.powspctrm = rpow; I reran clusterrandanalysis with this new TFR, but still got no clusters. This puzzles me, because a random series of numbers should be statistically different from physiologically produced spectral data. I used the basic config settings found in the tutorial, which were: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = 'all'; [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Any ideas what I am doing wrong? Thanks, Andre From maris at NICI.RU.NL Mon Apr 9 12:11:07 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 9 Apr 2007 12:11:07 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <000d01c77a5d$35dcd2c0$a1967840$@edu> Message-ID: Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From sameer at ANDREW.CMU.EDU Mon Apr 9 23:53:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 9 Apr 2007 17:53:34 -0400 Subject: checkdata error Message-ID: Hello, I downloaded the latest fieldtrip-20070409.zip. Since then I have been getting the following problem ??? Undefined command/function 'checkdata'. Error in ==> freqanalysis at 136 data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, 'feedback', 'yes'); in various applications which used to run just fine previously. best, sameer From abastos at BERKELEY.EDU Tue Apr 10 07:30:07 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Mon, 9 Apr 2007 22:30:07 -0700 Subject: issues with clusterrandanalysis In-Reply-To: <000f01c77a8f$643e3960$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Using the cfg: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = TFR(1).elec.label(1:64); cfg.latency = [-3.5 -1.5]; cfg.elec = TFR(1).elec; cfg.neighbourdist = 4; The Matlab printout is: Selecting and formatting the data. selected 64 channels selected 41 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). After it calculates the randomization, I get a further error when the plot function is called (Again using the same settings as the tutorial): reverting to 151 channel CTF default ??? Error using ==> topoplotER labels in data and labels in layout do not match Error in ==> topoplotER at 210 topoplotER(cfg, data); As you said, it doesn't look like the neighborhood structure is being created properly. I was not able to generate it successfully using the following settings: cfg.neighbourdist = 4 cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) neighbours = neighbourselection(cfg, ALLDATA1(1).label) Neighbors becomes a series of 64 structures, but each structure's neighblabel field is empty. Perhaps this is also what happens when the script tries to generate the neighbourhood structure. Thanks for your help, Andre -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Eric Maris Sent: Monday, April 09, 2007 3:11 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] issues with clusterrandanalysis Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From maris at NICI.RU.NL Tue Apr 10 10:59:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 10 Apr 2007 10:59:10 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <004401c77b31$503c46d0$f0b4d470$@edu> Message-ID: Dear Andre, > As you said, it doesn't look like the neighborhood structure is being > created properly. I was not able to generate it successfully using the > following settings: > cfg.neighbourdist = 4 > cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) > neighbours = neighbourselection(cfg, ALLDATA1(1).label) > > Neighbors becomes a series of 64 structures, but each structure's > neighblabel field is empty. Perhaps this is also what happens when the > script tries to generate the neighbourhood structure. 1. Are the labels is elec.label and ALLDATA1(1).label identical? 2. Are the electrode positions in elec.pnt expressed on the proper scale (i.e., such that cfg.neighbourdist makes sense)? If these checks don't help, send me you one of your data structures (maris at nici.ru.nl). Good luck, Eric > > Thanks for your help, > > Andre > > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Eric Maris > Sent: Monday, April 09, 2007 3:11 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] issues with clusterrandanalysis > > Dear Andre, > > > > > I am beginning to use the clusterrandanalysis function, but have not been > > finding any significant clusters in my EEG data. I changed alpha and > > alphathresh to be 0.5, but this still didn't produce any results > > (posclusters and negclusters are both empty). To test whether the config > > settings were actually working, I generated some random time frequency > data > > using the following commands: > > > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 > time > > steps) > > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > > TFR.powspctrm = rpow; > > > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > > This puzzles me, because a random series of numbers should be > statistically > > different from physiologically produced spectral data. > > > My first guess is that there is something wrong with your neighborhood > structure. Can you send me a copy of the screen output (only the part before > the counting of the randomizations)? > > When using MEG-data coming from a CTF system, this neighborhood structure > is calculated automatically. However, I guess you are using a different > sensor configuration. In that case, you have to supply this information to > clusterrandanalysis. You can find more information about this in the online > help of clusterrandanalysis. > > > Kind regards, > > Eric > > > > > > > I used the basic config settings found in the tutorial, which were: > > > > cfg.statistic = 'indepsamplesT'; > > cfg.alphathresh = 0.5; > > cfg.makeclusters = 'yes'; > > cfg.minnbchan = 2; > > cfg.clusterteststat = 'maxsum'; > > cfg.onetwo = 'twosided'; > > cfg.alpha = 0.5; > > cfg.nranddraws = 100; > > cfg.channel = 'all'; > > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > > > Any ideas what I am doing wrong? From c.hesse at FCDONDERS.RU.NL Tue Apr 10 11:26:30 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 10 Apr 2007 11:26:30 +0200 Subject: checkdata error In-Reply-To: Message-ID: Hi Sameer, we checked and the function CHECKDATA is definitely in the latest version of FT. You might want to make sure that your Matlab path has been updated, and that Matlab is aware of the presence of the new function. If in doubt, restart Matlab and let us know if the error persists. Regards, Christian On 9 Apr 2007, at 23:53, Sameer Walawalkar wrote: > Hello, > > I downloaded the latest fieldtrip-20070409.zip. > > Since then I have been getting the following problem > > ??? Undefined command/function 'checkdata'. > > Error in ==> freqanalysis at 136 > data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, > 'feedback', 'yes'); > > in various applications which used to run just fine previously. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 12:59:37 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 12:59:37 +0200 Subject: maximum statistic correction for mulitple comparisons In-Reply-To: Message-ID: Hi Andrew, On 5 Apr 2007, at 17:34, Andrew Smart wrote: > when using the maximum statistic correction for multiple > comparisons what > are the values on the colorbar and in the image? are they the > corrected > p-values? The values that you get in the field "stat.prob" when you do either one of stat = freqstatistics(cfg, freq) stat = timelockstatistics(cfg, timelock) stat = sourcestatistics(cfg, source) and with cfg.correctm=yes are indeed corrected p-values. The functions will also print the following on your screen "using a maximum-statistic based method for multiple comparison correction" "the returned probabilities and the thresholded mask are corrected for multiple comparisons" > also, i cannot find the cfg.correctm documented anywhere, on the > index or in > the scripts. is there a documentation for this? There is no more documentation on them than this single line in statistics_montecarlo % cfg.correctm = apply multiple-comparison correction, 'no', 'max', cluster', 'bonferoni', 'holms', 'fdr' (default = 'no') Someone here in Nijmegen is currently rewriting the randomization statistics tutorial, I will ask him whether he can add some information on these options. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:04:32 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:04:32 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070402140316.048e9b10@email.med.yale.edu> Message-ID: On 2 Apr 2007, at 20:06, Brian Roach wrote: > After re-running the sourceanalysis and sourceinterpolate, I seem > to get a better looking plot using cfg.funparameter = 'pow', but > when I use cfg.funparameter = 'nai', I get this error message: > > >> sliceinterp(cfg, sourceInterp) > ??? Error using ==> sliceinterp at 175 > no functional data supplied Hi Brian, Is the neural activity computed in your data? Please check whether you have besides the field source.avg.pow also the field source.avg.nai. Computing the neural activity index requires cfg.projectnoise=yes in sourceanalysis, and furthermore requires that you call sourcedescriptives after sourceanalysis. I suggest that you use the new sourceplot function instead of the old sliceinterp function. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:09:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:09:27 +0200 Subject: covariance in timelockanalysis In-Reply-To: <07891259-31FE-47E6-B5D1-2FA6354B862C@fcdonders.ru.nl> Message-ID: Hi Sameer, > cov: [308x308 double] ... > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? > > the scaling in the covariance matrix depends on the scaling of your > signals - if you have the data in units of Tesla (as opposed to > femto) then of course the covariances are going to be very small. > This can cause some covariance based analysis methods to "think" > that your data is rank deficient, etc ... Since you have 308 channels instead of 306, the units of the channels will be different since not all of your channels are apparently MEG channels. The covariance between two channels is in the units of the two channels, i.e. the EEG-MEG covariance is in units of V*T (Volts timese Tesla) or uV*fT or something similar. Robert From sameer at ANDREW.CMU.EDU Tue Apr 10 18:40:55 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 12:40:55 -0400 Subject: length of freq vector in freqanalysis Message-ID: Hello, I find that freqanalysis (cfg.method = mtmfft) generates two different .freq vectors (different lengths, but spanning the correct [min max] as indicated by cfg.foilim) for two different datasets passed with same cfg (but one dataset has more time points than the other). Plotting the power spectra of the two datasets simultaneously using singleplotER works just fine, but multiplotER shows one spectrum spanning smaller range than the other. Funnily, it is the frequency distribution with the larger .freq vector which is graphed smaller. Is there some way I can specify not only the frequency range but also the number of frequency points to be generated? The details are given below. 1> re: freqanalysis I use the same cfg structure (given below) to pass two datasets to freqanalysis. Yet the frequency vectors for each dataset has very different lengths. I wonder if the different time lengths of each set make a difference. cfg = []; cfg.ouput='powandcsd'; cfg.method='mtmfft'; cfg.keeptrials='no'; cfg.tapsmofrq=4; cfg.foilim =[30 90]; cfg.channel = 'MEG' ; cfg.channelcmb = {'MEG' 'MEG'}; pre1 = -.300 ; pre2 = -.100 ; post1 = .000 ; post2 = .500 ; (this line tells my defined function Breakdata to pass on only data between times 300msec to 100 msec before event and from event to 500 msec after. [data_pre, data_post] = Breakdata(data, pre1, pre2, post1, post2) freq_pre = freqanalysis(cfg,data_pre); freq_post = freqanalysis(cfg,data_post); fd_pre = freqdescriptives([], freq_pre) fd_post = freqdescriptives([], freq_post) In the above line Breakdata is a function I have written (I know I could use TFRs to do the same, but I had already written the function and have not yet had time to consider the other option). Now, my question is, >> size(freq_pre.freq) ans = 1 13 >> size(freq_post.freq) ans = 1 31 Why the difference? (they do however span the interval [30 90].). Needless to mention, fd_pre and fd_post are also effected. 2>re: multiplot. I use cfg = []; cfg.xparam = 'freq'; cfg.zparam = 'cohspctrm'; cfg.zlim = [0 1e-27]; cfg.channel = 'all'; cfg.cohrefchannel = 'MEG1833'; cfg.layout = 'NM306mag.lay'; multiplotER(cfg, fd_pre,fd_post) I would expect the plotting would not be affected as both datasets have their frequency vector noted for the x-axis. Yet, the graph of the first dataset is 1/3rd as long on the plot. How can I fix this? (Incidently, singleplotER works fine for the power spectrum ). Thanks for your help. Best, sameer From jan.schoffelen at FCDONDERS.RU.NL Tue Apr 10 20:58:41 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Tue, 10 Apr 2007 20:58:41 +0200 Subject: length of freq vector in freqanalysis Message-ID: Dear Sameer, Your questions are related to some fundamental aspects of fourier-analysis. In general: the length of your data determines the frequency-resolution of the powerspectrum calculated from it. For a good introduction on fourier-analysis you could have a look at www.dspguide.com. Regarding your question about multiplotER: apparently the function expects two data-structures with the same frequency-axis. This can be achieved with zero-padding. You can specify cfg.pad before calling freqanalysis (for a good introduction on zero-padding: see www.dspguide.com I think). If you take this cfg.pad equal for the freqanalysis on data_pre and data_post (it should be >= the longest trials you have, so in your specific case >= 0.5 (it is defined in seconds)), the frequency axes come out identical and I expect multiplotER to behave itself. By the way: cfg.tapsmofrq should be an integer multiple of the frequency-resolution of your data, i.e. an integer multiple of 1./(data-length [this includes the padding if you are comparing data with different length]) Yours, Jan-Mathijs ----- Original Message ----- From: Sameer Walawalkar Date: Tuesday, April 10, 2007 6:40 pm Subject: [FIELDTRIP] length of freq vector in freqanalysis > Hello, > > I find that freqanalysis (cfg.method = mtmfft) generates two > different > .freq vectors (different lengths, but spanning the correct [min > max] as > indicated by cfg.foilim) for two different datasets passed with > same cfg > (but one dataset has more time points than the other). > > Plotting the power spectra of the two datasets simultaneously using > singleplotER works just fine, but multiplotER shows one spectrum > spanning > smaller range than the other. Funnily, it is the frequency > distribution > with the larger .freq vector which is graphed smaller. > > Is there some way I can specify not only the frequency range but > also the > number of frequency points to be generated? > > The details are given below. > > 1> re: freqanalysis > I use the same cfg structure (given below) to pass two datasets to > freqanalysis. Yet the frequency vectors for each dataset has very > different lengths. I wonder if the different time lengths of each > set > make a difference. > > cfg = []; > cfg.ouput='powandcsd'; > cfg.method='mtmfft'; > cfg.keeptrials='no'; > cfg.tapsmofrq=4; > cfg.foilim =[30 90]; > cfg.channel = 'MEG' ; > cfg.channelcmb = {'MEG' 'MEG'}; > > > pre1 = -.300 ; > pre2 = -.100 ; > post1 = .000 ; > post2 = .500 ; > (this line tells my defined function Breakdata to pass on only data > between times 300msec to 100 msec before event and from event to > 500 msec > after. > > [data_pre, data_post] = Breakdata(data, pre1, pre2, > post1, post2) > freq_pre = freqanalysis(cfg,data_pre); > freq_post = freqanalysis(cfg,data_post); > > fd_pre = freqdescriptives([], freq_pre) > fd_post = freqdescriptives([], freq_post) > > In the above line Breakdata is a function I have written (I know I > could > use TFRs to do the same, but I had already written the function and > have > not yet had time to consider the other option). > > Now, my question is, > >> size(freq_pre.freq) > > ans = > > 1 13 > > >> size(freq_post.freq) > > ans = > > 1 31 > > Why the difference? (they do however span the interval [30 90].). > Needless to mention, fd_pre and fd_post are also effected. > > 2>re: multiplot. > I use > cfg = []; > cfg.xparam = 'freq'; > cfg.zparam = 'cohspctrm'; > cfg.zlim = [0 1e-27]; > cfg.channel = 'all'; > cfg.cohrefchannel = 'MEG1833'; > cfg.layout = 'NM306mag.lay'; > multiplotER(cfg, fd_pre,fd_post) > > I would expect the plotting would not be affected as both datasets > have > their frequency vector noted for the x-axis. Yet, the graph of the > first > dataset is 1/3rd as long on the plot. > > How can I fix this? (Incidently, singleplotER works fine for the > power > spectrum ). > > Thanks for your help. > > Best, > sameer > > From sameer at ANDREW.CMU.EDU Tue Apr 10 22:39:27 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 16:39:27 -0400 Subject: removing line frequency Message-ID: Hello, I have been removing line frequency using the notch filter so far and it works fine. However, my data shows lines at 120 and 180 Hz as well (line frequency in US is 60Hz). So I tried cfg.lnfreq = [60 120]; It is accepted, but it does not work. Infact now, even the 60Hz notch filtering does not work. Is there a way to implement both? thanks, sameer From ingew at SOCSCI.RU.NL Wed Apr 11 10:09:10 2007 From: ingew at SOCSCI.RU.NL (Inge Westmijse) Date: Wed, 11 Apr 2007 10:09:10 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis Message-ID: Hi all, I am trying to perform sourceanalysis, but get an error message I cannot explain. It's probably something very basic, but I just don't get it! Here's my code: % Defining the dataset cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg = definetrial(cfg); cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 1]; dataBroadBand = preprocessing(cfg); cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 20]; dataBandPassed = preprocessing(cfg); % Performing time-lock analysis on bp-filtered signal cfg = []; cfg.covariance = 'yes'; cfg.keeptrials = 'yes'; TLDataBandPassed = timelockanalysis(cfg,dataBandPassed); % prepare_localspheres hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg = []; cfg.grad = hdr.grad; cfg.headshape = 'Ptn2b.shape'; [ft_headshape,cfg] = prepare_localspheres(cfg); % preparation of leadfields based on the local sphere model cfg = []; cfg.vol = ft_headshape; hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg.grid.resolution = 1; cfg.grad = hdr.grad; cfg.reducerank = 2; Grid = prepare_leadfield(cfg,TLDataBandPassed); % Source analysis with this broadband data cfg = []; cfg.method = 'lcmv'; cfg.vol = ft_headshape; cfg.grid = Grid; cfg.rawtrial = 'no'; cfg.keepfilter = 'yes'; SourceBP = sourceanalysis(cfg,TLDataBandPassed); Everything goes fine until this last line, then I get the following error: ??? Index exceeds matrix dimensions. Error in ==> sourceanalysis at 944 data.cov = data.cov(seldata,seldata); Error in ==> SAMimitation_v110407 at 64 SourceBP = sourceanalysis(cfg,TLDataBandPassed); I hope someone can help me, thanks in advance! Inge Westmijse ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:19:31 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:19:31 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <1176278950.461c97a66ffa2@trajanus.socsci.kun.nl> Message-ID: On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:40:52 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:40:52 +0200 Subject: removing line frequency In-Reply-To: Message-ID: Hi Sameer On 10 Apr 2007, at 22:39, Sameer Walawalkar wrote: > I have been removing line frequency using the notch filter so far > and it works fine. However, my data shows lines at 120 and 180 Hz > as well (line frequency in US is 60Hz). > > So I tried > > cfg.lnfreq = [60 120]; > > It is accepted, but it does not work. Infact now, even the 60Hz > notch filtering does not work. > > Is there a way to implement both? if you look into private/preproc.m, you see that the function doing the actual work is private/notchfilter. That function documents it as if Fline is specified as 50, a band of 48-52 is filtered out if Fline is specified as [low high], that band is filtered out So hence your first specification works, the second indeed not (since the 60 is at the border). Furthermore, that function also specifies a default notch width of +- 2 Hz. So you cannot pass multiple frequencies at the moment, but it is easy to add line 264 in private/preproc reads if strcmp(cfg.lnfilter, 'yes'), dat = notchfilter(dat, fsample, cfg.lnfreq, cfg.lnfiltord); end line 265-... in private/preproc read if strcmp(cfg.dftfilter, 'yes'), for i=1:length(cfg.dftfreq) % filter out the 50Hz noise, optionally also the 100 and 150 Hz harmonics dat = dftfilter(dat, fsample, cfg.dftfreq(i)); end end if you change the line 264 into something similar, like "for each cfg.lnfreq do notchfilter", then you'll have what you want. I will change it in the release version, it will be on the ftp version in a few days. If the sampling frequency of your MEG system is accurately specified, and if your data segments are long enough, you can also use the dftfilter. That is a much sharper filter (maximally sharp). It might require filter padding though (cfg.padding in preprocessing). It is especially usefull for frequency analysis with multitapering, for timelocked analysis you won't see much benefit. You can read the details on the method in the supplementary online material in our 2005 Science paper (see http://www2.ru.nl/fcdonders/fieldtrip/ doku.php?id=fieldtrip:publications). best regards, Robert From alotof_xd at YAHOO.COM Thu Apr 12 08:39:47 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 11 Apr 2007 23:39:47 -0700 Subject: same scale for plot Message-ID: Hi, experts, Sorry for asking a stupid question... When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : 0.6], the color scale for each map is different. How can I set the same scale for all the maps? Thanks. Best, Eve --------------------------------- Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Thu Apr 12 08:53:36 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Thu, 12 Apr 2007 08:53:36 +0200 Subject: same scale for plot In-Reply-To: <689836.79585.qm@web56613.mail.re3.yahoo.com> Message-ID: Hi Eve, i believe you just have to define similar to cfg.xlim, a cfg.zlim = [A B] (A and B being max and min values). Best, Juan alotof eve wrote: > Hi, experts, > > Sorry for asking a stupid question... > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > 0.6], the color scale for each map is different. How can I set the > same scale for all the maps? Thanks. > > Best, > Eve > > ------------------------------------------------------------------------ > Finding fabulous fares is fun. > Let Yahoo! FareChase search your favorite travel sites > > to find flight and hotel bargains. From gmcauley at LLU.EDU Thu Apr 12 19:12:16 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Thu, 12 Apr 2007 10:12:16 -0700 Subject: General EEG/EEG Analysis Questions Message-ID: Hello, I am wondering if there is a list where one could post more general EEG and/or EEG analysis questions (I am doing some analysis of EEG data, but am not currently using FT trip code - am writing in MATLAB however)? Thank you, ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From teresa at DSRF.ORG Thu Apr 12 18:50:34 2007 From: teresa at DSRF.ORG (Teresa Cheung) Date: Thu, 12 Apr 2007 09:50:34 -0700 Subject: Auto Reply Message-ID: Dear Colleagues, I am on vacation from Tuesday April 10 to Friday April 13. If you need to book MEG time, please contact julie at dsrf.org If you need help with MEG analysis, please contact Alexander at amoisieev at dsrf.org For other urgent inquiries, please contact dawn at dsrf.org. Otherwise, I will reply to your email early next week. Best regards, -Teresa Cheung Teresa Cheung MEG Laboratory Manager Down Syndrome Research Foundation 1409 Sperling Avenue Burnaby, BC Office: 604 444 3773 ext 2239 Lab: 604 444 3773 ext 2249 Cell: 604 313 0338 From ali.mazaheri at FCDONDERS.RU.NL Thu Apr 12 19:37:46 2007 From: ali.mazaheri at FCDONDERS.RU.NL (Ali Mazaheri) Date: Thu, 12 Apr 2007 13:37:46 -0400 Subject: same scale for plot Message-ID: Hi Eve, what I do is find the max and min value for one of the maps, then set the cfg.zlim to that value. best ali ----- Original Message ----- From: "Juan R. Vidal" Date: Thursday, April 12, 2007 2:53 am Subject: Re: [FIELDTRIP] same scale for plot > Hi Eve, > > > i believe you just have to define similar to > cfg.xlim, > a cfg.zlim = [A B] (A and B being max and min values). > > Best, > > Juan > > alotof eve wrote: > > > Hi, experts, > > > > Sorry for asking a stupid question... > > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > > 0.6], the color scale for each map is different. How can I set > the > > same scale for all the maps? Thanks. > > > > Best, > > Eve > > > > ------------------------------------------------------------------ > ------ > > Finding fabulous fares is fun. > > Let Yahoo! FareChase search your favorite travel sites > > 14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--> > > to find flight and hotel bargains. > > From sameer at ANDREW.CMU.EDU Fri Apr 13 15:12:16 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 13 Apr 2007 09:12:16 -0400 Subject: possible a multiplot question Message-ID: Hello, I am interested in linking by lines pairs of MEG channels whose coherences satisfy certain conditions defined by processing that I'll do (after the coherences are generated by using freqanalysis_mtmfft and then freqdescriptives). In an advanced application, the colour of the lines could also include more information. I was thinking of generating necessary MATLAB code, but just wanted to check if there is a simple way to use fieldtrip plotting and layout settings which I might have missed. Thanks for your time. Best, sameer From abastos at BERKELEY.EDU Sat Apr 14 03:11:30 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Fri, 13 Apr 2007 18:11:30 -0700 Subject: using clusterrandanalysis with avgtime = 'yes' In-Reply-To: Message-ID: Dear Trippers, So I am studying the differences in ongoing data between two experimental conditions. Because the data are not time-locked and the differences I expect are between conditions and not necessarily a function of time, it doesn't quite make sense to have a dynamic power spectrum. I have been performing the cluster analysis with my 4-dimensional data (rpt_chan_freq_time), but this still produces clusters that are time-dependent. I set cfg.avgtime = 'yes', but now cluster.stats and .raweffects (and everything else produced by clusterrandanalysis) are NaNs. Here is my cfg: cfg=[]; cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.05; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.05; cfg.nranddraws = 200; cfg.channel = 'all'; cfg.elec = TFR1.elec; cfg.neighbourdist = 49; cfg.avgovertime = 'yes'; I execute: [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Here is the Matlab output: Selecting and formatting the data. selected 64 channels averaging over 97 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 200 randomization 1 200 randomization 2 200 ... The script executes, runs pretty fast, and then produces a cluster structure with all NaNs. Anyone know what I am doing wrong? Best, Andre From ychen at BME.UFL.EDU Tue Apr 17 18:14:40 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 17 Apr 2007 18:14:40 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Sammeer, Thanks for the kind help. After I defined the full path to T1.mnc file, it still crashed. Here is what I am doing: mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.template = 'D:\mat\toolbox\spm2\templates\T1.mnc'; cfg.name = 'segment'; cfg.write = 'yes'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is: ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> vol_singleshell at 8 [segmentedmri] = volumesegment(cfg, mri); What wrong I did? Further help is very much appreciated. Chen From andrew.smart at NYU.EDU Tue Apr 17 19:14:28 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 19:14:28 +0200 Subject: group analysis of BESA source coherence Message-ID: Hi, Has anyone done a group analysis on source coherence with coherence files from BESA? I have exported *.tfc files using coherence between BESA dipoles from individual subjects and would now like to compare coherence between sources and conditions on a group level. Can you treat the dipoles from BESA as channels in Fieldtrip and perform statistical analysis? What would be the best way to go about this?? I have attached an example *.tfc file which is coherence between one BESA source in a montage with all other sources in that montage. Thank you! andy -------------- next part -------------- A non-text attachment was scrubbed... Name: LP_ELAN_05_M100_Fried_prep_gram.tfc Type: application/octet-stream Size: 28035 bytes Desc: not available URL: From andrew.smart at NYU.EDU Tue Apr 17 23:48:43 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 23:48:43 +0200 Subject: BESA source coherence errors Message-ID: Hi, I have been trying to do statistics on BESA source coherence files and I get this error if I try to use freqgrandaverage ??? Reference to non-existent field 'label'. Error in ==> freqgrandaverage at 117 cfg.channel = channelselection(cfg.channel, varargin{i}.label); Error in ==> coherence_test at 92 freq = freqgrandaverage(cfg, Prepgram{:}); The output from besa2fieldtrip has a field called 'labelcmb' instead of 'label', is this why freqgrandaverage cannot find label? If I change 'label' in freqgrandaverage to 'labelcmb' then the script won't find the cohspctrm field. But the field 'labelcmb' seems to be supported in the freq scripts. I would like to average coherence across subjects and do randomization tests between conditions. The coherence is cortico-cortical coherence between planted dipoles, not channels. Any suggestions? Thanks! andy From myles.reilly at HSC.UTAH.EDU Tue Apr 17 23:48:04 2007 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 17 Apr 2007 23:48:04 +0200 Subject: Neuromag event values Message-ID: Hello, I have been trying timelockanalysis on continuous Neuromag data. It does do the average but the results don't match averages calculated by Neuromag applications. In Fieldtrip I can see a single event named 'trigger' that has 2 values, [3.0953e-004] and [6.1907e-004]. There are actually two triggers with the values 1 and 2. Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration factor at work here. I suspect both triggers are being averaged together. Thank you for any direction you can give me on this, Myles From scrofa at GMAIL.COM Wed Apr 18 00:12:17 2007 From: scrofa at GMAIL.COM (Daniel Kislyuk) Date: Wed, 18 Apr 2007 01:12:17 +0300 Subject: Neuromag event values In-Reply-To: Message-ID: What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From c.hesse at FCDONDERS.RU.NL Wed Apr 18 09:26:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 18 Apr 2007 09:26:23 +0200 Subject: Neuromag event values In-Reply-To: <489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: Hi, FT automatically extracts trigger values (onset and offset) from channel STI014. I am not 100% sure why the values are scaled as they are (it is what is written in the file), but it turns out that if you divide all your trigger values by the "magnitude of the smallest non- zero trigger value" you will have nice integers again. Alternatively you could just tell trialfun to look for the funny trigger values. Hope this helps, Christian On 18 Apr 2007, at 00:12, Daniel Kislyuk wrote: > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: >> Hello, >> >> I have been trying timelockanalysis on continuous Neuromag data. >> It does do the average but the results don't match averages >> calculated by >> Neuromag applications. In Fieldtrip I can see a single event >> named 'trigger' that has 2 values, [3.0953e-004] >> and [6.1907e-004]. There are actually two triggers with the values >> 1 and 2. >> >> Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a >> calibration >> factor at work here. >> >> I suspect both triggers are being averaged together. >> >> Thank you for any direction you can give me on this, >> >> Myles >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Wed Apr 18 14:36:09 2007 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Wed, 18 Apr 2007 16:36:09 +0400 Subject: EGI layout Message-ID: Dear all, Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Best Regards, Olga ============================================================= Olga Sysoeva, PhD Researcher Institute of Higher Nervous Activity and Neurophysiology Russian Academy of Sciences (RAS) 5a Butlerova str. MOSCOW 117485, RUSSIA Tel.: +(7 495) 7893852; Fax: +(7 495) 3388500 E-mail: olga at graphicmind.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From Myles.Reilly at HSC.UTAH.EDU Wed Apr 18 16:16:32 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Wed, 18 Apr 2007 08:16:32 -0600 Subject: Neuromag event values In-Reply-To: A<489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From I.Westmijse at NICI.RU.NL Wed Apr 18 16:16:18 2007 From: I.Westmijse at NICI.RU.NL (Inge Westmijse) Date: Wed, 18 Apr 2007 16:16:18 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <917AE84F-D4B3-449A-833B-A74A77425A94@fcdonders.ru.nl> Message-ID: Hi Robert (and everyone else) You solution unfortunately did not work. I have looked into the problem in more detail and it seems the problem lies in a miscommunication between timelockanalysis and sourceanalysis. I have created a dataset consisting of one trial, based on two markers (Start and Stop). As far as I can see, Timelockanalysis creates a covariance matrix with the dimensions: [1,151,151]. I could not see any squeezing happening before the cov becomes part of the results of timelockanalysis. Then these results are used in sourceanalysis, but this code expects for nTrials = 1, a covariance matrix in the shape of [151,151]. So, when he tries to read data.cov(2,1) it's error. Do I see this correctly and if so how can it be solved? Of course, otherwise, what is the problem then? Best, Inge -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: woensdag 11 april 2007 21:20 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Index exceeds matrix dimensions error during sourceanalysis On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From alotof_xd at YAHOO.COM Wed Apr 18 20:10:39 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 18 Apr 2007 11:10:39 -0700 Subject: Neuromag event values In-Reply-To: <5081A4F38BFD4E4D92F4191FBCF41E004D8BD5@CAMPUSV3.xds.umail.utah.edu> Message-ID: Hi, My data is also from Vectorview, 306 sensors. The trigger in my data is on 'STI101'. You might check this by commond: unique({event.type}) My unique event.type is: 'STI101' 'STI301' 'trial' Then I use: [event(find(strcmp('bckpanel trigger', {event.type}))).value] The value I got are exactly the same as the triggers I set. But I did this before timelock analysis. Myles Reilly wrote: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lauri at NEURO.HUT.FI Wed Apr 18 23:43:38 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Thu, 19 Apr 2007 00:43:38 +0300 Subject: Neuromag event values In-Reply-To: <411335.43847.qm@web56604.mail.re3.yahoo.com> Message-ID: Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From andrew.smart at NYU.EDU Thu Apr 19 00:28:27 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 00:28:27 +0200 Subject: another help request for *.tfc files Message-ID: I have been trying to do group analysis on source coherence files in fieldtrip, and fieldtrip doesn't seem to like the output of besa2fieldtrip when the *.tfc files have coherence. The problem seems to be that fieldtrip is looking for the 'label' field in the output structure, which when the *.tfc file has coherence becomes 'labelcmb'. I debugged through fieldtrip and changed prepare_timefreq_data (there is FIXME about this in freqstatistics but it is in Dutch, but I believe it says to replace data.label with data.labelcmb(:,2), however it doesn't specify in which function to do this) In prepare_timefreq_data I changed: output.label = input.label; to output.label = input.labelcmb; To accomodate the labelcmb field in the fieldtrip structure. This gets me by the errors about the field 'label' not existing. But then I get the following errors (for 10 subjects) reading time-frequency representation using BESA toolbox reading coherence between 4 channel pairs renaming parameter 'cohspctrm' into 'powspctrm' selected 1 channels selected 41 time bins selected 24 frequency bins using "statistics_montecarlo" for the statistical testing ??? Error using ==> fieldtrip-20070320\private\statistics_wrapper the size of the design matrix does not match the number of observations in the data Error in ==> freqstatistics at 87 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> coherence_test at 82 Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); This is the code I have used which generates the above error, which I cannot figure out: clear all; close all; pack; filename_Prepgram = { 'LP_ELAN_05_M100_Fried_prep_gram.tfc' 'LP_ELAN_06_M100_Fried_prep_gram.tfc' 'LP_ELAN_07_M100_Fried_prep_gram.tfc' 'LP_ELAN_08_M100_Fried_prep_gram.tfc' 'LP_ELAN_10_M100_Fried_prep_gram.tfc' 'LP_ELAN_11_M100_Fried_prep_gram.tfc' 'LP_ELAN_12_M100_Fried_prep_gram.tfc' 'LP_ELAN_13_M100_Fried_prep_gram.tfc' 'LP_ELAN_14_M100_Fried_prep_gram.tfc' 'LP_ELAN_16_M100_Fried_prep_gram.tfc' }; % this is the list of BESA datafiles in the other condition filename_Prepungram = { 'LP_ELAN_05_M100_Fried_prep_ungram.tfc' 'LP_ELAN_06_M100_Fried_prep_ungram.tfc' 'LP_ELAN_07_M100_Fried_prep_ungram.tfc' 'LP_ELAN_08_M100_Fried_prep_ungram.tfc' 'LP_ELAN_10_M100_Fried_prep_ungram.tfc' 'LP_ELAN_11_M100_Fried_prep_ungram.tfc' 'LP_ELAN_12_M100_Fried_prep_ungram.tfc' 'LP_ELAN_13_M100_Fried_prep_ungram.tfc' 'LP_ELAN_14_M100_Fried_prep_ungram.tfc' 'LP_ELAN_16_M100_Fried_prep_ungram.tfc' }; nsubj = length(filename_Prepgram); %read in BESA for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; cfg.channel = 'Fried_RH_elan_FL'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'max'; cfg.numrandomization = 200; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 % subject 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ]; % condition number cfg.uvar = 1; % "subject" cfg.ivar = 2; % "condition" Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); % any help would be greatly appreciated, thanks! andy From sdmuthu at CARDIFF.AC.UK Thu Apr 19 10:10:14 2007 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 19 Apr 2007 10:10:14 +0200 Subject: Estimating the power in EEG frequency bands Message-ID: Hi Fieldtrippers, A late follow-up to this topic. I have recentrly been musing over how to get a "clean" measure of the non-phase locked activity. I have tried subtracting the ERF out prior to time-frequency computation but this produces quite a bit of artifact...presumably since the single trial data will have considerable ;atency "jitter" The comments from Christian below make sense ( I think) why simply subtracting the two time-frequency power representaions is not valid. But I wonder would this subtractive approach be valid if one worked with the magnitude of the signal rather than power..omitting all the squaring operations? If this right theoretically, how to achieve this in Fieldtrip?. Would setting cfg.output = 'fourier then abs'ing the output work. My suspicion is no since the summing is being done first here. Alternatively, does one need to hack the code to return the magnitude. Thanks for your help on this and sorry for waking old threads :) - Suresh On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse wrote: >One further comment (please see below): > >> Hi Thomas, >>> Following up on this conversation. It seems that the ‘induced >>> activity’ contains both phase-locked and non-phase-locked >>> activity, whereby the ‘evoked’ activity contains only phase-locked >>> activity. Is it then kosher to separate these components by linear >>> subtraction? For example, if we first compute the ‘induced’ >>> activity by averaging power over individual trials, and from that >>> subtract the ‘evoked activity’ (calculated based on average >>> response) to get the induced activity without any phase-locked >>> activity? >> >> It is not correct to subtract because computing the induced and >> evoked power spectra involves squaring signal amplitudes (a non- >> linear operation), and hence, taking your terminology to refer to >> the instantaneous amplitudes of the signal components (this applies >> to any time-frequency tile) >>> Induced = Phase + Non-Phase >>> >>> And >>> >>> Evoked = Phase >>> >>> Then >>> >>> Non-Phase = Induced – Evoked >>> >>> >> what you actually get from spectral or time-frequency analysis is >> the power of your MEASURED signal >> >> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >> Non-Phase^2 >> >> Evoked^2 = Phase^2 >> >> Then >> >> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >> Phase^2 >> >Note that the other crucial thing to consider here is that you are in >one case averaging power over trials over trials: > >E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >Phase^2) ] + E[ 2*Phase*Non-Phase ] > >this is why taking the square root of sqrt(Induced^2) does not give >(Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). > >in the evoked case you are taking the power of the average amplitude > >Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) > >so in subtracting you are actually assuming that E[Phase]^2 = E >[(Phase)^2] which is unlikely to be accurate the case in finite samples. > >Hope I have not confused others (or myself) here. >Christian > > >---------------------------------------------------------------------- >Christian Hesse, PhD, MIEEE > >F.C. Donders Centre for Cognitive Neuroimaging >P.O. Box 9101 >NL-6500 HB Nijmegen >The Netherlands > >Tel.: +31 (0)24 36 68293 >Fax: +31 (0)24 36 10989 > >Email: c.hesse at fcdonders.ru.nl >Web: www.fcdonders.ru.nl >---------------------------------------------------------------------- > > > > >Date: Thu, 22 Feb 2007 15:52:56 +0100 Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl Sender: FieldTrip discussion list From: Marcel Bastiaansen Subject: Re: Estimating the power in EEG frequency bands In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> Content-type: text/html; charset=ISO-8859-1 Dear Thomas, This is indeed the approach that I have followed succesfully a couple of times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that you are using is somewhat confusing. I (and I guess most people) would refer to induced activity as that part of the EEG that is non-phase-locked, so I would restate your equation to: induced = EEG - evoked. However, there is a drawback to this approach, since it assumes that the ERP is absolutely stationary over trials. This is not the case in reality (e.g. subjects' attentional level or other states may change from trial to trial, giving rise to variability in the single-trial ERPs). This means that by subtracting the average ERP, one may introduce frequency components in the residual EEG that were not present before. Klimesch, and Kalcher and Pfurtscheller, have come up with ways of scaling the average ERP so as to yield a best fit of the average with each single-trial ERP, but also that approach may be sub-optimal. My latest way around the problem is to run a TF analysis on the untreated EEG (containing both evoked and induced activity), and comparing this to a TF analysis of the subject-averaged ERPs (the evoked activity alone). Qualitative differences between the two analyses can now only be attributed to induced activity. Marcel Thomas Thesen wrote: > > Hi FieldTrippers, > > > > Following up on this conversation. It seems that the ‘induced activity’ contains both phase-locked and non-phase-locked activity, whereby the ‘evoked’ activity contains only phase-locked activity. Is it then kosher to separate these components by linear subtraction? For example, if we first compute the ‘induced’ activity by averaging power over individual trials, and from that subtract the ‘evoked activity’ (calculated based on average response) to get the induced activity without any phase-locked activity? > > > > So if > > Induced = Phase + Non-Phase > > And > > Evoked = Phase > > Then > > Non-Phase = Induced – Evoked > > > > Or does the fact that this is a linear operations on data that have been constructed through a non-linear process render this somehow invalid? It has certainly been done before. Your comments would be much appreciated. > > > > Cheers, > > Thomas From c.hesse at FCDONDERS.RU.NL Thu Apr 19 10:58:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 19 Apr 2007 10:58:23 +0200 Subject: Estimating the power in EEG frequency bands In-Reply-To: Message-ID: Hi > A late follow-up to this topic. I have recentrly been musing > over how to > get a "clean" measure of the non-phase locked activity. I have tried > subtracting the ERF out prior to time-frequency computation but this > produces quite a bit of artifact...presumably since the single > trial data > will have considerable ;atency "jitter" The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity. > The comments from Christian below make sense ( I think) why simply > subtracting the two time-frequency power representaions is not > valid. But I > wonder would this subtractive approach be valid if one worked with the > magnitude of the signal rather than power..omitting all the > squaring operations? Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum) Hope this helps, Christian > If this right theoretically, how to achieve this in Fieldtrip?. > Would > setting cfg.output = 'fourier then abs'ing the output work. My > suspicion is > no since the summing is being done first here. Alternatively, does > one need > to hack the code to return the magnitude. > > Thanks for your help on this and sorry for waking old threads :) > > - Suresh > > On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse > wrote: > >> One further comment (please see below): >> >>> Hi Thomas, >>>> Following up on this conversation. It seems that the ‘induced >>>> activity’ contains both phase-locked and non-phase-locked >>>> activity, whereby the ‘evoked’ activity contains only phase-locked >>>> activity. Is it then kosher to separate these components by linear >>>> subtraction? For example, if we first compute the ‘induced’ >>>> activity by averaging power over individual trials, and from that >>>> subtract the ‘evoked activity’ (calculated based on average >>>> response) to get the induced activity without any phase-locked >>>> activity? >>> >>> It is not correct to subtract because computing the induced and >>> evoked power spectra involves squaring signal amplitudes (a non- >>> linear operation), and hence, taking your terminology to refer to >>> the instantaneous amplitudes of the signal components (this applies >>> to any time-frequency tile) >>>> Induced = Phase + Non-Phase >>>> >>>> And >>>> >>>> Evoked = Phase >>>> >>>> Then >>>> >>>> Non-Phase = Induced – Evoked >>>> >>>> >>> what you actually get from spectral or time-frequency analysis is >>> the power of your MEASURED signal >>> >>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >>> Non-Phase^2 >>> >>> Evoked^2 = Phase^2 >>> >>> Then >>> >>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >>> Phase^2 >>> >> Note that the other crucial thing to consider here is that you are in >> one case averaging power over trials over trials: >> >> E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >> Phase^2) ] + E[ 2*Phase*Non-Phase ] >> >> this is why taking the square root of sqrt(Induced^2) does not give >> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). >> >> in the evoked case you are taking the power of the average amplitude >> >> Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) >> >> so in subtracting you are actually assuming that E[Phase]^2 = E >> [(Phase)^2] which is unlikely to be accurate the case in finite >> samples. >> >> Hope I have not confused others (or myself) here. >> Christian >> >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> >> Date: Thu, 22 Feb 2007 15:52:56 +0100 > Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl > Sender: FieldTrip discussion list > From: Marcel Bastiaansen > Subject: Re: Estimating the power in EEG frequency bands > In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> > Content-type: text/html; charset=ISO-8859-1 > > Dear Thomas, > > This is indeed the approach that I have followed succesfully a > couple of > times (e.g. Bastiaansen et al., JOCN 2006), although the > terminology that > you are using is somewhat confusing. I (and I guess most people) > would refer > to induced activity as that part of the EEG that is non-phase- > locked, so I > would restate your equation to: > induced = EEG - evoked. > > However, there is a drawback to this approach, since it assumes > that the ERP > is absolutely stationary over trials. This is not the case in > reality (e.g. > subjects' attentional level or other states may change from trial > to trial, > giving rise to variability in the single-trial ERPs). This means > that by > subtracting the average ERP, one may introduce frequency components > in the > residual EEG that were not present before. Klimesch, and Kalcher and > Pfurtscheller, have come up with ways of scaling the average ERP so > as to > yield a best fit of the average with each single-trial ERP, but > also that > approach may be sub-optimal. > My latest way around the problem is to run a TF analysis on the > untreated > EEG (containing both evoked and induced activity), and comparing > this to a > TF analysis of the subject-averaged ERPs (the evoked activity alone). > Qualitative differences between the two analyses can now only be > attributed > to induced activity. > > Marcel > > Thomas Thesen wrote: >> >> Hi FieldTrippers, >> >> >> >> Following up on this conversation. It seems that the ‘induced >> activity’ > contains both phase-locked and non-phase-locked activity, whereby the > ‘evoked’ activity contains only phase-locked activity. Is it then > kosher to > separate these components by linear subtraction? For example, if we > first > compute the ‘induced’ activity by averaging power over individual > trials, > and from that subtract the ‘evoked activity’ (calculated based on > average > response) to get the induced activity without any phase-locked > activity? >> >> >> >> So if >> >> Induced = Phase + Non-Phase >> >> And >> >> Evoked = Phase >> >> Then >> >> Non-Phase = Induced – Evoked >> >> >> >> Or does the fact that this is a linear operations on data that >> have been > constructed through a non-linear process render this somehow > invalid? It has > certainly been done before. Your comments would be much appreciated. >> >> >> >> Cheers, >> >> Thomas > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:22:17 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:22:17 +0200 Subject: Postdoc in MEG pain research In-Reply-To: Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus job posting.doc job posting.doc -------------- next part -------------- A non-text attachment was scrubbed... Name: 5b008fe.jpg Type: image/jpeg Size: 2053 bytes Desc: not available URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:38:38 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:38:38 +0200 Subject: Postdoc in MEG pain research Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus -------------- next part -------------- A non-text attachment was scrubbed... Name: job_posting_meg.doc Type: application/msword Size: 24064 bytes Desc: not available URL: From andrew.smart at NYU.EDU Thu Apr 19 17:43:19 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 17:43:19 +0200 Subject: problem partially solved Message-ID: Hi, I found why I was getting the error embarrassingly I had {i} instead of {:}! My general question remains about the possibility of doing statistical group analysis on coherence between BESA dipoles, or in source space in general. It seems most of the coherence analyses are set up to do coherence between channels and an external reference such as EMG. Thanks and sorry for all the messages! andy From jan.schoffelen at FCDONDERS.RU.NL Thu Apr 19 21:22:15 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 19 Apr 2007 21:22:15 +0200 Subject: problem partially solved Message-ID: Dear Andy, Please allow me to point you to the fact that fieldtrip has no restriction on the type of data you want to cohere. The rather mundane reason why the tutorial documentation on coherence is about cortico-muscular stuff, is related to the fact that the interpretation of cortico-muscular coherence is far more straightforward than the interpretation of coherence between EEG/MEG-channels, or between virtual electrodes/dipoles. However, the statistical routines don't care whether the coherence spectra you pass to them are between similar channels, or between dipole locations in the brain. Yours, Jan-Mathijs ----- Original Message ----- From: Andrew Smart Date: Thursday, April 19, 2007 5:43 pm Subject: [FIELDTRIP] problem partially solved > Hi, > I found why I was getting the error > embarrassingly I had {i} instead of {:}! > > My general question remains about the possibility of doing > statistical group > analysis on coherence between BESA dipoles, or in source space in > general. > It seems most of the coherence analyses are set up to do coherence > betweenchannels and an external reference such as EMG. > > Thanks and sorry for all the messages! > > andy From andrew.smart at NYU.EDU Thu Apr 19 21:43:45 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 15:43:45 -0400 Subject: problem partially solved In-Reply-To: Message-ID: Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From Brian.Roach at YALE.EDU Thu Apr 19 21:51:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 19 Apr 2007 15:51:38 -0400 Subject: source analysis example images Message-ID: fieldTrip users, I've run a source analysis using the DICS method and EEG data. Here is the code the leads me to the attached sourceplot results: cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.tapsmofrq = 2; cfg.foilim = [80 81]; freq = freqanalysis(cfg, data); cfg.method = 'dics'; cfg.frequency = 80; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2; cfg.projectnoise= 'yes'; tic;source = sourceanalysis(cfg, freq);toc cfg.mriunits = 'mm'; cfg.sourceunits = 'mm'; cfg.funparameter = 'nai'; sourceD = sourcedescriptives([], source); mriFile = '/home/bjr39/FTsource/t1_icbm_normal_1mm_pn0_rf0.mnc'; tic; sourceF = source2full(sourceD); toc tic; sourceInterp = sourceinterpolate(cfg, sourceF, mriFile); toc sourceplot(cfg, sourceInterp) I am wondering if this type of result seems reasonable (if it looks as though I have not made any huge mistakes)? If so, I would run another condition for the same subject and try to use the statistics functions. Also, what does this color scale describe? What are its units? thanks, Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput2.png Type: application/octet-stream Size: 98772 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput.png Type: application/octet-stream Size: 106585 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Thu Apr 19 23:22:05 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 19 Apr 2007 17:22:05 -0400 Subject: using prepare_layout and gradfile to generate mags and planar layout Message-ID: Hello, I want to try and use cfg.gradfile configuration during multiplot becasue of the following issues. If in my configuration, I include cfg.gradfile = file.fif'; everything seems to work fine. But, if I use cfg.layout = NM306all.lay I get the foll error.: the input is freq data with 306 channels, 61 frequencybins and 29 timebins reading layout from file NM306mag.lay ??? Error using ==> multiplotTFR labels in data and labels in layout do not match Usually this meant lay.labels did not have MEG in them. In the past, I have taken care of these errors by making changes to Topoplot and multiplot and adding the MEG to the labels. But with each version of changes being made, it becomes tougher and tougher to keep up with this. So I want to use cfg.gradfile, but then how does one use it for plotting mags and planar only? Incidently, my most currently download (april 18) is giving this weird error for mags.lay : cfg.layout = NM306mags.lay; reading layout from file NM306all.lay ??? Trouble reading floating point number from file (row 1, field 1) ==> MATLAB 5.0 MAT-file, Platform: Error in ==> textread at 177 [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> prepare_layout>readlay at 192 [chNum,X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %f %q %q'); Error in ==> prepare_layout at 108 lay = readlay(cfg.layout); Error in ==> multiplotTFR at 238 lay = prepare_layout(cfg, data); Error in ==> SomeMaster at 21 multiplotTFR(cfgTFRout, TFRmultLL_2_One); Thanks, Sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Apr 20 13:40:53 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 20 Apr 2007 13:40:53 +0200 Subject: problem partially solved In-Reply-To: Message-ID: Dear Andy, It seems as if you already solved the problem for your purpose. Anyway, instead of making a hack in one of the (deep) fieldtrip functions, I would rather change the frequency structure a bit before passing it to freqstatistics. Typically what I do, is the following. Please note that this workaround is ugly, but at present that's a way how it works. In order to keep track of how to interpret the different channels in the data, fieldtrip uses the field 'label', for which it assumes that the number of labels is equal to the first dimension (when 'dimord' = 'chan_freq...etc'), or to the second dimension (when 'dimord' = 'rpt_chan_etc') of your parameter of interest. However, when you are indeed interested in coherence, it's the field 'cohspctrm' which is the relevant field, and for this, fieldtrip looks into 'labelcmb' to interpret which channels have been used to compute coherence. If you put labelcmb on the place of label (which you did in prepare_timefreq_data), but it's a dangerous solution, because 'labelcmb' contains two columns and I guess the fieldtrip-function which checks the labels only looks in the first column. This potentially leads to double occurrences of some labels (for example if for one reason or another your 'reference' channel is in the first column, or if you have more than one reference channel). Therefore, I'd suggest to 'convert' the labelcmb into uniquely identifiable labels, by for example concatenating the two labels in the pair: Newlabel = cell(size(freq.labelcmb,1),1); for j = 1:size(freq.labelcmb,1) Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; end freq.labelold = freq.label; freq.label = newlabel; Hope this helps, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Thursday, April 19, 2007 9:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem partially solved Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From andrew.smart at NYU.EDU Fri Apr 20 19:38:50 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 20 Apr 2007 13:38:50 -0400 Subject: problem partially solved In-Reply-To: <001601c78340$c0610d80$902dae83@fcdonders.nl> Message-ID: Hi Jan, Thank you for tip. I agree that it's not good to hack fieldtrip this way, and I would want to find another work around. Thanks for the code too! I was wondering though I bring the *.tfc files from BESA into Fieldtrip for example: for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end This gives me a 1x10 cell arry with structures for each subject with the following fields: time <1x41> freq <1x24> labelcmb <4x2> cohspctrm <4x24x41> dimord 'chan_freq_time' cfg <1x1> Now with your code: Newlabel = cell(size(Prepgram{i}.labelcmb,1),1); for j = 1:size(Prepgram{i}.labelcmb,1) Newlabel{j} = [Prepgram{i}.labelcmb{j,1},'_',Prepgram{i}.labelcmb{j,2}]; end freq.labelold = freq.label; Prepgram{i}.label = Newlabel; However this doesn't seem to create a label field in the structure associated to each subject. Am I missing something? In our script we would like to test the coherence in one condition between one dipole and the other dipoles in the model, to see if there is significant coherence when taking all the subjects together. Or does this make sense? If there is significant coherence for each subject, does it make sense to look at this on a group level? thanks! andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Friday, April 20, 2007 7:41 am Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > It seems as if you already solved the problem for your purpose. Anyway, > instead of making a hack in one of the (deep) fieldtrip functions, I would > rather change the frequency structure a bit before passing it to > freqstatistics. Typically what I do, is the following. Please note > that this > workaround is ugly, but at present that's a way how it works. > > In order to keep track of how to interpret the different channels in the > data, fieldtrip uses the field 'label', for which it assumes that the > number > of labels is equal to the first dimension (when 'dimord' = > 'chan_freq...etc'), or to the second dimension (when 'dimord' = > 'rpt_chan_etc') of your parameter of interest. However, when you are indeed > interested in coherence, it's the field 'cohspctrm' which is the relevant > field, and for this, fieldtrip looks into 'labelcmb' to interpret which > channels have been used to compute coherence. If you put labelcmb on the > place of label (which you did in prepare_timefreq_data), but it's a > dangerous solution, because 'labelcmb' contains two columns and I > guess the > fieldtrip-function which checks the labels only looks in the first column. > This potentially leads to double occurrences of some labels (for > example if > for one reason or another your 'reference' channel is in the first column, > or if you have more than one reference channel). Therefore, I'd > suggest to > 'convert' the labelcmb into uniquely identifiable labels, by for example > concatenating the two labels in the pair: > > Newlabel = cell(size(freq.labelcmb,1),1); > for j = 1:size(freq.labelcmb,1) > Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; > end > freq.labelold = freq.label; > freq.label = newlabel; > > Hope this helps, > > Jan-Mathijs > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Andrew Smart > Sent: Thursday, April 19, 2007 9:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem partially solved > > Hi Jan, > Thanks for the answer, everything works now ok. > > I did follow this FIXME in freqstatistics > > % FIXME in the hase of coherence, the code above does not work since "label" > is then incorrect. > % marbas reported the following > % als ik freqstatistics gebruik om coherence data te analyseren met > % cfg.parameter = coherence, dan wordt het powspctrm vervangen door > % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als > % er 1 referentiekanaal in zit), waardoor de informatie uit data.label > % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval > % van cfg.parameter = coherence, moeten worden vervangen door > % data.labelcmb(:,2), dan werkt het wel. > > And I changed prepare_timefreq_data > > output.label = input.label: > > to > > output.label = input.labelcmb; > > Otherwise fieldtrip crashes because the structure of the coherence > data does > not have a label field, but a labelcmb with the coherence between channels > and the ref channel. > > Is there a way to get fieldtrip to accomodate coherence structures? > > andy > > ----- Original Message ----- > From: Jan Mathijs Schoffelen > Date: Thursday, April 19, 2007 3:22 pm > Subject: Re: [FIELDTRIP] problem partially solved > To: FIELDTRIP at NIC.SURFNET.NL > > > > Dear Andy, > > > > Please allow me to point you to the fact that fieldtrip has no > > restriction on the type of data you want to cohere. The rather > mundane > > reason why the tutorial documentation on coherence is about > > cortico-muscular stuff, is related to the fact that the > interpretation > > of cortico-muscular coherence is far more straightforward than the > > interpretation of coherence between EEG/MEG-channels, or between > > virtual electrodes/dipoles. However, the statistical routines don't > > > care whether the coherence spectra you pass to them are between > > similar channels, or between dipole locations in the brain. > > > > Yours, > > > > Jan-Mathijs > > > > ----- Original Message ----- > > From: Andrew Smart > > Date: Thursday, April 19, 2007 5:43 pm > > Subject: [FIELDTRIP] problem partially solved > > > > > Hi, > > > I found why I was getting the error > > > embarrassingly I had {i} instead of {:}! > > > > > > My general question remains about the possibility of doing > > > statistical group > > > analysis on coherence between BESA dipoles, or in source space in > > > > general. > > > It seems most of the coherence analyses are set up to do coherence > > > > betweenchannels and an external reference such as EMG. > > > > > > Thanks and sorry for all the messages! > > > > > > andy From Myles.Reilly at HSC.UTAH.EDU Fri Apr 20 21:59:07 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Fri, 20 Apr 2007 13:59:07 -0600 Subject: Neuromag event values In-Reply-To: A<4626910A.9020503@neuro.hut.fi> Message-ID: First thanks to all who have replied, I am very impressed with the support on this group. Lauri: I'll be looking into your suggestions and if you can send the utility in I would appreciate it. A research group here will be looking at raw data from Grandfather Vectorview and I'll pass this all on to them. Moi, Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lauri Parkkonen Sent: Wednesday, April 18, 2007 3:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From CRosenau at WEB.DE Tue Apr 24 14:22:01 2007 From: CRosenau at WEB.DE (Christian Rosenau) Date: Tue, 24 Apr 2007 14:22:01 +0200 Subject: loreta2fieldtrip output Message-ID: Hello all, I have a Problem with the loreta2fieldtrip function. I want to plot the solution of sLoreta-Key on the colin mri from the MNI (analyze format). I want to use the sourceplot function of fieldtrip for doing this. I think I have to run sourceinterpolate first on the mri and source data. I read the .img data with read_fcdc_mri, and the source data with loreta2fieldtrip this is the struct which is created by loreta2fieldtrip dim: [37 44 36] xgrid: [1x29 double] ygrid: [1x34 double] zgrid: [1x24 double] transform: [4x4 double] inside: [6239x1 double] outside: [52369x1 double] avg: [1x1 struct] cfg: [1x1 struct] this is the script I use for interpolating %Interpolate sources and mri to the same grid sinterp_cfg.interpmethod='nearest'; sinterp_cfg.sourceunits='mm'; interp=sourceinterpolate(sinterp_cfg,source,mri); sourceplot(sourcepl_cfg,interp); and this is the error message ??? Error using ==> fieldtrip-20070402\private\grid2transform dimensions do not correspond Error in ==> fieldtrip-20070402\private\fixvolume at 22 volume = grid2transform(volume); Error in ==> sourceinterpolate at 166 functional = fixvolume(functional); Error in ==> sourceplotscript at 14 interp=sourceinterpolate(sinterp_cfg,source,mri); I think it has something to do with the different dimensions of the grid variables and the dim field in the source struct, but how can I fix this? Greetings Christian Rosenau From r.oostenveld at FCDONDERS.RU.NL Tue Apr 24 22:26:56 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 24 Apr 2007 22:26:56 +0200 Subject: EGI layout In-Reply-To: <01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: On 18 Apr 2007, at 14:36, Olga Sysoeva wrote: > Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Dear Olga, You can download *.sfp files from ftp://ftp.egi.com/pub/software/ besa. These contain the labels and xyz positions of all electrodes, and you can read them into matlab with READ_FCDC_ELEC. Using the function PRERARE_LAYOUT, you can make a 2D flat layout from them for use with topoplotting and multiplotting. Something like this should wourk (assuming that you have a recent copy of fieldtrip, since this was only added a few weeks ago) cfg = []; cfg.elecfile = 'GNS128.sfp'; mylay = prepare_layout(cfg); and then use cfg = [] cfg = ... % related to the topoplot or multiplot cfg.layout = mylay in your calls to topoplotXX and multiplotXX. hope this helps, Robert From rongf at NIDCD.NIH.GOV Wed Apr 25 18:02:01 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Wed, 25 Apr 2007 12:02:01 -0400 Subject: dics method for coherence analysis In-Reply-To: A<01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: Dear all, I have a question regarding the comparison of coherence between virtual channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},eoidata.label); eoifreq = freqanalysis(cfg,eoidata); clear eoidata load(datafile,'ldf'); cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); In which bldata and eoidata are from the same dataset epoched with two windows, ldf is the grid which has been computed based on the same dataset. The purpose of this analysis is to compare the coherence between the selected seed channel and other virtual channels within alpha band between the two time windows. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Best, Feng _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 26 00:35:22 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 26 Apr 2007 00:35:22 +0200 Subject: source coherence in one condition Message-ID: Hi, I would like to try to compute whether there is significant coherence across subjects but within one condition and between two dipoles. This code generates graphs but I am unclear about what they mean: for i = 1 : length(the_sources) %this is coherence between pairs of BESA %dipoles, imported *.tfc files cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; %I would like to test coherence between % this dipole and the other dipoles in the % BESA model on a group level cfg.channel = the_sources{i}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.statistic = 'indepsamplesregrT' ; %only stat test that works cfg.correctm = 'max'; cfg.numrandomization = 500; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 %is this correct? 1 1 1 1 1 1 1 1 1 1 ] ; %i have 10 subjects cfg.uvar = 1; %one condition cfg.ivar = 1; cfg.wvar = 1; Prepstat = freqstatistics(cfg, Prepgram{:}); cfg = []; cfg.xparam = 'time'; cfg.yparam = 'freq'; cfg.zparam = 'stat'; %what are the values in this field? cfg.zlim = 'absmax'; figure; singleplotTFR(cfg,Prepstat(:)); title([the_sources{i} '_coherence']); colormap jet end Do you have any suggestions for improving this and making the results more interpretable? (what do the results mean?) Are there other available statistical tests in Fieldtrip, for example is 'indepsamplesZcoh' implemented? Thanks, 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From d.stoffers at VUMC.NL Thu Apr 26 14:08:09 2007 From: d.stoffers at VUMC.NL (Diederick Stoffers) Date: Thu, 26 Apr 2007 14:08:09 +0200 Subject: definetrial Message-ID: Dear all, As a relative newbie to fieldtrip, just followed the 3.5 day course, I am having trouble performing trial definition. Experiment: Simple Eriksen flanker task in CTF 151-channel MEG environment, 80 patients and 20 controls Trials: 80 congruent and 80 incongruent Trial definition: 1s prestimulus and 1.2 second poststimulus (-1.0 to 2.2s) Trial contains stimulus marker and marker for trialtype at t=0, no triggers The CTF dataset has been modified and now contains 160 trials with a length of 3.2 seconds and two markers (stimulus onset and trialtype) at 1 second into the trial as well as a marker for artefacts. Could anyone please advice what to include in mytrialfun.m ? Is it only possible to use triggers (in that case I will have to convert markers to triggers) or can I also use the information in MarkerFile.mrk? I have attached a trialfun.m file which holds some of the information. Cheers, Diederick Stoffers. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From Jan.Schoffelen at FCDONDERS.RU.NL Sat Apr 28 18:32:12 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Sat, 28 Apr 2007 18:32:12 +0200 Subject: dics method for coherence analysis In-Reply-To: <52C93A9A6058924E92A69CDF43966F1B01C9A40E@NIHCESMLBX8.nih.gov> Message-ID: Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rongf at NIDCD.NIH.GOV Mon Apr 30 18:47:16 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Mon, 30 Apr 2007 12:47:16 -0400 Subject: dics method for coherence analysis In-Reply-To: A<007901c789b2$c678d4a0$902dae83@fcdonders.nl> Message-ID: Jan-Mathijs, Thanks for the comprehensive feedback. It is really helpful. I have downloaded the new version and will try. As you have predicted, this procedure is time-consuming. May I know what can I do to revise the script so that I can save some time? Best, Feng -----Original Message----- From: Jan Mathijs Schoffelen [mailto:Jan.Schoffelen at FCDONDERS.RU.NL] Sent: Saturday, April 28, 2007 11:32 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] dics method for coherence analysis Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Mon Apr 2 20:06:47 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 2 Apr 2007 14:06:47 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070329124424.01cda650@email.med.yale.edu> Message-ID: After re-running the sourceanalysis and sourceinterpolate, I seem to get a better looking plot using cfg.funparameter = 'pow', but when I use cfg.funparameter = 'nai', I get this error message: >> sliceinterp(cfg, sourceInterp) ??? Error using ==> sliceinterp at 175 no functional data supplied I did not get this before, and the only thing that I have changed is the specification of the units, as listed below in the previous e-mail. Has anyone else seen this error or have ideas about a fix? thanks, Brian At 12:44 PM 3/30/2007, you wrote: >Thanks for these replies. I have now specified > >cfg.mriunits = 'mm' >cfg.sourceunits = 'mm' > >Then, I should re-run sourceinterpolate.m? That seems to produce the new >results, but the same new results whether I specify both units as 'cm' or >'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you >supposed to use? > > >thanks, >Brian >At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >>On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>>a very likely cause is the incorrect specification of cfg.mriunits, >>>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>>find back in the code you sent in your mail that you actually >>>called it, but I assume you did). If not specified, fieldtrip puts >>>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>>discrepancy in your data there. Perhaps you even explicitly have to >>>check, whether your headmodel (in hdmfile) is defined in cm. At >>>least the dipole-grid on which sourceanalysis performs the >>>beamformer-scanning is defined in cm, and I guess the units should >>>be identical here as well. >> >>The standard BEM EEG volume conduction model that you might have >>copied from EEGLAB is one that is based on the MNI template brain. It >>is in MNI coordinates (linked to the AC and PC) and the units are in >>mm (corresponding with SPM standards). >> >>Robert > From ychen at BME.UFL.EDU Mon Apr 2 22:33:25 2007 From: ychen at BME.UFL.EDU (Chen) Date: Mon, 2 Apr 2007 22:33:25 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Hello, I am trying to generate a BEM headmodel using volumesegment.m for t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following error message: - SPM2: spm_vol ------------------------------------------------- Error reading information on: ..ome/common/matlab/spm2/templates/T1.mnc Please check that it is in the correct format. ----------------------------------------- 16:11:50 - 02/04/2007 ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> BEM_headmodel at 20 seg = volumesegment(cfg, temp_mri); Thanks anybody who can help me on this issue. Chen From sameer at ANDREW.CMU.EDU Mon Apr 2 22:47:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:47:22 -0400 Subject: SPM2 related error message when doing volumesegment In-Reply-To: Message-ID: Hi Chen, unless you define cfg.template = 'full path to T1.mnc file'; spm2 will look for T1.mnc in a predesignated directory and give that error. sameer On Mon, 2 Apr 2007, Chen wrote: > Hello, > > I am trying to generate a BEM headmodel using volumesegment.m for > t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following > error message: > > - SPM2: spm_vol ------------------------------------------------- > > Error reading information on: > ..ome/common/matlab/spm2/templates/T1.mnc > > Please check that it is in the correct format. > > ----------------------------------------- 16:11:50 - 02/04/2007 > > ??? Error using ==> spm_vol>subfunc1 > Can't get volume information > for '/home/common/matlab/spm2/templates/T1.mnc' > > Error in ==> spm_vol>subfunc2 at 51 > V = subfunc1(P); > > Error in ==> spm_vol at 37 > V = subfunc2(P); > > Error in ==> spm_segment>get_affine_mapping at 226 > if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; > > 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 235 > spm_segment(Va,cfg.template,flags); > > Error in ==> BEM_headmodel at 20 > seg = volumesegment(cfg, temp_mri); > > Thanks anybody who can help me on this issue. > > Chen > > From sameer at ANDREW.CMU.EDU Mon Apr 2 22:48:11 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:48:11 -0400 Subject: definetrial crashes matlab Message-ID: Hi, I am having an instance of matlab crashing when I try to run definetrial. The error message I get on my ssh client is [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! No such file or directory terminate called after throwing an instance of 'MathWorks::System::_utException' [1] Abort matlab the file clearly exists. [sameer at master SA]$ ls SA_040207_One.fif STI101.mat and the following command works. [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); I get the error message when I use cfgLL = [] ; cfgLL.dataset = 'SA_040207_One.fif' ; cfgLL.headerfile = 'SA_040207_One.fif' ; cfgLL.datatype = 'continuous' ; cfgLL.trialdef.eventtype = 'STI101' ; cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; cfgLL.trialdef.poststim = .500; cfgLL = definetrial(cfgLL); If I use a different data file instead of the one mentioned above (after changing to corresponding directory), the setup shown above works, and has consistently worked in the past. How could i troubleshoot it? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Mon Apr 2 23:07:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 17:07:34 -0400 Subject: choosing time windows in freqanalysis_mtmfft. Message-ID: Hello, I want to be able to see the coherences between different channels (using topoplotER). To that end, I know that I must implement freqdescriptives after first implementing freqanalysis_mtmfft. freqanalysis_mtmfft does not seem to allow me to choose the time window from which the data can be selected and then analyzed (I think so primarily because it does not seem to allow cfg.toilim or some such method). Is there a simple way around it that I am missing, or will I have to define new datasets with the data form the time window I want each time? thanks, sameer From c.hesse at FCDONDERS.RU.NL Tue Apr 3 09:23:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 3 Apr 2007 09:23:57 +0200 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Sameer, does the file you're trying to read have the gradiometer and magnetometer information actually in it? This seems very similar to (some of the) errors that Matt was reporting previously. Regards, Christian > I am having an instance of matlab crashing when I try to run > definetrial. The error message I get on my ssh client is > > [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! > No such file or directory > terminate called after throwing an instance of > 'MathWorks::System::_utException' > > [1] Abort matlab > > > the file clearly exists. > [sameer at master SA]$ ls > SA_040207_One.fif STI101.mat > > > and the following command works. > [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); > > I get the error message when I use > > cfgLL = [] ; > cfgLL.dataset = 'SA_040207_One.fif' ; > cfgLL.headerfile = 'SA_040207_One.fif' ; > cfgLL.datatype = 'continuous' ; > cfgLL.trialdef.eventtype = 'STI101' ; > cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; > cfgLL.trialdef.poststim = .500; > > cfgLL = definetrial(cfgLL); > > If I use a different data file instead of the one mentioned above > (after changing to corresponding directory), the setup shown above > works, and has consistently worked in the past. > > How could i troubleshoot it? > > thanks for your time. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Wed Apr 4 15:59:21 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 4 Apr 2007 09:59:21 -0400 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Christian, yes it does have the gradiometer and magnetometer information in it. I could extract the inf0 using fiffaccess. >> ls SA_040207_One.fif STI101.mat >> processContinousRawdata('SA_040207_One') >> ls channames.mat SA_040207_One.fif SA_040207_One.mat STI101.mat >> load SA_040207_One.mat size(C) ans = 312 250000 Thus I have all 306 MEG channels, plus eog and ekg plus the 3 stim channels. processContinousRawdata is essentially (from fiffaccess) status = 'ok'; rawdata('any',fileraw); C = []; while strcmp(status,'ok') [B, status] = rawdata('next'); %process_data(B) ; C = [C B] ; % As this is just one continous recording end filename = strcat(trial,'.mat'); save(filename,'C','-mat') rawdata('close'); thanks, sameer On Tue, 3 Apr 2007, Christian Hesse wrote: > Hi Sameer, > > does the file you're trying to read have the gradiometer and magnetometer > information actually in it? This seems very similar to (some of the) errors > that Matt was reporting previously. > > Regards, > Christian > > >> I am having an instance of matlab crashing when I try to run definetrial. >> The error message I get on my ssh client is >> >> [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! >> No such file or directory >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> [1] Abort matlab >> >> >> the file clearly exists. >> [sameer at master SA]$ ls >> SA_040207_One.fif STI101.mat >> >> >> and the following command works. >> [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); >> >> I get the error message when I use >> >> cfgLL = [] ; >> cfgLL.dataset = 'SA_040207_One.fif' ; >> cfgLL.headerfile = 'SA_040207_One.fif' ; >> cfgLL.datatype = 'continuous' ; >> cfgLL.trialdef.eventtype = 'STI101' ; >> cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; >> cfgLL.trialdef.poststim = .500; >> >> cfgLL = definetrial(cfgLL); >> >> If I use a different data file instead of the one mentioned above (after >> changing to corresponding directory), the setup shown above works, and has >> consistently worked in the past. >> >> How could i troubleshoot it? >> >> thanks for your time. >> >> best, >> sameer >> > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > From maris at NICI.RU.NL Thu Apr 5 14:57:31 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 5 Apr 2007 14:57:31 +0200 Subject: [SPAM]Re: [FIELDTRIP] timelockstatistics In-Reply-To: Message-ID: Hi Harald, Within 2 weeks, there will be a statistics tutorial on the Fieldtrip homepage that deals with timelock and freqstatistics. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Yes you can. Kind regards, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 5 17:34:48 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 5 Apr 2007 17:34:48 +0200 Subject: maximum statistic correction for mulitple comparisons Message-ID: when using the maximum statistic correction for multiple comparisons what are the values on the colorbar and in the image? are they the corrected p-values? also, i cannot find the cfg.correctm documented anywhere, on the index or in the scripts. is there a documentation for this? thanks! andy From sameer at ANDREW.CMU.EDU Sat Apr 7 22:42:33 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 16:42:33 -0400 Subject: covariance in timelockanalysis Message-ID: Hello, I use the following command to run timelockanalysis to get both averages and covariance. cfgTLA = []; cfgTLA.covariance = 'yes' ; cfgTLA.covariancewindow = [.100 .300]; cov_avg = timelockanalysis(cfgTLA,data) ; (Data actually runs from [-.499 2.0] This returns avg: [308x2500 double] var: [308x2500 double] fsample: 1000 numsamples: [29x1 double] time: [1x2500 double] dofvec: [1x2500 double] label: {308x1 cell} dimord: 'chan_time' cov: [308x308 double] numcovsamples: [29x1 double] grad: [1x1 struct] cfg: [1x1 struct] however, cov_avg.cov is essentially all zeros. Is there something I am missing here? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Sat Apr 7 23:03:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 17:03:19 -0400 Subject: troubleshooting topoplotER Message-ID: Hello, While using topoplotER using, cfgTLA = []; cfgTLA.xlim = [0 .3] ; cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/DataNeuroMagCondor2/Analysis/NM306grad.lay'; figure topoplotER(cfgTLA,avgLL_1_One) I get the following error. ??? Undefined function or variable "pnt". Error in ==> createlayout at 209 pnt = pnt(ind,:); To troubleshoot, on line 198, sel is empty matrix. So Line 205 pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); does not get executed. So I changed ch1 = sprintf('MEG %03d1', i); ch2 = sprintf('MEG %03d2', i); ch3 = sprintf('MEG %03d3', i); to ch1 = sprintf('MEG%03d1', i); ch2 = sprintf('MEG%03d2', i); ch3 = sprintf('MEG%03d3', i); ANow things both work and seem sensible. I just wanted to both bring it to your attention and make sure that it is indeed an o.k fix. Best, sameer From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:24:26 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:24:26 +0200 Subject: covariance in timelockanalysis In-Reply-To: Message-ID: Hi Sameer, > I use the following command to run timelockanalysis to get both > averages and covariance. > > cfgTLA = []; > cfgTLA.covariance = 'yes' ; > cfgTLA.covariancewindow = [.100 .300]; > cov_avg = timelockanalysis(cfgTLA,data) ; > > (Data actually runs from [-.499 2.0] > > This returns > > avg: [308x2500 double] > var: [308x2500 double] > fsample: 1000 > numsamples: [29x1 double] > time: [1x2500 double] > dofvec: [1x2500 double] > label: {308x1 cell} > dimord: 'chan_time' > cov: [308x308 double] > numcovsamples: [29x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? the scaling in the covariance matrix depends on the scaling of your signals - if you have the data in units of Tesla (as opposed to femto) then of course the covariances are going to be very small. This can cause some covariance based analysis methods to "think" that your data is rank deficient, etc ... In any event you can try this and see which message you get: if (length(cov_avg.label) == rank(cov_avg.cov)) disp('everything is fine'); else disp('you have a problem'); end If you get the second one you may want to try rescaling your data to femto Tesla first, that way you get "better behaved" covariance values. Hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:30:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:30:06 +0200 Subject: troubleshooting topoplotER In-Reply-To: Message-ID: Hi Sameer, given that the error you report involves a call to the function CREATELAYOUT it seems that you are using a relatively old version of Fieldtrip. There were some changes made in early March to how layouts are handled using a new function PREPARE_LAYOUT. I recommend that you download the latest version of FT - if this error persists, please let me know. Also, it is worth periodically checking the "recent changes" section of the FT website to see if there are any updates that are relevant to you. Regards, Christian On 7 Apr 2007, at 23:03, Sameer Walawalkar wrote: > Hello, > > While using topoplotER using, > > cfgTLA = []; > cfgTLA.xlim = [0 .3] ; > cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/ > DataNeuroMagCondor2/Analysis/NM306grad.lay'; > > figure > topoplotER(cfgTLA,avgLL_1_One) > > I get the following error. > ??? Undefined function or variable "pnt". > > Error in ==> createlayout at 209 > pnt = pnt(ind,:); > > > > To troubleshoot, on line 198, sel is empty matrix. So Line 205 > > pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); > > does not get executed. > > So I changed > ch1 = sprintf('MEG %03d1', i); > ch2 = sprintf('MEG %03d2', i); > ch3 = sprintf('MEG %03d3', i); > > to > ch1 = sprintf('MEG%03d1', i); > ch2 = sprintf('MEG%03d2', i); > ch3 = sprintf('MEG%03d3', i); > > ANow things both work and seem sensible. I just wanted to both > bring it to your attention and make sure that it is indeed an o.k fix. > > Best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:45:51 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:45:51 +0200 Subject: choosing time windows in freqanalysis_mtmfft. In-Reply-To: Message-ID: Hi Sameer, yes, not being able to specify a time window is a "feature" of FREQANALYSIS_MTMFFT that is somewhat misleading and counter intuitive. The easy way around it is to use FREQANALYSIS_MTMCONVOL with appropriate window selection parameters: cfg.toi = [the centre of the time window you want to analyse]; cfg.foi = [the frequencies of interest]; cfg.t_ftimwin = ones(length(cfg.foi),1).*duration of the window you want to analyse; Hope this helps, Christian On 2 Apr 2007, at 23:07, Sameer Walawalkar wrote: > Hello, > > I want to be able to see the coherences between different channels > (using topoplotER). To that end, I know that I must implement > freqdescriptives after first implementing freqanalysis_mtmfft. > > freqanalysis_mtmfft does not seem to allow me to choose the time > window from which the data can be selected and then analyzed (I > think so primarily because it does not seem to allow cfg.toilim or > some such method). > > Is there a simple way around it that I am missing, or will I have > to define new datasets with the data form the time window I want > each time? > > thanks, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:10:01 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:10:01 +0200 Subject: sensortype In-Reply-To: <929188.13557.qm@web56612.mail.re3.yahoo.com> Message-ID: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian On 30 Mar 2007, at 09:21, alotof eve wrote: > Sorry for sending so many emails. The error for combine channel is > due to sensortype.m cannot get my neuromag data type. I checked the > length(grad.label). It's 612, double of 306 which is supposed. How > can I settle it? > Thanks in advance. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 20:48:06 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis, combine channel > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > I checked the script of freqanalysis_wltconvol and founf the > default for output was 'powandcsd'. This output needs combine > channels. My meuromag data seems has problem on something related > "combine channels". > It works when I change output as 'pow'. However, I wonder what > might happen when using combining channels? I suppose it relates > layout? > Thanks for suggestion. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 04:59:42 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > Could you give me ome suggestion for wavelet analysis? These > parameters are OK in EEG data I count using ohter software. I don't > think it's different for MEG data but the error happened... > > >> cfg=[]; > >> cfg.sgn='MEG'; > >> cfg.method='wltconvol'; > >> cfg.width=3; > >> cfg.foi=4:1:30; > >> cfg.toi=-0.4:0.05:1.4; > >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); > ??? Error using ==> zeros > Out of memory. Type HELP MEMORY for your options. > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328 > \freqanalysis_wltconvol.m > On line 234 ==> if csdflg, crsspctrm = complex(zeros > (numsgncmb,numfoi,numtoi)); end > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m > On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower > (cfg.method)), cfg, data); > Any suggestions are appreciated. > > Best, > Eve > Sucker-punch spam with award-winning protection. > Try the free Yahoo! Mail Beta. > > 8:00? 8:25? 8:40? Find a flick in no time > with theYahoo! Search movie showtime shortcut. > > > Now that's room service! Choose from over 150,000 hotels > in 45,000 destinations on Yahoo! Travel to find your fit. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:23:20 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:23:20 +0200 Subject: Field Trip and MNE Localization In-Reply-To: <4602B269.9010106@nmr.mgh.harvard.edu> Message-ID: Hi Rob, Fieldtrip (FT) is very good at source analysis in both time and frequency domains and can supports neuromag MEG data so you should be able to do everything you need using FT. Moreover, there is powerful functionality for statistical analysis at the sensor and source levels. All the relevant documentation and example script for MEG data should be applicable to your MEG data. Hope this helps, Christian On 22 Mar 2007, at 17:44, Robert Levy wrote: > Hello, > > I just discovered Fieldtrip, and it seems like a very powerful tool > for spectral analysis of MEG data. Our lab uses Matti Hamalainen's > Neuromag MNE tools to localize ERMF generator sources. A spectral > analysis feature is in development for these tools, but at present > it can be done using Matlab either from scratch or potentially it > seems with the help Fieldtrip. So as not to attempt reinventing > the wheel I was wondering if anyone here has used Fieldtrip in > conjunction with the Neuromag tools to both localize MEG data and > analyze it spectrally. If anyone has done this already I would > appreciate any suggestions, pointers or references to papers. > > Thanks, > Rob > > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Sun Apr 8 16:59:34 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 8 Apr 2007 07:59:34 -0700 Subject: sensortype In-Reply-To: Message-ID: Dear Christian, Thanks. But could you tell me the way that keep only magnetometers or gradiometers in my data structure? I know that's ture both of them in my data structure at the same time. I really feel confused by this. Thanks. Best, Eve Christian Hesse wrote: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abastos at BERKELEY.EDU Mon Apr 9 06:11:53 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Sun, 8 Apr 2007 21:11:53 -0700 Subject: issues with clusterrandanalysis In-Reply-To: Message-ID: Dear Fieldtrippers, I am beginning to use the clusterrandanalysis function, but have not been finding any significant clusters in my EEG data. I changed alpha and alphathresh to be 0.5, but this still didn't produce any results (posclusters and negclusters are both empty). To test whether the config settings were actually working, I generated some random time frequency data using the following commands: s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time steps) rpow = rand(s); (produces pseudorandom nums between 0 and 1) TFR.powspctrm = rpow; I reran clusterrandanalysis with this new TFR, but still got no clusters. This puzzles me, because a random series of numbers should be statistically different from physiologically produced spectral data. I used the basic config settings found in the tutorial, which were: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = 'all'; [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Any ideas what I am doing wrong? Thanks, Andre From maris at NICI.RU.NL Mon Apr 9 12:11:07 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 9 Apr 2007 12:11:07 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <000d01c77a5d$35dcd2c0$a1967840$@edu> Message-ID: Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From sameer at ANDREW.CMU.EDU Mon Apr 9 23:53:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 9 Apr 2007 17:53:34 -0400 Subject: checkdata error Message-ID: Hello, I downloaded the latest fieldtrip-20070409.zip. Since then I have been getting the following problem ??? Undefined command/function 'checkdata'. Error in ==> freqanalysis at 136 data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, 'feedback', 'yes'); in various applications which used to run just fine previously. best, sameer From abastos at BERKELEY.EDU Tue Apr 10 07:30:07 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Mon, 9 Apr 2007 22:30:07 -0700 Subject: issues with clusterrandanalysis In-Reply-To: <000f01c77a8f$643e3960$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Using the cfg: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = TFR(1).elec.label(1:64); cfg.latency = [-3.5 -1.5]; cfg.elec = TFR(1).elec; cfg.neighbourdist = 4; The Matlab printout is: Selecting and formatting the data. selected 64 channels selected 41 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). After it calculates the randomization, I get a further error when the plot function is called (Again using the same settings as the tutorial): reverting to 151 channel CTF default ??? Error using ==> topoplotER labels in data and labels in layout do not match Error in ==> topoplotER at 210 topoplotER(cfg, data); As you said, it doesn't look like the neighborhood structure is being created properly. I was not able to generate it successfully using the following settings: cfg.neighbourdist = 4 cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) neighbours = neighbourselection(cfg, ALLDATA1(1).label) Neighbors becomes a series of 64 structures, but each structure's neighblabel field is empty. Perhaps this is also what happens when the script tries to generate the neighbourhood structure. Thanks for your help, Andre -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Eric Maris Sent: Monday, April 09, 2007 3:11 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] issues with clusterrandanalysis Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From maris at NICI.RU.NL Tue Apr 10 10:59:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 10 Apr 2007 10:59:10 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <004401c77b31$503c46d0$f0b4d470$@edu> Message-ID: Dear Andre, > As you said, it doesn't look like the neighborhood structure is being > created properly. I was not able to generate it successfully using the > following settings: > cfg.neighbourdist = 4 > cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) > neighbours = neighbourselection(cfg, ALLDATA1(1).label) > > Neighbors becomes a series of 64 structures, but each structure's > neighblabel field is empty. Perhaps this is also what happens when the > script tries to generate the neighbourhood structure. 1. Are the labels is elec.label and ALLDATA1(1).label identical? 2. Are the electrode positions in elec.pnt expressed on the proper scale (i.e., such that cfg.neighbourdist makes sense)? If these checks don't help, send me you one of your data structures (maris at nici.ru.nl). Good luck, Eric > > Thanks for your help, > > Andre > > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Eric Maris > Sent: Monday, April 09, 2007 3:11 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] issues with clusterrandanalysis > > Dear Andre, > > > > > I am beginning to use the clusterrandanalysis function, but have not been > > finding any significant clusters in my EEG data. I changed alpha and > > alphathresh to be 0.5, but this still didn't produce any results > > (posclusters and negclusters are both empty). To test whether the config > > settings were actually working, I generated some random time frequency > data > > using the following commands: > > > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 > time > > steps) > > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > > TFR.powspctrm = rpow; > > > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > > This puzzles me, because a random series of numbers should be > statistically > > different from physiologically produced spectral data. > > > My first guess is that there is something wrong with your neighborhood > structure. Can you send me a copy of the screen output (only the part before > the counting of the randomizations)? > > When using MEG-data coming from a CTF system, this neighborhood structure > is calculated automatically. However, I guess you are using a different > sensor configuration. In that case, you have to supply this information to > clusterrandanalysis. You can find more information about this in the online > help of clusterrandanalysis. > > > Kind regards, > > Eric > > > > > > > I used the basic config settings found in the tutorial, which were: > > > > cfg.statistic = 'indepsamplesT'; > > cfg.alphathresh = 0.5; > > cfg.makeclusters = 'yes'; > > cfg.minnbchan = 2; > > cfg.clusterteststat = 'maxsum'; > > cfg.onetwo = 'twosided'; > > cfg.alpha = 0.5; > > cfg.nranddraws = 100; > > cfg.channel = 'all'; > > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > > > Any ideas what I am doing wrong? From c.hesse at FCDONDERS.RU.NL Tue Apr 10 11:26:30 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 10 Apr 2007 11:26:30 +0200 Subject: checkdata error In-Reply-To: Message-ID: Hi Sameer, we checked and the function CHECKDATA is definitely in the latest version of FT. You might want to make sure that your Matlab path has been updated, and that Matlab is aware of the presence of the new function. If in doubt, restart Matlab and let us know if the error persists. Regards, Christian On 9 Apr 2007, at 23:53, Sameer Walawalkar wrote: > Hello, > > I downloaded the latest fieldtrip-20070409.zip. > > Since then I have been getting the following problem > > ??? Undefined command/function 'checkdata'. > > Error in ==> freqanalysis at 136 > data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, > 'feedback', 'yes'); > > in various applications which used to run just fine previously. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 12:59:37 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 12:59:37 +0200 Subject: maximum statistic correction for mulitple comparisons In-Reply-To: Message-ID: Hi Andrew, On 5 Apr 2007, at 17:34, Andrew Smart wrote: > when using the maximum statistic correction for multiple > comparisons what > are the values on the colorbar and in the image? are they the > corrected > p-values? The values that you get in the field "stat.prob" when you do either one of stat = freqstatistics(cfg, freq) stat = timelockstatistics(cfg, timelock) stat = sourcestatistics(cfg, source) and with cfg.correctm=yes are indeed corrected p-values. The functions will also print the following on your screen "using a maximum-statistic based method for multiple comparison correction" "the returned probabilities and the thresholded mask are corrected for multiple comparisons" > also, i cannot find the cfg.correctm documented anywhere, on the > index or in > the scripts. is there a documentation for this? There is no more documentation on them than this single line in statistics_montecarlo % cfg.correctm = apply multiple-comparison correction, 'no', 'max', cluster', 'bonferoni', 'holms', 'fdr' (default = 'no') Someone here in Nijmegen is currently rewriting the randomization statistics tutorial, I will ask him whether he can add some information on these options. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:04:32 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:04:32 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070402140316.048e9b10@email.med.yale.edu> Message-ID: On 2 Apr 2007, at 20:06, Brian Roach wrote: > After re-running the sourceanalysis and sourceinterpolate, I seem > to get a better looking plot using cfg.funparameter = 'pow', but > when I use cfg.funparameter = 'nai', I get this error message: > > >> sliceinterp(cfg, sourceInterp) > ??? Error using ==> sliceinterp at 175 > no functional data supplied Hi Brian, Is the neural activity computed in your data? Please check whether you have besides the field source.avg.pow also the field source.avg.nai. Computing the neural activity index requires cfg.projectnoise=yes in sourceanalysis, and furthermore requires that you call sourcedescriptives after sourceanalysis. I suggest that you use the new sourceplot function instead of the old sliceinterp function. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:09:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:09:27 +0200 Subject: covariance in timelockanalysis In-Reply-To: <07891259-31FE-47E6-B5D1-2FA6354B862C@fcdonders.ru.nl> Message-ID: Hi Sameer, > cov: [308x308 double] ... > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? > > the scaling in the covariance matrix depends on the scaling of your > signals - if you have the data in units of Tesla (as opposed to > femto) then of course the covariances are going to be very small. > This can cause some covariance based analysis methods to "think" > that your data is rank deficient, etc ... Since you have 308 channels instead of 306, the units of the channels will be different since not all of your channels are apparently MEG channels. The covariance between two channels is in the units of the two channels, i.e. the EEG-MEG covariance is in units of V*T (Volts timese Tesla) or uV*fT or something similar. Robert From sameer at ANDREW.CMU.EDU Tue Apr 10 18:40:55 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 12:40:55 -0400 Subject: length of freq vector in freqanalysis Message-ID: Hello, I find that freqanalysis (cfg.method = mtmfft) generates two different .freq vectors (different lengths, but spanning the correct [min max] as indicated by cfg.foilim) for two different datasets passed with same cfg (but one dataset has more time points than the other). Plotting the power spectra of the two datasets simultaneously using singleplotER works just fine, but multiplotER shows one spectrum spanning smaller range than the other. Funnily, it is the frequency distribution with the larger .freq vector which is graphed smaller. Is there some way I can specify not only the frequency range but also the number of frequency points to be generated? The details are given below. 1> re: freqanalysis I use the same cfg structure (given below) to pass two datasets to freqanalysis. Yet the frequency vectors for each dataset has very different lengths. I wonder if the different time lengths of each set make a difference. cfg = []; cfg.ouput='powandcsd'; cfg.method='mtmfft'; cfg.keeptrials='no'; cfg.tapsmofrq=4; cfg.foilim =[30 90]; cfg.channel = 'MEG' ; cfg.channelcmb = {'MEG' 'MEG'}; pre1 = -.300 ; pre2 = -.100 ; post1 = .000 ; post2 = .500 ; (this line tells my defined function Breakdata to pass on only data between times 300msec to 100 msec before event and from event to 500 msec after. [data_pre, data_post] = Breakdata(data, pre1, pre2, post1, post2) freq_pre = freqanalysis(cfg,data_pre); freq_post = freqanalysis(cfg,data_post); fd_pre = freqdescriptives([], freq_pre) fd_post = freqdescriptives([], freq_post) In the above line Breakdata is a function I have written (I know I could use TFRs to do the same, but I had already written the function and have not yet had time to consider the other option). Now, my question is, >> size(freq_pre.freq) ans = 1 13 >> size(freq_post.freq) ans = 1 31 Why the difference? (they do however span the interval [30 90].). Needless to mention, fd_pre and fd_post are also effected. 2>re: multiplot. I use cfg = []; cfg.xparam = 'freq'; cfg.zparam = 'cohspctrm'; cfg.zlim = [0 1e-27]; cfg.channel = 'all'; cfg.cohrefchannel = 'MEG1833'; cfg.layout = 'NM306mag.lay'; multiplotER(cfg, fd_pre,fd_post) I would expect the plotting would not be affected as both datasets have their frequency vector noted for the x-axis. Yet, the graph of the first dataset is 1/3rd as long on the plot. How can I fix this? (Incidently, singleplotER works fine for the power spectrum ). Thanks for your help. Best, sameer From jan.schoffelen at FCDONDERS.RU.NL Tue Apr 10 20:58:41 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Tue, 10 Apr 2007 20:58:41 +0200 Subject: length of freq vector in freqanalysis Message-ID: Dear Sameer, Your questions are related to some fundamental aspects of fourier-analysis. In general: the length of your data determines the frequency-resolution of the powerspectrum calculated from it. For a good introduction on fourier-analysis you could have a look at www.dspguide.com. Regarding your question about multiplotER: apparently the function expects two data-structures with the same frequency-axis. This can be achieved with zero-padding. You can specify cfg.pad before calling freqanalysis (for a good introduction on zero-padding: see www.dspguide.com I think). If you take this cfg.pad equal for the freqanalysis on data_pre and data_post (it should be >= the longest trials you have, so in your specific case >= 0.5 (it is defined in seconds)), the frequency axes come out identical and I expect multiplotER to behave itself. By the way: cfg.tapsmofrq should be an integer multiple of the frequency-resolution of your data, i.e. an integer multiple of 1./(data-length [this includes the padding if you are comparing data with different length]) Yours, Jan-Mathijs ----- Original Message ----- From: Sameer Walawalkar Date: Tuesday, April 10, 2007 6:40 pm Subject: [FIELDTRIP] length of freq vector in freqanalysis > Hello, > > I find that freqanalysis (cfg.method = mtmfft) generates two > different > .freq vectors (different lengths, but spanning the correct [min > max] as > indicated by cfg.foilim) for two different datasets passed with > same cfg > (but one dataset has more time points than the other). > > Plotting the power spectra of the two datasets simultaneously using > singleplotER works just fine, but multiplotER shows one spectrum > spanning > smaller range than the other. Funnily, it is the frequency > distribution > with the larger .freq vector which is graphed smaller. > > Is there some way I can specify not only the frequency range but > also the > number of frequency points to be generated? > > The details are given below. > > 1> re: freqanalysis > I use the same cfg structure (given below) to pass two datasets to > freqanalysis. Yet the frequency vectors for each dataset has very > different lengths. I wonder if the different time lengths of each > set > make a difference. > > cfg = []; > cfg.ouput='powandcsd'; > cfg.method='mtmfft'; > cfg.keeptrials='no'; > cfg.tapsmofrq=4; > cfg.foilim =[30 90]; > cfg.channel = 'MEG' ; > cfg.channelcmb = {'MEG' 'MEG'}; > > > pre1 = -.300 ; > pre2 = -.100 ; > post1 = .000 ; > post2 = .500 ; > (this line tells my defined function Breakdata to pass on only data > between times 300msec to 100 msec before event and from event to > 500 msec > after. > > [data_pre, data_post] = Breakdata(data, pre1, pre2, > post1, post2) > freq_pre = freqanalysis(cfg,data_pre); > freq_post = freqanalysis(cfg,data_post); > > fd_pre = freqdescriptives([], freq_pre) > fd_post = freqdescriptives([], freq_post) > > In the above line Breakdata is a function I have written (I know I > could > use TFRs to do the same, but I had already written the function and > have > not yet had time to consider the other option). > > Now, my question is, > >> size(freq_pre.freq) > > ans = > > 1 13 > > >> size(freq_post.freq) > > ans = > > 1 31 > > Why the difference? (they do however span the interval [30 90].). > Needless to mention, fd_pre and fd_post are also effected. > > 2>re: multiplot. > I use > cfg = []; > cfg.xparam = 'freq'; > cfg.zparam = 'cohspctrm'; > cfg.zlim = [0 1e-27]; > cfg.channel = 'all'; > cfg.cohrefchannel = 'MEG1833'; > cfg.layout = 'NM306mag.lay'; > multiplotER(cfg, fd_pre,fd_post) > > I would expect the plotting would not be affected as both datasets > have > their frequency vector noted for the x-axis. Yet, the graph of the > first > dataset is 1/3rd as long on the plot. > > How can I fix this? (Incidently, singleplotER works fine for the > power > spectrum ). > > Thanks for your help. > > Best, > sameer > > From sameer at ANDREW.CMU.EDU Tue Apr 10 22:39:27 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 16:39:27 -0400 Subject: removing line frequency Message-ID: Hello, I have been removing line frequency using the notch filter so far and it works fine. However, my data shows lines at 120 and 180 Hz as well (line frequency in US is 60Hz). So I tried cfg.lnfreq = [60 120]; It is accepted, but it does not work. Infact now, even the 60Hz notch filtering does not work. Is there a way to implement both? thanks, sameer From ingew at SOCSCI.RU.NL Wed Apr 11 10:09:10 2007 From: ingew at SOCSCI.RU.NL (Inge Westmijse) Date: Wed, 11 Apr 2007 10:09:10 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis Message-ID: Hi all, I am trying to perform sourceanalysis, but get an error message I cannot explain. It's probably something very basic, but I just don't get it! Here's my code: % Defining the dataset cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg = definetrial(cfg); cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 1]; dataBroadBand = preprocessing(cfg); cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 20]; dataBandPassed = preprocessing(cfg); % Performing time-lock analysis on bp-filtered signal cfg = []; cfg.covariance = 'yes'; cfg.keeptrials = 'yes'; TLDataBandPassed = timelockanalysis(cfg,dataBandPassed); % prepare_localspheres hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg = []; cfg.grad = hdr.grad; cfg.headshape = 'Ptn2b.shape'; [ft_headshape,cfg] = prepare_localspheres(cfg); % preparation of leadfields based on the local sphere model cfg = []; cfg.vol = ft_headshape; hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg.grid.resolution = 1; cfg.grad = hdr.grad; cfg.reducerank = 2; Grid = prepare_leadfield(cfg,TLDataBandPassed); % Source analysis with this broadband data cfg = []; cfg.method = 'lcmv'; cfg.vol = ft_headshape; cfg.grid = Grid; cfg.rawtrial = 'no'; cfg.keepfilter = 'yes'; SourceBP = sourceanalysis(cfg,TLDataBandPassed); Everything goes fine until this last line, then I get the following error: ??? Index exceeds matrix dimensions. Error in ==> sourceanalysis at 944 data.cov = data.cov(seldata,seldata); Error in ==> SAMimitation_v110407 at 64 SourceBP = sourceanalysis(cfg,TLDataBandPassed); I hope someone can help me, thanks in advance! Inge Westmijse ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:19:31 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:19:31 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <1176278950.461c97a66ffa2@trajanus.socsci.kun.nl> Message-ID: On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:40:52 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:40:52 +0200 Subject: removing line frequency In-Reply-To: Message-ID: Hi Sameer On 10 Apr 2007, at 22:39, Sameer Walawalkar wrote: > I have been removing line frequency using the notch filter so far > and it works fine. However, my data shows lines at 120 and 180 Hz > as well (line frequency in US is 60Hz). > > So I tried > > cfg.lnfreq = [60 120]; > > It is accepted, but it does not work. Infact now, even the 60Hz > notch filtering does not work. > > Is there a way to implement both? if you look into private/preproc.m, you see that the function doing the actual work is private/notchfilter. That function documents it as if Fline is specified as 50, a band of 48-52 is filtered out if Fline is specified as [low high], that band is filtered out So hence your first specification works, the second indeed not (since the 60 is at the border). Furthermore, that function also specifies a default notch width of +- 2 Hz. So you cannot pass multiple frequencies at the moment, but it is easy to add line 264 in private/preproc reads if strcmp(cfg.lnfilter, 'yes'), dat = notchfilter(dat, fsample, cfg.lnfreq, cfg.lnfiltord); end line 265-... in private/preproc read if strcmp(cfg.dftfilter, 'yes'), for i=1:length(cfg.dftfreq) % filter out the 50Hz noise, optionally also the 100 and 150 Hz harmonics dat = dftfilter(dat, fsample, cfg.dftfreq(i)); end end if you change the line 264 into something similar, like "for each cfg.lnfreq do notchfilter", then you'll have what you want. I will change it in the release version, it will be on the ftp version in a few days. If the sampling frequency of your MEG system is accurately specified, and if your data segments are long enough, you can also use the dftfilter. That is a much sharper filter (maximally sharp). It might require filter padding though (cfg.padding in preprocessing). It is especially usefull for frequency analysis with multitapering, for timelocked analysis you won't see much benefit. You can read the details on the method in the supplementary online material in our 2005 Science paper (see http://www2.ru.nl/fcdonders/fieldtrip/ doku.php?id=fieldtrip:publications). best regards, Robert From alotof_xd at YAHOO.COM Thu Apr 12 08:39:47 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 11 Apr 2007 23:39:47 -0700 Subject: same scale for plot Message-ID: Hi, experts, Sorry for asking a stupid question... When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : 0.6], the color scale for each map is different. How can I set the same scale for all the maps? Thanks. Best, Eve --------------------------------- Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Thu Apr 12 08:53:36 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Thu, 12 Apr 2007 08:53:36 +0200 Subject: same scale for plot In-Reply-To: <689836.79585.qm@web56613.mail.re3.yahoo.com> Message-ID: Hi Eve, i believe you just have to define similar to cfg.xlim, a cfg.zlim = [A B] (A and B being max and min values). Best, Juan alotof eve wrote: > Hi, experts, > > Sorry for asking a stupid question... > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > 0.6], the color scale for each map is different. How can I set the > same scale for all the maps? Thanks. > > Best, > Eve > > ------------------------------------------------------------------------ > Finding fabulous fares is fun. > Let Yahoo! FareChase search your favorite travel sites > > to find flight and hotel bargains. From gmcauley at LLU.EDU Thu Apr 12 19:12:16 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Thu, 12 Apr 2007 10:12:16 -0700 Subject: General EEG/EEG Analysis Questions Message-ID: Hello, I am wondering if there is a list where one could post more general EEG and/or EEG analysis questions (I am doing some analysis of EEG data, but am not currently using FT trip code - am writing in MATLAB however)? Thank you, ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From teresa at DSRF.ORG Thu Apr 12 18:50:34 2007 From: teresa at DSRF.ORG (Teresa Cheung) Date: Thu, 12 Apr 2007 09:50:34 -0700 Subject: Auto Reply Message-ID: Dear Colleagues, I am on vacation from Tuesday April 10 to Friday April 13. If you need to book MEG time, please contact julie at dsrf.org If you need help with MEG analysis, please contact Alexander at amoisieev at dsrf.org For other urgent inquiries, please contact dawn at dsrf.org. Otherwise, I will reply to your email early next week. Best regards, -Teresa Cheung Teresa Cheung MEG Laboratory Manager Down Syndrome Research Foundation 1409 Sperling Avenue Burnaby, BC Office: 604 444 3773 ext 2239 Lab: 604 444 3773 ext 2249 Cell: 604 313 0338 From ali.mazaheri at FCDONDERS.RU.NL Thu Apr 12 19:37:46 2007 From: ali.mazaheri at FCDONDERS.RU.NL (Ali Mazaheri) Date: Thu, 12 Apr 2007 13:37:46 -0400 Subject: same scale for plot Message-ID: Hi Eve, what I do is find the max and min value for one of the maps, then set the cfg.zlim to that value. best ali ----- Original Message ----- From: "Juan R. Vidal" Date: Thursday, April 12, 2007 2:53 am Subject: Re: [FIELDTRIP] same scale for plot > Hi Eve, > > > i believe you just have to define similar to > cfg.xlim, > a cfg.zlim = [A B] (A and B being max and min values). > > Best, > > Juan > > alotof eve wrote: > > > Hi, experts, > > > > Sorry for asking a stupid question... > > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > > 0.6], the color scale for each map is different. How can I set > the > > same scale for all the maps? Thanks. > > > > Best, > > Eve > > > > ------------------------------------------------------------------ > ------ > > Finding fabulous fares is fun. > > Let Yahoo! FareChase search your favorite travel sites > > 14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--> > > to find flight and hotel bargains. > > From sameer at ANDREW.CMU.EDU Fri Apr 13 15:12:16 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 13 Apr 2007 09:12:16 -0400 Subject: possible a multiplot question Message-ID: Hello, I am interested in linking by lines pairs of MEG channels whose coherences satisfy certain conditions defined by processing that I'll do (after the coherences are generated by using freqanalysis_mtmfft and then freqdescriptives). In an advanced application, the colour of the lines could also include more information. I was thinking of generating necessary MATLAB code, but just wanted to check if there is a simple way to use fieldtrip plotting and layout settings which I might have missed. Thanks for your time. Best, sameer From abastos at BERKELEY.EDU Sat Apr 14 03:11:30 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Fri, 13 Apr 2007 18:11:30 -0700 Subject: using clusterrandanalysis with avgtime = 'yes' In-Reply-To: Message-ID: Dear Trippers, So I am studying the differences in ongoing data between two experimental conditions. Because the data are not time-locked and the differences I expect are between conditions and not necessarily a function of time, it doesn't quite make sense to have a dynamic power spectrum. I have been performing the cluster analysis with my 4-dimensional data (rpt_chan_freq_time), but this still produces clusters that are time-dependent. I set cfg.avgtime = 'yes', but now cluster.stats and .raweffects (and everything else produced by clusterrandanalysis) are NaNs. Here is my cfg: cfg=[]; cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.05; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.05; cfg.nranddraws = 200; cfg.channel = 'all'; cfg.elec = TFR1.elec; cfg.neighbourdist = 49; cfg.avgovertime = 'yes'; I execute: [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Here is the Matlab output: Selecting and formatting the data. selected 64 channels averaging over 97 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 200 randomization 1 200 randomization 2 200 ... The script executes, runs pretty fast, and then produces a cluster structure with all NaNs. Anyone know what I am doing wrong? Best, Andre From ychen at BME.UFL.EDU Tue Apr 17 18:14:40 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 17 Apr 2007 18:14:40 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Sammeer, Thanks for the kind help. After I defined the full path to T1.mnc file, it still crashed. Here is what I am doing: mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.template = 'D:\mat\toolbox\spm2\templates\T1.mnc'; cfg.name = 'segment'; cfg.write = 'yes'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is: ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> vol_singleshell at 8 [segmentedmri] = volumesegment(cfg, mri); What wrong I did? Further help is very much appreciated. Chen From andrew.smart at NYU.EDU Tue Apr 17 19:14:28 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 19:14:28 +0200 Subject: group analysis of BESA source coherence Message-ID: Hi, Has anyone done a group analysis on source coherence with coherence files from BESA? I have exported *.tfc files using coherence between BESA dipoles from individual subjects and would now like to compare coherence between sources and conditions on a group level. Can you treat the dipoles from BESA as channels in Fieldtrip and perform statistical analysis? What would be the best way to go about this?? I have attached an example *.tfc file which is coherence between one BESA source in a montage with all other sources in that montage. Thank you! andy -------------- next part -------------- A non-text attachment was scrubbed... Name: LP_ELAN_05_M100_Fried_prep_gram.tfc Type: application/octet-stream Size: 28035 bytes Desc: not available URL: From andrew.smart at NYU.EDU Tue Apr 17 23:48:43 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 23:48:43 +0200 Subject: BESA source coherence errors Message-ID: Hi, I have been trying to do statistics on BESA source coherence files and I get this error if I try to use freqgrandaverage ??? Reference to non-existent field 'label'. Error in ==> freqgrandaverage at 117 cfg.channel = channelselection(cfg.channel, varargin{i}.label); Error in ==> coherence_test at 92 freq = freqgrandaverage(cfg, Prepgram{:}); The output from besa2fieldtrip has a field called 'labelcmb' instead of 'label', is this why freqgrandaverage cannot find label? If I change 'label' in freqgrandaverage to 'labelcmb' then the script won't find the cohspctrm field. But the field 'labelcmb' seems to be supported in the freq scripts. I would like to average coherence across subjects and do randomization tests between conditions. The coherence is cortico-cortical coherence between planted dipoles, not channels. Any suggestions? Thanks! andy From myles.reilly at HSC.UTAH.EDU Tue Apr 17 23:48:04 2007 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 17 Apr 2007 23:48:04 +0200 Subject: Neuromag event values Message-ID: Hello, I have been trying timelockanalysis on continuous Neuromag data. It does do the average but the results don't match averages calculated by Neuromag applications. In Fieldtrip I can see a single event named 'trigger' that has 2 values, [3.0953e-004] and [6.1907e-004]. There are actually two triggers with the values 1 and 2. Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration factor at work here. I suspect both triggers are being averaged together. Thank you for any direction you can give me on this, Myles From scrofa at GMAIL.COM Wed Apr 18 00:12:17 2007 From: scrofa at GMAIL.COM (Daniel Kislyuk) Date: Wed, 18 Apr 2007 01:12:17 +0300 Subject: Neuromag event values In-Reply-To: Message-ID: What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From c.hesse at FCDONDERS.RU.NL Wed Apr 18 09:26:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 18 Apr 2007 09:26:23 +0200 Subject: Neuromag event values In-Reply-To: <489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: Hi, FT automatically extracts trigger values (onset and offset) from channel STI014. I am not 100% sure why the values are scaled as they are (it is what is written in the file), but it turns out that if you divide all your trigger values by the "magnitude of the smallest non- zero trigger value" you will have nice integers again. Alternatively you could just tell trialfun to look for the funny trigger values. Hope this helps, Christian On 18 Apr 2007, at 00:12, Daniel Kislyuk wrote: > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: >> Hello, >> >> I have been trying timelockanalysis on continuous Neuromag data. >> It does do the average but the results don't match averages >> calculated by >> Neuromag applications. In Fieldtrip I can see a single event >> named 'trigger' that has 2 values, [3.0953e-004] >> and [6.1907e-004]. There are actually two triggers with the values >> 1 and 2. >> >> Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a >> calibration >> factor at work here. >> >> I suspect both triggers are being averaged together. >> >> Thank you for any direction you can give me on this, >> >> Myles >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Wed Apr 18 14:36:09 2007 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Wed, 18 Apr 2007 16:36:09 +0400 Subject: EGI layout Message-ID: Dear all, Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Best Regards, Olga ============================================================= Olga Sysoeva, PhD Researcher Institute of Higher Nervous Activity and Neurophysiology Russian Academy of Sciences (RAS) 5a Butlerova str. MOSCOW 117485, RUSSIA Tel.: +(7 495) 7893852; Fax: +(7 495) 3388500 E-mail: olga at graphicmind.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From Myles.Reilly at HSC.UTAH.EDU Wed Apr 18 16:16:32 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Wed, 18 Apr 2007 08:16:32 -0600 Subject: Neuromag event values In-Reply-To: A<489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From I.Westmijse at NICI.RU.NL Wed Apr 18 16:16:18 2007 From: I.Westmijse at NICI.RU.NL (Inge Westmijse) Date: Wed, 18 Apr 2007 16:16:18 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <917AE84F-D4B3-449A-833B-A74A77425A94@fcdonders.ru.nl> Message-ID: Hi Robert (and everyone else) You solution unfortunately did not work. I have looked into the problem in more detail and it seems the problem lies in a miscommunication between timelockanalysis and sourceanalysis. I have created a dataset consisting of one trial, based on two markers (Start and Stop). As far as I can see, Timelockanalysis creates a covariance matrix with the dimensions: [1,151,151]. I could not see any squeezing happening before the cov becomes part of the results of timelockanalysis. Then these results are used in sourceanalysis, but this code expects for nTrials = 1, a covariance matrix in the shape of [151,151]. So, when he tries to read data.cov(2,1) it's error. Do I see this correctly and if so how can it be solved? Of course, otherwise, what is the problem then? Best, Inge -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: woensdag 11 april 2007 21:20 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Index exceeds matrix dimensions error during sourceanalysis On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From alotof_xd at YAHOO.COM Wed Apr 18 20:10:39 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 18 Apr 2007 11:10:39 -0700 Subject: Neuromag event values In-Reply-To: <5081A4F38BFD4E4D92F4191FBCF41E004D8BD5@CAMPUSV3.xds.umail.utah.edu> Message-ID: Hi, My data is also from Vectorview, 306 sensors. The trigger in my data is on 'STI101'. You might check this by commond: unique({event.type}) My unique event.type is: 'STI101' 'STI301' 'trial' Then I use: [event(find(strcmp('bckpanel trigger', {event.type}))).value] The value I got are exactly the same as the triggers I set. But I did this before timelock analysis. Myles Reilly wrote: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lauri at NEURO.HUT.FI Wed Apr 18 23:43:38 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Thu, 19 Apr 2007 00:43:38 +0300 Subject: Neuromag event values In-Reply-To: <411335.43847.qm@web56604.mail.re3.yahoo.com> Message-ID: Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From andrew.smart at NYU.EDU Thu Apr 19 00:28:27 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 00:28:27 +0200 Subject: another help request for *.tfc files Message-ID: I have been trying to do group analysis on source coherence files in fieldtrip, and fieldtrip doesn't seem to like the output of besa2fieldtrip when the *.tfc files have coherence. The problem seems to be that fieldtrip is looking for the 'label' field in the output structure, which when the *.tfc file has coherence becomes 'labelcmb'. I debugged through fieldtrip and changed prepare_timefreq_data (there is FIXME about this in freqstatistics but it is in Dutch, but I believe it says to replace data.label with data.labelcmb(:,2), however it doesn't specify in which function to do this) In prepare_timefreq_data I changed: output.label = input.label; to output.label = input.labelcmb; To accomodate the labelcmb field in the fieldtrip structure. This gets me by the errors about the field 'label' not existing. But then I get the following errors (for 10 subjects) reading time-frequency representation using BESA toolbox reading coherence between 4 channel pairs renaming parameter 'cohspctrm' into 'powspctrm' selected 1 channels selected 41 time bins selected 24 frequency bins using "statistics_montecarlo" for the statistical testing ??? Error using ==> fieldtrip-20070320\private\statistics_wrapper the size of the design matrix does not match the number of observations in the data Error in ==> freqstatistics at 87 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> coherence_test at 82 Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); This is the code I have used which generates the above error, which I cannot figure out: clear all; close all; pack; filename_Prepgram = { 'LP_ELAN_05_M100_Fried_prep_gram.tfc' 'LP_ELAN_06_M100_Fried_prep_gram.tfc' 'LP_ELAN_07_M100_Fried_prep_gram.tfc' 'LP_ELAN_08_M100_Fried_prep_gram.tfc' 'LP_ELAN_10_M100_Fried_prep_gram.tfc' 'LP_ELAN_11_M100_Fried_prep_gram.tfc' 'LP_ELAN_12_M100_Fried_prep_gram.tfc' 'LP_ELAN_13_M100_Fried_prep_gram.tfc' 'LP_ELAN_14_M100_Fried_prep_gram.tfc' 'LP_ELAN_16_M100_Fried_prep_gram.tfc' }; % this is the list of BESA datafiles in the other condition filename_Prepungram = { 'LP_ELAN_05_M100_Fried_prep_ungram.tfc' 'LP_ELAN_06_M100_Fried_prep_ungram.tfc' 'LP_ELAN_07_M100_Fried_prep_ungram.tfc' 'LP_ELAN_08_M100_Fried_prep_ungram.tfc' 'LP_ELAN_10_M100_Fried_prep_ungram.tfc' 'LP_ELAN_11_M100_Fried_prep_ungram.tfc' 'LP_ELAN_12_M100_Fried_prep_ungram.tfc' 'LP_ELAN_13_M100_Fried_prep_ungram.tfc' 'LP_ELAN_14_M100_Fried_prep_ungram.tfc' 'LP_ELAN_16_M100_Fried_prep_ungram.tfc' }; nsubj = length(filename_Prepgram); %read in BESA for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; cfg.channel = 'Fried_RH_elan_FL'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'max'; cfg.numrandomization = 200; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 % subject 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ]; % condition number cfg.uvar = 1; % "subject" cfg.ivar = 2; % "condition" Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); % any help would be greatly appreciated, thanks! andy From sdmuthu at CARDIFF.AC.UK Thu Apr 19 10:10:14 2007 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 19 Apr 2007 10:10:14 +0200 Subject: Estimating the power in EEG frequency bands Message-ID: Hi Fieldtrippers, A late follow-up to this topic. I have recentrly been musing over how to get a "clean" measure of the non-phase locked activity. I have tried subtracting the ERF out prior to time-frequency computation but this produces quite a bit of artifact...presumably since the single trial data will have considerable ;atency "jitter" The comments from Christian below make sense ( I think) why simply subtracting the two time-frequency power representaions is not valid. But I wonder would this subtractive approach be valid if one worked with the magnitude of the signal rather than power..omitting all the squaring operations? If this right theoretically, how to achieve this in Fieldtrip?. Would setting cfg.output = 'fourier then abs'ing the output work. My suspicion is no since the summing is being done first here. Alternatively, does one need to hack the code to return the magnitude. Thanks for your help on this and sorry for waking old threads :) - Suresh On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse wrote: >One further comment (please see below): > >> Hi Thomas, >>> Following up on this conversation. It seems that the ‘induced >>> activity’ contains both phase-locked and non-phase-locked >>> activity, whereby the ‘evoked’ activity contains only phase-locked >>> activity. Is it then kosher to separate these components by linear >>> subtraction? For example, if we first compute the ‘induced’ >>> activity by averaging power over individual trials, and from that >>> subtract the ‘evoked activity’ (calculated based on average >>> response) to get the induced activity without any phase-locked >>> activity? >> >> It is not correct to subtract because computing the induced and >> evoked power spectra involves squaring signal amplitudes (a non- >> linear operation), and hence, taking your terminology to refer to >> the instantaneous amplitudes of the signal components (this applies >> to any time-frequency tile) >>> Induced = Phase + Non-Phase >>> >>> And >>> >>> Evoked = Phase >>> >>> Then >>> >>> Non-Phase = Induced – Evoked >>> >>> >> what you actually get from spectral or time-frequency analysis is >> the power of your MEASURED signal >> >> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >> Non-Phase^2 >> >> Evoked^2 = Phase^2 >> >> Then >> >> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >> Phase^2 >> >Note that the other crucial thing to consider here is that you are in >one case averaging power over trials over trials: > >E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >Phase^2) ] + E[ 2*Phase*Non-Phase ] > >this is why taking the square root of sqrt(Induced^2) does not give >(Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). > >in the evoked case you are taking the power of the average amplitude > >Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) > >so in subtracting you are actually assuming that E[Phase]^2 = E >[(Phase)^2] which is unlikely to be accurate the case in finite samples. > >Hope I have not confused others (or myself) here. >Christian > > >---------------------------------------------------------------------- >Christian Hesse, PhD, MIEEE > >F.C. Donders Centre for Cognitive Neuroimaging >P.O. Box 9101 >NL-6500 HB Nijmegen >The Netherlands > >Tel.: +31 (0)24 36 68293 >Fax: +31 (0)24 36 10989 > >Email: c.hesse at fcdonders.ru.nl >Web: www.fcdonders.ru.nl >---------------------------------------------------------------------- > > > > >Date: Thu, 22 Feb 2007 15:52:56 +0100 Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl Sender: FieldTrip discussion list From: Marcel Bastiaansen Subject: Re: Estimating the power in EEG frequency bands In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> Content-type: text/html; charset=ISO-8859-1 Dear Thomas, This is indeed the approach that I have followed succesfully a couple of times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that you are using is somewhat confusing. I (and I guess most people) would refer to induced activity as that part of the EEG that is non-phase-locked, so I would restate your equation to: induced = EEG - evoked. However, there is a drawback to this approach, since it assumes that the ERP is absolutely stationary over trials. This is not the case in reality (e.g. subjects' attentional level or other states may change from trial to trial, giving rise to variability in the single-trial ERPs). This means that by subtracting the average ERP, one may introduce frequency components in the residual EEG that were not present before. Klimesch, and Kalcher and Pfurtscheller, have come up with ways of scaling the average ERP so as to yield a best fit of the average with each single-trial ERP, but also that approach may be sub-optimal. My latest way around the problem is to run a TF analysis on the untreated EEG (containing both evoked and induced activity), and comparing this to a TF analysis of the subject-averaged ERPs (the evoked activity alone). Qualitative differences between the two analyses can now only be attributed to induced activity. Marcel Thomas Thesen wrote: > > Hi FieldTrippers, > > > > Following up on this conversation. It seems that the ‘induced activity’ contains both phase-locked and non-phase-locked activity, whereby the ‘evoked’ activity contains only phase-locked activity. Is it then kosher to separate these components by linear subtraction? For example, if we first compute the ‘induced’ activity by averaging power over individual trials, and from that subtract the ‘evoked activity’ (calculated based on average response) to get the induced activity without any phase-locked activity? > > > > So if > > Induced = Phase + Non-Phase > > And > > Evoked = Phase > > Then > > Non-Phase = Induced – Evoked > > > > Or does the fact that this is a linear operations on data that have been constructed through a non-linear process render this somehow invalid? It has certainly been done before. Your comments would be much appreciated. > > > > Cheers, > > Thomas From c.hesse at FCDONDERS.RU.NL Thu Apr 19 10:58:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 19 Apr 2007 10:58:23 +0200 Subject: Estimating the power in EEG frequency bands In-Reply-To: Message-ID: Hi > A late follow-up to this topic. I have recentrly been musing > over how to > get a "clean" measure of the non-phase locked activity. I have tried > subtracting the ERF out prior to time-frequency computation but this > produces quite a bit of artifact...presumably since the single > trial data > will have considerable ;atency "jitter" The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity. > The comments from Christian below make sense ( I think) why simply > subtracting the two time-frequency power representaions is not > valid. But I > wonder would this subtractive approach be valid if one worked with the > magnitude of the signal rather than power..omitting all the > squaring operations? Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum) Hope this helps, Christian > If this right theoretically, how to achieve this in Fieldtrip?. > Would > setting cfg.output = 'fourier then abs'ing the output work. My > suspicion is > no since the summing is being done first here. Alternatively, does > one need > to hack the code to return the magnitude. > > Thanks for your help on this and sorry for waking old threads :) > > - Suresh > > On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse > wrote: > >> One further comment (please see below): >> >>> Hi Thomas, >>>> Following up on this conversation. It seems that the ‘induced >>>> activity’ contains both phase-locked and non-phase-locked >>>> activity, whereby the ‘evoked’ activity contains only phase-locked >>>> activity. Is it then kosher to separate these components by linear >>>> subtraction? For example, if we first compute the ‘induced’ >>>> activity by averaging power over individual trials, and from that >>>> subtract the ‘evoked activity’ (calculated based on average >>>> response) to get the induced activity without any phase-locked >>>> activity? >>> >>> It is not correct to subtract because computing the induced and >>> evoked power spectra involves squaring signal amplitudes (a non- >>> linear operation), and hence, taking your terminology to refer to >>> the instantaneous amplitudes of the signal components (this applies >>> to any time-frequency tile) >>>> Induced = Phase + Non-Phase >>>> >>>> And >>>> >>>> Evoked = Phase >>>> >>>> Then >>>> >>>> Non-Phase = Induced – Evoked >>>> >>>> >>> what you actually get from spectral or time-frequency analysis is >>> the power of your MEASURED signal >>> >>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >>> Non-Phase^2 >>> >>> Evoked^2 = Phase^2 >>> >>> Then >>> >>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >>> Phase^2 >>> >> Note that the other crucial thing to consider here is that you are in >> one case averaging power over trials over trials: >> >> E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >> Phase^2) ] + E[ 2*Phase*Non-Phase ] >> >> this is why taking the square root of sqrt(Induced^2) does not give >> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). >> >> in the evoked case you are taking the power of the average amplitude >> >> Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) >> >> so in subtracting you are actually assuming that E[Phase]^2 = E >> [(Phase)^2] which is unlikely to be accurate the case in finite >> samples. >> >> Hope I have not confused others (or myself) here. >> Christian >> >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> >> Date: Thu, 22 Feb 2007 15:52:56 +0100 > Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl > Sender: FieldTrip discussion list > From: Marcel Bastiaansen > Subject: Re: Estimating the power in EEG frequency bands > In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> > Content-type: text/html; charset=ISO-8859-1 > > Dear Thomas, > > This is indeed the approach that I have followed succesfully a > couple of > times (e.g. Bastiaansen et al., JOCN 2006), although the > terminology that > you are using is somewhat confusing. I (and I guess most people) > would refer > to induced activity as that part of the EEG that is non-phase- > locked, so I > would restate your equation to: > induced = EEG - evoked. > > However, there is a drawback to this approach, since it assumes > that the ERP > is absolutely stationary over trials. This is not the case in > reality (e.g. > subjects' attentional level or other states may change from trial > to trial, > giving rise to variability in the single-trial ERPs). This means > that by > subtracting the average ERP, one may introduce frequency components > in the > residual EEG that were not present before. Klimesch, and Kalcher and > Pfurtscheller, have come up with ways of scaling the average ERP so > as to > yield a best fit of the average with each single-trial ERP, but > also that > approach may be sub-optimal. > My latest way around the problem is to run a TF analysis on the > untreated > EEG (containing both evoked and induced activity), and comparing > this to a > TF analysis of the subject-averaged ERPs (the evoked activity alone). > Qualitative differences between the two analyses can now only be > attributed > to induced activity. > > Marcel > > Thomas Thesen wrote: >> >> Hi FieldTrippers, >> >> >> >> Following up on this conversation. It seems that the ‘induced >> activity’ > contains both phase-locked and non-phase-locked activity, whereby the > ‘evoked’ activity contains only phase-locked activity. Is it then > kosher to > separate these components by linear subtraction? For example, if we > first > compute the ‘induced’ activity by averaging power over individual > trials, > and from that subtract the ‘evoked activity’ (calculated based on > average > response) to get the induced activity without any phase-locked > activity? >> >> >> >> So if >> >> Induced = Phase + Non-Phase >> >> And >> >> Evoked = Phase >> >> Then >> >> Non-Phase = Induced – Evoked >> >> >> >> Or does the fact that this is a linear operations on data that >> have been > constructed through a non-linear process render this somehow > invalid? It has > certainly been done before. Your comments would be much appreciated. >> >> >> >> Cheers, >> >> Thomas > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:22:17 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:22:17 +0200 Subject: Postdoc in MEG pain research In-Reply-To: Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus job posting.doc job posting.doc -------------- next part -------------- A non-text attachment was scrubbed... Name: 5b008fe.jpg Type: image/jpeg Size: 2053 bytes Desc: not available URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:38:38 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:38:38 +0200 Subject: Postdoc in MEG pain research Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus -------------- next part -------------- A non-text attachment was scrubbed... Name: job_posting_meg.doc Type: application/msword Size: 24064 bytes Desc: not available URL: From andrew.smart at NYU.EDU Thu Apr 19 17:43:19 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 17:43:19 +0200 Subject: problem partially solved Message-ID: Hi, I found why I was getting the error embarrassingly I had {i} instead of {:}! My general question remains about the possibility of doing statistical group analysis on coherence between BESA dipoles, or in source space in general. It seems most of the coherence analyses are set up to do coherence between channels and an external reference such as EMG. Thanks and sorry for all the messages! andy From jan.schoffelen at FCDONDERS.RU.NL Thu Apr 19 21:22:15 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 19 Apr 2007 21:22:15 +0200 Subject: problem partially solved Message-ID: Dear Andy, Please allow me to point you to the fact that fieldtrip has no restriction on the type of data you want to cohere. The rather mundane reason why the tutorial documentation on coherence is about cortico-muscular stuff, is related to the fact that the interpretation of cortico-muscular coherence is far more straightforward than the interpretation of coherence between EEG/MEG-channels, or between virtual electrodes/dipoles. However, the statistical routines don't care whether the coherence spectra you pass to them are between similar channels, or between dipole locations in the brain. Yours, Jan-Mathijs ----- Original Message ----- From: Andrew Smart Date: Thursday, April 19, 2007 5:43 pm Subject: [FIELDTRIP] problem partially solved > Hi, > I found why I was getting the error > embarrassingly I had {i} instead of {:}! > > My general question remains about the possibility of doing > statistical group > analysis on coherence between BESA dipoles, or in source space in > general. > It seems most of the coherence analyses are set up to do coherence > betweenchannels and an external reference such as EMG. > > Thanks and sorry for all the messages! > > andy From andrew.smart at NYU.EDU Thu Apr 19 21:43:45 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 15:43:45 -0400 Subject: problem partially solved In-Reply-To: Message-ID: Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From Brian.Roach at YALE.EDU Thu Apr 19 21:51:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 19 Apr 2007 15:51:38 -0400 Subject: source analysis example images Message-ID: fieldTrip users, I've run a source analysis using the DICS method and EEG data. Here is the code the leads me to the attached sourceplot results: cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.tapsmofrq = 2; cfg.foilim = [80 81]; freq = freqanalysis(cfg, data); cfg.method = 'dics'; cfg.frequency = 80; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2; cfg.projectnoise= 'yes'; tic;source = sourceanalysis(cfg, freq);toc cfg.mriunits = 'mm'; cfg.sourceunits = 'mm'; cfg.funparameter = 'nai'; sourceD = sourcedescriptives([], source); mriFile = '/home/bjr39/FTsource/t1_icbm_normal_1mm_pn0_rf0.mnc'; tic; sourceF = source2full(sourceD); toc tic; sourceInterp = sourceinterpolate(cfg, sourceF, mriFile); toc sourceplot(cfg, sourceInterp) I am wondering if this type of result seems reasonable (if it looks as though I have not made any huge mistakes)? If so, I would run another condition for the same subject and try to use the statistics functions. Also, what does this color scale describe? What are its units? thanks, Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput2.png Type: application/octet-stream Size: 98772 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput.png Type: application/octet-stream Size: 106585 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Thu Apr 19 23:22:05 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 19 Apr 2007 17:22:05 -0400 Subject: using prepare_layout and gradfile to generate mags and planar layout Message-ID: Hello, I want to try and use cfg.gradfile configuration during multiplot becasue of the following issues. If in my configuration, I include cfg.gradfile = file.fif'; everything seems to work fine. But, if I use cfg.layout = NM306all.lay I get the foll error.: the input is freq data with 306 channels, 61 frequencybins and 29 timebins reading layout from file NM306mag.lay ??? Error using ==> multiplotTFR labels in data and labels in layout do not match Usually this meant lay.labels did not have MEG in them. In the past, I have taken care of these errors by making changes to Topoplot and multiplot and adding the MEG to the labels. But with each version of changes being made, it becomes tougher and tougher to keep up with this. So I want to use cfg.gradfile, but then how does one use it for plotting mags and planar only? Incidently, my most currently download (april 18) is giving this weird error for mags.lay : cfg.layout = NM306mags.lay; reading layout from file NM306all.lay ??? Trouble reading floating point number from file (row 1, field 1) ==> MATLAB 5.0 MAT-file, Platform: Error in ==> textread at 177 [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> prepare_layout>readlay at 192 [chNum,X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %f %q %q'); Error in ==> prepare_layout at 108 lay = readlay(cfg.layout); Error in ==> multiplotTFR at 238 lay = prepare_layout(cfg, data); Error in ==> SomeMaster at 21 multiplotTFR(cfgTFRout, TFRmultLL_2_One); Thanks, Sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Apr 20 13:40:53 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 20 Apr 2007 13:40:53 +0200 Subject: problem partially solved In-Reply-To: Message-ID: Dear Andy, It seems as if you already solved the problem for your purpose. Anyway, instead of making a hack in one of the (deep) fieldtrip functions, I would rather change the frequency structure a bit before passing it to freqstatistics. Typically what I do, is the following. Please note that this workaround is ugly, but at present that's a way how it works. In order to keep track of how to interpret the different channels in the data, fieldtrip uses the field 'label', for which it assumes that the number of labels is equal to the first dimension (when 'dimord' = 'chan_freq...etc'), or to the second dimension (when 'dimord' = 'rpt_chan_etc') of your parameter of interest. However, when you are indeed interested in coherence, it's the field 'cohspctrm' which is the relevant field, and for this, fieldtrip looks into 'labelcmb' to interpret which channels have been used to compute coherence. If you put labelcmb on the place of label (which you did in prepare_timefreq_data), but it's a dangerous solution, because 'labelcmb' contains two columns and I guess the fieldtrip-function which checks the labels only looks in the first column. This potentially leads to double occurrences of some labels (for example if for one reason or another your 'reference' channel is in the first column, or if you have more than one reference channel). Therefore, I'd suggest to 'convert' the labelcmb into uniquely identifiable labels, by for example concatenating the two labels in the pair: Newlabel = cell(size(freq.labelcmb,1),1); for j = 1:size(freq.labelcmb,1) Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; end freq.labelold = freq.label; freq.label = newlabel; Hope this helps, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Thursday, April 19, 2007 9:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem partially solved Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From andrew.smart at NYU.EDU Fri Apr 20 19:38:50 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 20 Apr 2007 13:38:50 -0400 Subject: problem partially solved In-Reply-To: <001601c78340$c0610d80$902dae83@fcdonders.nl> Message-ID: Hi Jan, Thank you for tip. I agree that it's not good to hack fieldtrip this way, and I would want to find another work around. Thanks for the code too! I was wondering though I bring the *.tfc files from BESA into Fieldtrip for example: for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end This gives me a 1x10 cell arry with structures for each subject with the following fields: time <1x41> freq <1x24> labelcmb <4x2> cohspctrm <4x24x41> dimord 'chan_freq_time' cfg <1x1> Now with your code: Newlabel = cell(size(Prepgram{i}.labelcmb,1),1); for j = 1:size(Prepgram{i}.labelcmb,1) Newlabel{j} = [Prepgram{i}.labelcmb{j,1},'_',Prepgram{i}.labelcmb{j,2}]; end freq.labelold = freq.label; Prepgram{i}.label = Newlabel; However this doesn't seem to create a label field in the structure associated to each subject. Am I missing something? In our script we would like to test the coherence in one condition between one dipole and the other dipoles in the model, to see if there is significant coherence when taking all the subjects together. Or does this make sense? If there is significant coherence for each subject, does it make sense to look at this on a group level? thanks! andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Friday, April 20, 2007 7:41 am Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > It seems as if you already solved the problem for your purpose. Anyway, > instead of making a hack in one of the (deep) fieldtrip functions, I would > rather change the frequency structure a bit before passing it to > freqstatistics. Typically what I do, is the following. Please note > that this > workaround is ugly, but at present that's a way how it works. > > In order to keep track of how to interpret the different channels in the > data, fieldtrip uses the field 'label', for which it assumes that the > number > of labels is equal to the first dimension (when 'dimord' = > 'chan_freq...etc'), or to the second dimension (when 'dimord' = > 'rpt_chan_etc') of your parameter of interest. However, when you are indeed > interested in coherence, it's the field 'cohspctrm' which is the relevant > field, and for this, fieldtrip looks into 'labelcmb' to interpret which > channels have been used to compute coherence. If you put labelcmb on the > place of label (which you did in prepare_timefreq_data), but it's a > dangerous solution, because 'labelcmb' contains two columns and I > guess the > fieldtrip-function which checks the labels only looks in the first column. > This potentially leads to double occurrences of some labels (for > example if > for one reason or another your 'reference' channel is in the first column, > or if you have more than one reference channel). Therefore, I'd > suggest to > 'convert' the labelcmb into uniquely identifiable labels, by for example > concatenating the two labels in the pair: > > Newlabel = cell(size(freq.labelcmb,1),1); > for j = 1:size(freq.labelcmb,1) > Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; > end > freq.labelold = freq.label; > freq.label = newlabel; > > Hope this helps, > > Jan-Mathijs > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Andrew Smart > Sent: Thursday, April 19, 2007 9:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem partially solved > > Hi Jan, > Thanks for the answer, everything works now ok. > > I did follow this FIXME in freqstatistics > > % FIXME in the hase of coherence, the code above does not work since "label" > is then incorrect. > % marbas reported the following > % als ik freqstatistics gebruik om coherence data te analyseren met > % cfg.parameter = coherence, dan wordt het powspctrm vervangen door > % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als > % er 1 referentiekanaal in zit), waardoor de informatie uit data.label > % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval > % van cfg.parameter = coherence, moeten worden vervangen door > % data.labelcmb(:,2), dan werkt het wel. > > And I changed prepare_timefreq_data > > output.label = input.label: > > to > > output.label = input.labelcmb; > > Otherwise fieldtrip crashes because the structure of the coherence > data does > not have a label field, but a labelcmb with the coherence between channels > and the ref channel. > > Is there a way to get fieldtrip to accomodate coherence structures? > > andy > > ----- Original Message ----- > From: Jan Mathijs Schoffelen > Date: Thursday, April 19, 2007 3:22 pm > Subject: Re: [FIELDTRIP] problem partially solved > To: FIELDTRIP at NIC.SURFNET.NL > > > > Dear Andy, > > > > Please allow me to point you to the fact that fieldtrip has no > > restriction on the type of data you want to cohere. The rather > mundane > > reason why the tutorial documentation on coherence is about > > cortico-muscular stuff, is related to the fact that the > interpretation > > of cortico-muscular coherence is far more straightforward than the > > interpretation of coherence between EEG/MEG-channels, or between > > virtual electrodes/dipoles. However, the statistical routines don't > > > care whether the coherence spectra you pass to them are between > > similar channels, or between dipole locations in the brain. > > > > Yours, > > > > Jan-Mathijs > > > > ----- Original Message ----- > > From: Andrew Smart > > Date: Thursday, April 19, 2007 5:43 pm > > Subject: [FIELDTRIP] problem partially solved > > > > > Hi, > > > I found why I was getting the error > > > embarrassingly I had {i} instead of {:}! > > > > > > My general question remains about the possibility of doing > > > statistical group > > > analysis on coherence between BESA dipoles, or in source space in > > > > general. > > > It seems most of the coherence analyses are set up to do coherence > > > > betweenchannels and an external reference such as EMG. > > > > > > Thanks and sorry for all the messages! > > > > > > andy From Myles.Reilly at HSC.UTAH.EDU Fri Apr 20 21:59:07 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Fri, 20 Apr 2007 13:59:07 -0600 Subject: Neuromag event values In-Reply-To: A<4626910A.9020503@neuro.hut.fi> Message-ID: First thanks to all who have replied, I am very impressed with the support on this group. Lauri: I'll be looking into your suggestions and if you can send the utility in I would appreciate it. A research group here will be looking at raw data from Grandfather Vectorview and I'll pass this all on to them. Moi, Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lauri Parkkonen Sent: Wednesday, April 18, 2007 3:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From CRosenau at WEB.DE Tue Apr 24 14:22:01 2007 From: CRosenau at WEB.DE (Christian Rosenau) Date: Tue, 24 Apr 2007 14:22:01 +0200 Subject: loreta2fieldtrip output Message-ID: Hello all, I have a Problem with the loreta2fieldtrip function. I want to plot the solution of sLoreta-Key on the colin mri from the MNI (analyze format). I want to use the sourceplot function of fieldtrip for doing this. I think I have to run sourceinterpolate first on the mri and source data. I read the .img data with read_fcdc_mri, and the source data with loreta2fieldtrip this is the struct which is created by loreta2fieldtrip dim: [37 44 36] xgrid: [1x29 double] ygrid: [1x34 double] zgrid: [1x24 double] transform: [4x4 double] inside: [6239x1 double] outside: [52369x1 double] avg: [1x1 struct] cfg: [1x1 struct] this is the script I use for interpolating %Interpolate sources and mri to the same grid sinterp_cfg.interpmethod='nearest'; sinterp_cfg.sourceunits='mm'; interp=sourceinterpolate(sinterp_cfg,source,mri); sourceplot(sourcepl_cfg,interp); and this is the error message ??? Error using ==> fieldtrip-20070402\private\grid2transform dimensions do not correspond Error in ==> fieldtrip-20070402\private\fixvolume at 22 volume = grid2transform(volume); Error in ==> sourceinterpolate at 166 functional = fixvolume(functional); Error in ==> sourceplotscript at 14 interp=sourceinterpolate(sinterp_cfg,source,mri); I think it has something to do with the different dimensions of the grid variables and the dim field in the source struct, but how can I fix this? Greetings Christian Rosenau From r.oostenveld at FCDONDERS.RU.NL Tue Apr 24 22:26:56 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 24 Apr 2007 22:26:56 +0200 Subject: EGI layout In-Reply-To: <01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: On 18 Apr 2007, at 14:36, Olga Sysoeva wrote: > Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Dear Olga, You can download *.sfp files from ftp://ftp.egi.com/pub/software/ besa. These contain the labels and xyz positions of all electrodes, and you can read them into matlab with READ_FCDC_ELEC. Using the function PRERARE_LAYOUT, you can make a 2D flat layout from them for use with topoplotting and multiplotting. Something like this should wourk (assuming that you have a recent copy of fieldtrip, since this was only added a few weeks ago) cfg = []; cfg.elecfile = 'GNS128.sfp'; mylay = prepare_layout(cfg); and then use cfg = [] cfg = ... % related to the topoplot or multiplot cfg.layout = mylay in your calls to topoplotXX and multiplotXX. hope this helps, Robert From rongf at NIDCD.NIH.GOV Wed Apr 25 18:02:01 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Wed, 25 Apr 2007 12:02:01 -0400 Subject: dics method for coherence analysis In-Reply-To: A<01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: Dear all, I have a question regarding the comparison of coherence between virtual channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},eoidata.label); eoifreq = freqanalysis(cfg,eoidata); clear eoidata load(datafile,'ldf'); cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); In which bldata and eoidata are from the same dataset epoched with two windows, ldf is the grid which has been computed based on the same dataset. The purpose of this analysis is to compare the coherence between the selected seed channel and other virtual channels within alpha band between the two time windows. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Best, Feng _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 26 00:35:22 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 26 Apr 2007 00:35:22 +0200 Subject: source coherence in one condition Message-ID: Hi, I would like to try to compute whether there is significant coherence across subjects but within one condition and between two dipoles. This code generates graphs but I am unclear about what they mean: for i = 1 : length(the_sources) %this is coherence between pairs of BESA %dipoles, imported *.tfc files cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; %I would like to test coherence between % this dipole and the other dipoles in the % BESA model on a group level cfg.channel = the_sources{i}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.statistic = 'indepsamplesregrT' ; %only stat test that works cfg.correctm = 'max'; cfg.numrandomization = 500; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 %is this correct? 1 1 1 1 1 1 1 1 1 1 ] ; %i have 10 subjects cfg.uvar = 1; %one condition cfg.ivar = 1; cfg.wvar = 1; Prepstat = freqstatistics(cfg, Prepgram{:}); cfg = []; cfg.xparam = 'time'; cfg.yparam = 'freq'; cfg.zparam = 'stat'; %what are the values in this field? cfg.zlim = 'absmax'; figure; singleplotTFR(cfg,Prepstat(:)); title([the_sources{i} '_coherence']); colormap jet end Do you have any suggestions for improving this and making the results more interpretable? (what do the results mean?) Are there other available statistical tests in Fieldtrip, for example is 'indepsamplesZcoh' implemented? Thanks, 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From d.stoffers at VUMC.NL Thu Apr 26 14:08:09 2007 From: d.stoffers at VUMC.NL (Diederick Stoffers) Date: Thu, 26 Apr 2007 14:08:09 +0200 Subject: definetrial Message-ID: Dear all, As a relative newbie to fieldtrip, just followed the 3.5 day course, I am having trouble performing trial definition. Experiment: Simple Eriksen flanker task in CTF 151-channel MEG environment, 80 patients and 20 controls Trials: 80 congruent and 80 incongruent Trial definition: 1s prestimulus and 1.2 second poststimulus (-1.0 to 2.2s) Trial contains stimulus marker and marker for trialtype at t=0, no triggers The CTF dataset has been modified and now contains 160 trials with a length of 3.2 seconds and two markers (stimulus onset and trialtype) at 1 second into the trial as well as a marker for artefacts. Could anyone please advice what to include in mytrialfun.m ? Is it only possible to use triggers (in that case I will have to convert markers to triggers) or can I also use the information in MarkerFile.mrk? I have attached a trialfun.m file which holds some of the information. Cheers, Diederick Stoffers. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From Jan.Schoffelen at FCDONDERS.RU.NL Sat Apr 28 18:32:12 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Sat, 28 Apr 2007 18:32:12 +0200 Subject: dics method for coherence analysis In-Reply-To: <52C93A9A6058924E92A69CDF43966F1B01C9A40E@NIHCESMLBX8.nih.gov> Message-ID: Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rongf at NIDCD.NIH.GOV Mon Apr 30 18:47:16 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Mon, 30 Apr 2007 12:47:16 -0400 Subject: dics method for coherence analysis In-Reply-To: A<007901c789b2$c678d4a0$902dae83@fcdonders.nl> Message-ID: Jan-Mathijs, Thanks for the comprehensive feedback. It is really helpful. I have downloaded the new version and will try. As you have predicted, this procedure is time-consuming. May I know what can I do to revise the script so that I can save some time? Best, Feng -----Original Message----- From: Jan Mathijs Schoffelen [mailto:Jan.Schoffelen at FCDONDERS.RU.NL] Sent: Saturday, April 28, 2007 11:32 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] dics method for coherence analysis Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Mon Apr 2 20:06:47 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 2 Apr 2007 14:06:47 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070329124424.01cda650@email.med.yale.edu> Message-ID: After re-running the sourceanalysis and sourceinterpolate, I seem to get a better looking plot using cfg.funparameter = 'pow', but when I use cfg.funparameter = 'nai', I get this error message: >> sliceinterp(cfg, sourceInterp) ??? Error using ==> sliceinterp at 175 no functional data supplied I did not get this before, and the only thing that I have changed is the specification of the units, as listed below in the previous e-mail. Has anyone else seen this error or have ideas about a fix? thanks, Brian At 12:44 PM 3/30/2007, you wrote: >Thanks for these replies. I have now specified > >cfg.mriunits = 'mm' >cfg.sourceunits = 'mm' > >Then, I should re-run sourceinterpolate.m? That seems to produce the new >results, but the same new results whether I specify both units as 'cm' or >'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you >supposed to use? > > >thanks, >Brian >At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >>On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>>a very likely cause is the incorrect specification of cfg.mriunits, >>>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>>find back in the code you sent in your mail that you actually >>>called it, but I assume you did). If not specified, fieldtrip puts >>>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>>discrepancy in your data there. Perhaps you even explicitly have to >>>check, whether your headmodel (in hdmfile) is defined in cm. At >>>least the dipole-grid on which sourceanalysis performs the >>>beamformer-scanning is defined in cm, and I guess the units should >>>be identical here as well. >> >>The standard BEM EEG volume conduction model that you might have >>copied from EEGLAB is one that is based on the MNI template brain. It >>is in MNI coordinates (linked to the AC and PC) and the units are in >>mm (corresponding with SPM standards). >> >>Robert > From ychen at BME.UFL.EDU Mon Apr 2 22:33:25 2007 From: ychen at BME.UFL.EDU (Chen) Date: Mon, 2 Apr 2007 22:33:25 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Hello, I am trying to generate a BEM headmodel using volumesegment.m for t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following error message: - SPM2: spm_vol ------------------------------------------------- Error reading information on: ..ome/common/matlab/spm2/templates/T1.mnc Please check that it is in the correct format. ----------------------------------------- 16:11:50 - 02/04/2007 ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> BEM_headmodel at 20 seg = volumesegment(cfg, temp_mri); Thanks anybody who can help me on this issue. Chen From sameer at ANDREW.CMU.EDU Mon Apr 2 22:47:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:47:22 -0400 Subject: SPM2 related error message when doing volumesegment In-Reply-To: Message-ID: Hi Chen, unless you define cfg.template = 'full path to T1.mnc file'; spm2 will look for T1.mnc in a predesignated directory and give that error. sameer On Mon, 2 Apr 2007, Chen wrote: > Hello, > > I am trying to generate a BEM headmodel using volumesegment.m for > t1_icbm_normal_1mm_pn0_rf0.mnc. It is creshed by giving the following > error message: > > - SPM2: spm_vol ------------------------------------------------- > > Error reading information on: > ..ome/common/matlab/spm2/templates/T1.mnc > > Please check that it is in the correct format. > > ----------------------------------------- 16:11:50 - 02/04/2007 > > ??? Error using ==> spm_vol>subfunc1 > Can't get volume information > for '/home/common/matlab/spm2/templates/T1.mnc' > > Error in ==> spm_vol>subfunc2 at 51 > V = subfunc1(P); > > Error in ==> spm_vol at 37 > V = subfunc2(P); > > Error in ==> spm_segment>get_affine_mapping at 226 > if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; > > 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 235 > spm_segment(Va,cfg.template,flags); > > Error in ==> BEM_headmodel at 20 > seg = volumesegment(cfg, temp_mri); > > Thanks anybody who can help me on this issue. > > Chen > > From sameer at ANDREW.CMU.EDU Mon Apr 2 22:48:11 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 16:48:11 -0400 Subject: definetrial crashes matlab Message-ID: Hi, I am having an instance of matlab crashing when I try to run definetrial. The error message I get on my ssh client is [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! No such file or directory terminate called after throwing an instance of 'MathWorks::System::_utException' [1] Abort matlab the file clearly exists. [sameer at master SA]$ ls SA_040207_One.fif STI101.mat and the following command works. [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); I get the error message when I use cfgLL = [] ; cfgLL.dataset = 'SA_040207_One.fif' ; cfgLL.headerfile = 'SA_040207_One.fif' ; cfgLL.datatype = 'continuous' ; cfgLL.trialdef.eventtype = 'STI101' ; cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; cfgLL.trialdef.poststim = .500; cfgLL = definetrial(cfgLL); If I use a different data file instead of the one mentioned above (after changing to corresponding directory), the setup shown above works, and has consistently worked in the past. How could i troubleshoot it? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Mon Apr 2 23:07:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 2 Apr 2007 17:07:34 -0400 Subject: choosing time windows in freqanalysis_mtmfft. Message-ID: Hello, I want to be able to see the coherences between different channels (using topoplotER). To that end, I know that I must implement freqdescriptives after first implementing freqanalysis_mtmfft. freqanalysis_mtmfft does not seem to allow me to choose the time window from which the data can be selected and then analyzed (I think so primarily because it does not seem to allow cfg.toilim or some such method). Is there a simple way around it that I am missing, or will I have to define new datasets with the data form the time window I want each time? thanks, sameer From c.hesse at FCDONDERS.RU.NL Tue Apr 3 09:23:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 3 Apr 2007 09:23:57 +0200 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Sameer, does the file you're trying to read have the gradiometer and magnetometer information actually in it? This seems very similar to (some of the) errors that Matt was reporting previously. Regards, Christian > I am having an instance of matlab crashing when I try to run > definetrial. The error message I get on my ssh client is > > [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! > No such file or directory > terminate called after throwing an instance of > 'MathWorks::System::_utException' > > [1] Abort matlab > > > the file clearly exists. > [sameer at master SA]$ ls > SA_040207_One.fif STI101.mat > > > and the following command works. > [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); > > I get the error message when I use > > cfgLL = [] ; > cfgLL.dataset = 'SA_040207_One.fif' ; > cfgLL.headerfile = 'SA_040207_One.fif' ; > cfgLL.datatype = 'continuous' ; > cfgLL.trialdef.eventtype = 'STI101' ; > cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; > cfgLL.trialdef.poststim = .500; > > cfgLL = definetrial(cfgLL); > > If I use a different data file instead of the one mentioned above > (after changing to corresponding directory), the setup shown above > works, and has consistently worked in the past. > > How could i troubleshoot it? > > thanks for your time. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at ANDREW.CMU.EDU Wed Apr 4 15:59:21 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Wed, 4 Apr 2007 09:59:21 -0400 Subject: definetrial crashes matlab In-Reply-To: Message-ID: Hi Christian, yes it does have the gradiometer and magnetometer information in it. I could extract the inf0 using fiffaccess. >> ls SA_040207_One.fif STI101.mat >> processContinousRawdata('SA_040207_One') >> ls channames.mat SA_040207_One.fif SA_040207_One.mat STI101.mat >> load SA_040207_One.mat size(C) ans = 312 250000 Thus I have all 306 MEG channels, plus eog and ekg plus the 3 stim channels. processContinousRawdata is essentially (from fiffaccess) status = 'ok'; rawdata('any',fileraw); C = []; while strcmp(status,'ok') [B, status] = rawdata('next'); %process_data(B) ; C = [C B] ; % As this is just one continous recording end filename = strcat(trial,'.mat'); save(filename,'C','-mat') rawdata('close'); thanks, sameer On Tue, 3 Apr 2007, Christian Hesse wrote: > Hi Sameer, > > does the file you're trying to read have the gradiometer and magnetometer > information actually in it? This seems very similar to (some of the) errors > that Matt was reporting previously. > > Regards, > Christian > > >> I am having an instance of matlab crashing when I try to run definetrial. >> The error message I get on my ssh client is >> >> [sameer at master SA]$ Warning:magnetometer.c:223:Error reading fif-file! >> No such file or directory >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> [1] Abort matlab >> >> >> the file clearly exists. >> [sameer at master SA]$ ls >> SA_040207_One.fif STI101.mat >> >> >> and the following command works. >> [STI101,SF] = rawchannels('SA_040207_One.fif','STI101'); >> >> I get the error message when I use >> >> cfgLL = [] ; >> cfgLL.dataset = 'SA_040207_One.fif' ; >> cfgLL.headerfile = 'SA_040207_One.fif' ; >> cfgLL.datatype = 'continuous' ; >> cfgLL.trialdef.eventtype = 'STI101' ; >> cfgLL.trialdef.eventvalue = 7 ; cfgLL.trialdef.prestim = .499; >> cfgLL.trialdef.poststim = .500; >> >> cfgLL = definetrial(cfgLL); >> >> If I use a different data file instead of the one mentioned above (after >> changing to corresponding directory), the setup shown above works, and has >> consistently worked in the past. >> >> How could i troubleshoot it? >> >> thanks for your time. >> >> best, >> sameer >> > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > From maris at NICI.RU.NL Thu Apr 5 14:57:31 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Thu, 5 Apr 2007 14:57:31 +0200 Subject: [SPAM]Re: [FIELDTRIP] timelockstatistics In-Reply-To: Message-ID: Hi Harald, Within 2 weeks, there will be a statistics tutorial on the Fieldtrip homepage that deals with timelock and freqstatistics. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Yes you can. Kind regards, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 5 17:34:48 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 5 Apr 2007 17:34:48 +0200 Subject: maximum statistic correction for mulitple comparisons Message-ID: when using the maximum statistic correction for multiple comparisons what are the values on the colorbar and in the image? are they the corrected p-values? also, i cannot find the cfg.correctm documented anywhere, on the index or in the scripts. is there a documentation for this? thanks! andy From sameer at ANDREW.CMU.EDU Sat Apr 7 22:42:33 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 16:42:33 -0400 Subject: covariance in timelockanalysis Message-ID: Hello, I use the following command to run timelockanalysis to get both averages and covariance. cfgTLA = []; cfgTLA.covariance = 'yes' ; cfgTLA.covariancewindow = [.100 .300]; cov_avg = timelockanalysis(cfgTLA,data) ; (Data actually runs from [-.499 2.0] This returns avg: [308x2500 double] var: [308x2500 double] fsample: 1000 numsamples: [29x1 double] time: [1x2500 double] dofvec: [1x2500 double] label: {308x1 cell} dimord: 'chan_time' cov: [308x308 double] numcovsamples: [29x1 double] grad: [1x1 struct] cfg: [1x1 struct] however, cov_avg.cov is essentially all zeros. Is there something I am missing here? thanks for your time. best, sameer From sameer at ANDREW.CMU.EDU Sat Apr 7 23:03:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Sat, 7 Apr 2007 17:03:19 -0400 Subject: troubleshooting topoplotER Message-ID: Hello, While using topoplotER using, cfgTLA = []; cfgTLA.xlim = [0 .3] ; cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/DataNeuroMagCondor2/Analysis/NM306grad.lay'; figure topoplotER(cfgTLA,avgLL_1_One) I get the following error. ??? Undefined function or variable "pnt". Error in ==> createlayout at 209 pnt = pnt(ind,:); To troubleshoot, on line 198, sel is empty matrix. So Line 205 pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); does not get executed. So I changed ch1 = sprintf('MEG %03d1', i); ch2 = sprintf('MEG %03d2', i); ch3 = sprintf('MEG %03d3', i); to ch1 = sprintf('MEG%03d1', i); ch2 = sprintf('MEG%03d2', i); ch3 = sprintf('MEG%03d3', i); ANow things both work and seem sensible. I just wanted to both bring it to your attention and make sure that it is indeed an o.k fix. Best, sameer From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:24:26 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:24:26 +0200 Subject: covariance in timelockanalysis In-Reply-To: Message-ID: Hi Sameer, > I use the following command to run timelockanalysis to get both > averages and covariance. > > cfgTLA = []; > cfgTLA.covariance = 'yes' ; > cfgTLA.covariancewindow = [.100 .300]; > cov_avg = timelockanalysis(cfgTLA,data) ; > > (Data actually runs from [-.499 2.0] > > This returns > > avg: [308x2500 double] > var: [308x2500 double] > fsample: 1000 > numsamples: [29x1 double] > time: [1x2500 double] > dofvec: [1x2500 double] > label: {308x1 cell} > dimord: 'chan_time' > cov: [308x308 double] > numcovsamples: [29x1 double] > grad: [1x1 struct] > cfg: [1x1 struct] > > > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? the scaling in the covariance matrix depends on the scaling of your signals - if you have the data in units of Tesla (as opposed to femto) then of course the covariances are going to be very small. This can cause some covariance based analysis methods to "think" that your data is rank deficient, etc ... In any event you can try this and see which message you get: if (length(cov_avg.label) == rank(cov_avg.cov)) disp('everything is fine'); else disp('you have a problem'); end If you get the second one you may want to try rescaling your data to femto Tesla first, that way you get "better behaved" covariance values. Hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:30:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:30:06 +0200 Subject: troubleshooting topoplotER In-Reply-To: Message-ID: Hi Sameer, given that the error you report involves a call to the function CREATELAYOUT it seems that you are using a relatively old version of Fieldtrip. There were some changes made in early March to how layouts are handled using a new function PREPARE_LAYOUT. I recommend that you download the latest version of FT - if this error persists, please let me know. Also, it is worth periodically checking the "recent changes" section of the FT website to see if there are any updates that are relevant to you. Regards, Christian On 7 Apr 2007, at 23:03, Sameer Walawalkar wrote: > Hello, > > While using topoplotER using, > > cfgTLA = []; > cfgTLA.xlim = [0 .3] ; > cfgTLAout.layout = '/mnt/condor2/sameer/KarmaCond/ > DataNeuroMagCondor2/Analysis/NM306grad.lay'; > > figure > topoplotER(cfgTLA,avgLL_1_One) > > I get the following error. > ??? Undefined function or variable "pnt". > > Error in ==> createlayout at 209 > pnt = pnt(ind,:); > > > > To troubleshoot, on line 198, sel is empty matrix. So Line 205 > > pnt(i,:) = mean([meanpnt1; meanpnt2; meanpnt3], 1); > > does not get executed. > > So I changed > ch1 = sprintf('MEG %03d1', i); > ch2 = sprintf('MEG %03d2', i); > ch3 = sprintf('MEG %03d3', i); > > to > ch1 = sprintf('MEG%03d1', i); > ch2 = sprintf('MEG%03d2', i); > ch3 = sprintf('MEG%03d3', i); > > ANow things both work and seem sensible. I just wanted to both > bring it to your attention and make sure that it is indeed an o.k fix. > > Best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 10:45:51 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 10:45:51 +0200 Subject: choosing time windows in freqanalysis_mtmfft. In-Reply-To: Message-ID: Hi Sameer, yes, not being able to specify a time window is a "feature" of FREQANALYSIS_MTMFFT that is somewhat misleading and counter intuitive. The easy way around it is to use FREQANALYSIS_MTMCONVOL with appropriate window selection parameters: cfg.toi = [the centre of the time window you want to analyse]; cfg.foi = [the frequencies of interest]; cfg.t_ftimwin = ones(length(cfg.foi),1).*duration of the window you want to analyse; Hope this helps, Christian On 2 Apr 2007, at 23:07, Sameer Walawalkar wrote: > Hello, > > I want to be able to see the coherences between different channels > (using topoplotER). To that end, I know that I must implement > freqdescriptives after first implementing freqanalysis_mtmfft. > > freqanalysis_mtmfft does not seem to allow me to choose the time > window from which the data can be selected and then analyzed (I > think so primarily because it does not seem to allow cfg.toilim or > some such method). > > Is there a simple way around it that I am missing, or will I have > to define new datasets with the data form the time window I want > each time? > > thanks, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:10:01 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:10:01 +0200 Subject: sensortype In-Reply-To: <929188.13557.qm@web56612.mail.re3.yahoo.com> Message-ID: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian On 30 Mar 2007, at 09:21, alotof eve wrote: > Sorry for sending so many emails. The error for combine channel is > due to sensortype.m cannot get my neuromag data type. I checked the > length(grad.label). It's 612, double of 306 which is supposed. How > can I settle it? > Thanks in advance. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 20:48:06 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis, combine channel > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > I checked the script of freqanalysis_wltconvol and founf the > default for output was 'powandcsd'. This output needs combine > channels. My meuromag data seems has problem on something related > "combine channels". > It works when I change output as 'pow'. However, I wonder what > might happen when using combining channels? I suppose it relates > layout? > Thanks for suggestion. > > Best, > Eve > > alotof eve wrote: > Date: Thu, 29 Mar 2007 04:59:42 -0700 > From: alotof eve > Subject: [FIELDTRIP] problem on wavelet analysis > To: FIELDTRIP at NIC.SURFNET.NL > > Dear experts, > > Could you give me ome suggestion for wavelet analysis? These > parameters are OK in EEG data I count using ohter software. I don't > think it's different for MEG data but the error happened... > > >> cfg=[]; > >> cfg.sgn='MEG'; > >> cfg.method='wltconvol'; > >> cfg.width=3; > >> cfg.foi=4:1:30; > >> cfg.toi=-0.4:0.05:1.4; > >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); > ??? Error using ==> zeros > Out of memory. Type HELP MEMORY for your options. > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328 > \freqanalysis_wltconvol.m > On line 234 ==> if csdflg, crsspctrm = complex(zeros > (numsgncmb,numfoi,numtoi)); end > Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m > On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower > (cfg.method)), cfg, data); > Any suggestions are appreciated. > > Best, > Eve > Sucker-punch spam with award-winning protection. > Try the free Yahoo! Mail Beta. > > 8:00? 8:25? 8:40? Find a flick in no time > with theYahoo! Search movie showtime shortcut. > > > Now that's room service! Choose from over 150,000 hotels > in 45,000 destinations on Yahoo! Travel to find your fit. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Sun Apr 8 11:23:20 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Sun, 8 Apr 2007 11:23:20 +0200 Subject: Field Trip and MNE Localization In-Reply-To: <4602B269.9010106@nmr.mgh.harvard.edu> Message-ID: Hi Rob, Fieldtrip (FT) is very good at source analysis in both time and frequency domains and can supports neuromag MEG data so you should be able to do everything you need using FT. Moreover, there is powerful functionality for statistical analysis at the sensor and source levels. All the relevant documentation and example script for MEG data should be applicable to your MEG data. Hope this helps, Christian On 22 Mar 2007, at 17:44, Robert Levy wrote: > Hello, > > I just discovered Fieldtrip, and it seems like a very powerful tool > for spectral analysis of MEG data. Our lab uses Matti Hamalainen's > Neuromag MNE tools to localize ERMF generator sources. A spectral > analysis feature is in development for these tools, but at present > it can be done using Matlab either from scratch or potentially it > seems with the help Fieldtrip. So as not to attempt reinventing > the wheel I was wondering if anyone here has used Fieldtrip in > conjunction with the Neuromag tools to both localize MEG data and > analyze it spectrally. If anyone has done this already I would > appreciate any suggestions, pointers or references to papers. > > Thanks, > Rob > > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Sun Apr 8 16:59:34 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 8 Apr 2007 07:59:34 -0700 Subject: sensortype In-Reply-To: Message-ID: Dear Christian, Thanks. But could you tell me the way that keep only magnetometers or gradiometers in my data structure? I know that's ture both of them in my data structure at the same time. I really feel confused by this. Thanks. Best, Eve Christian Hesse wrote: Hi Eve, I have just tried to replicate this phenomenon with the latest version of FT and a neuromag306 file and am unable to do so. Please make sure you are using the most up-to-date version of FT and try the following with the relevant file: filename = 'yourfile.fif'; hdr = read_fcdc_header(filename); sensortype(hdr.grad) and let me know if the output on the screen is "neuromag306" or not. One of the things you need to make sure is that you do not have magnetometers and gradiometers in your data structure at the same time. Regards, Christian --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abastos at BERKELEY.EDU Mon Apr 9 06:11:53 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Sun, 8 Apr 2007 21:11:53 -0700 Subject: issues with clusterrandanalysis In-Reply-To: Message-ID: Dear Fieldtrippers, I am beginning to use the clusterrandanalysis function, but have not been finding any significant clusters in my EEG data. I changed alpha and alphathresh to be 0.5, but this still didn't produce any results (posclusters and negclusters are both empty). To test whether the config settings were actually working, I generated some random time frequency data using the following commands: s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time steps) rpow = rand(s); (produces pseudorandom nums between 0 and 1) TFR.powspctrm = rpow; I reran clusterrandanalysis with this new TFR, but still got no clusters. This puzzles me, because a random series of numbers should be statistically different from physiologically produced spectral data. I used the basic config settings found in the tutorial, which were: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = 'all'; [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Any ideas what I am doing wrong? Thanks, Andre From maris at NICI.RU.NL Mon Apr 9 12:11:07 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 9 Apr 2007 12:11:07 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <000d01c77a5d$35dcd2c0$a1967840$@edu> Message-ID: Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From sameer at ANDREW.CMU.EDU Mon Apr 9 23:53:34 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 9 Apr 2007 17:53:34 -0400 Subject: checkdata error Message-ID: Hello, I downloaded the latest fieldtrip-20070409.zip. Since then I have been getting the following problem ??? Undefined command/function 'checkdata'. Error in ==> freqanalysis at 136 data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, 'feedback', 'yes'); in various applications which used to run just fine previously. best, sameer From abastos at BERKELEY.EDU Tue Apr 10 07:30:07 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Mon, 9 Apr 2007 22:30:07 -0700 Subject: issues with clusterrandanalysis In-Reply-To: <000f01c77a8f$643e3960$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Using the cfg: cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.5; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.5; cfg.nranddraws = 100; cfg.channel = TFR(1).elec.label(1:64); cfg.latency = [-3.5 -1.5]; cfg.elec = TFR(1).elec; cfg.neighbourdist = 4; The Matlab printout is: Selecting and formatting the data. selected 64 channels selected 41 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). After it calculates the randomization, I get a further error when the plot function is called (Again using the same settings as the tutorial): reverting to 151 channel CTF default ??? Error using ==> topoplotER labels in data and labels in layout do not match Error in ==> topoplotER at 210 topoplotER(cfg, data); As you said, it doesn't look like the neighborhood structure is being created properly. I was not able to generate it successfully using the following settings: cfg.neighbourdist = 4 cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) neighbours = neighbourselection(cfg, ALLDATA1(1).label) Neighbors becomes a series of 64 structures, but each structure's neighblabel field is empty. Perhaps this is also what happens when the script tries to generate the neighbourhood structure. Thanks for your help, Andre -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Eric Maris Sent: Monday, April 09, 2007 3:11 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] issues with clusterrandanalysis Dear Andre, > I am beginning to use the clusterrandanalysis function, but have not been > finding any significant clusters in my EEG data. I changed alpha and > alphathresh to be 0.5, but this still didn't produce any results > (posclusters and negclusters are both empty). To test whether the config > settings were actually working, I generated some random time frequency data > using the following commands: > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 time > steps) > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > TFR.powspctrm = rpow; > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > This puzzles me, because a random series of numbers should be statistically > different from physiologically produced spectral data. My first guess is that there is something wrong with your neighborhood structure. Can you send me a copy of the screen output (only the part before the counting of the randomizations)? When using MEG-data coming from a CTF system, this neighborhood structure is calculated automatically. However, I guess you are using a different sensor configuration. In that case, you have to supply this information to clusterrandanalysis. You can find more information about this in the online help of clusterrandanalysis. Kind regards, Eric > > I used the basic config settings found in the tutorial, which were: > > cfg.statistic = 'indepsamplesT'; > cfg.alphathresh = 0.5; > cfg.makeclusters = 'yes'; > cfg.minnbchan = 2; > cfg.clusterteststat = 'maxsum'; > cfg.onetwo = 'twosided'; > cfg.alpha = 0.5; > cfg.nranddraws = 100; > cfg.channel = 'all'; > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > Any ideas what I am doing wrong? From maris at NICI.RU.NL Tue Apr 10 10:59:10 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Tue, 10 Apr 2007 10:59:10 +0200 Subject: issues with clusterrandanalysis In-Reply-To: <004401c77b31$503c46d0$f0b4d470$@edu> Message-ID: Dear Andre, > As you said, it doesn't look like the neighborhood structure is being > created properly. I was not able to generate it successfully using the > following settings: > cfg.neighbourdist = 4 > cfg.elec = ALLDATA1(1).elec %(with .pnt and .label fields) > neighbours = neighbourselection(cfg, ALLDATA1(1).label) > > Neighbors becomes a series of 64 structures, but each structure's > neighblabel field is empty. Perhaps this is also what happens when the > script tries to generate the neighbourhood structure. 1. Are the labels is elec.label and ALLDATA1(1).label identical? 2. Are the electrode positions in elec.pnt expressed on the proper scale (i.e., such that cfg.neighbourdist makes sense)? If these checks don't help, send me you one of your data structures (maris at nici.ru.nl). Good luck, Eric > > Thanks for your help, > > Andre > > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Eric Maris > Sent: Monday, April 09, 2007 3:11 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] issues with clusterrandanalysis > > Dear Andre, > > > > > I am beginning to use the clusterrandanalysis function, but have not been > > finding any significant clusters in my EEG data. I changed alpha and > > alphathresh to be 0.5, but this still didn't produce any results > > (posclusters and negclusters are both empty). To test whether the config > > settings were actually working, I generated some random time frequency > data > > using the following commands: > > > > s = size(TFR.powspctrm (s is 17 trials by 64 channels by 40 freqs by 99 > time > > steps) > > rpow = rand(s); (produces pseudorandom nums between 0 and 1) > > TFR.powspctrm = rpow; > > > > I reran clusterrandanalysis with this new TFR, but still got no clusters. > > This puzzles me, because a random series of numbers should be > statistically > > different from physiologically produced spectral data. > > > My first guess is that there is something wrong with your neighborhood > structure. Can you send me a copy of the screen output (only the part before > the counting of the randomizations)? > > When using MEG-data coming from a CTF system, this neighborhood structure > is calculated automatically. However, I guess you are using a different > sensor configuration. In that case, you have to supply this information to > clusterrandanalysis. You can find more information about this in the online > help of clusterrandanalysis. > > > Kind regards, > > Eric > > > > > > > I used the basic config settings found in the tutorial, which were: > > > > cfg.statistic = 'indepsamplesT'; > > cfg.alphathresh = 0.5; > > cfg.makeclusters = 'yes'; > > cfg.minnbchan = 2; > > cfg.clusterteststat = 'maxsum'; > > cfg.onetwo = 'twosided'; > > cfg.alpha = 0.5; > > cfg.nranddraws = 100; > > cfg.channel = 'all'; > > [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); > > > > Any ideas what I am doing wrong? From c.hesse at FCDONDERS.RU.NL Tue Apr 10 11:26:30 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 10 Apr 2007 11:26:30 +0200 Subject: checkdata error In-Reply-To: Message-ID: Hi Sameer, we checked and the function CHECKDATA is definitely in the latest version of FT. You might want to make sure that your Matlab path has been updated, and that Matlab is aware of the presence of the new function. If in doubt, restart Matlab and let us know if the error persists. Regards, Christian On 9 Apr 2007, at 23:53, Sameer Walawalkar wrote: > Hello, > > I downloaded the latest fieldtrip-20070409.zip. > > Since then I have been getting the following problem > > ??? Undefined command/function 'checkdata'. > > Error in ==> freqanalysis at 136 > data = checkdata(data, 'datatype', {'raw', 'timelock', 'comp'}, > 'feedback', 'yes'); > > in various applications which used to run just fine previously. > > best, > sameer > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 12:59:37 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 12:59:37 +0200 Subject: maximum statistic correction for mulitple comparisons In-Reply-To: Message-ID: Hi Andrew, On 5 Apr 2007, at 17:34, Andrew Smart wrote: > when using the maximum statistic correction for multiple > comparisons what > are the values on the colorbar and in the image? are they the > corrected > p-values? The values that you get in the field "stat.prob" when you do either one of stat = freqstatistics(cfg, freq) stat = timelockstatistics(cfg, timelock) stat = sourcestatistics(cfg, source) and with cfg.correctm=yes are indeed corrected p-values. The functions will also print the following on your screen "using a maximum-statistic based method for multiple comparison correction" "the returned probabilities and the thresholded mask are corrected for multiple comparisons" > also, i cannot find the cfg.correctm documented anywhere, on the > index or in > the scripts. is there a documentation for this? There is no more documentation on them than this single line in statistics_montecarlo % cfg.correctm = apply multiple-comparison correction, 'no', 'max', cluster', 'bonferoni', 'holms', 'fdr' (default = 'no') Someone here in Nijmegen is currently rewriting the randomization statistics tutorial, I will ask him whether he can add some information on these options. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:04:32 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:04:32 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070402140316.048e9b10@email.med.yale.edu> Message-ID: On 2 Apr 2007, at 20:06, Brian Roach wrote: > After re-running the sourceanalysis and sourceinterpolate, I seem > to get a better looking plot using cfg.funparameter = 'pow', but > when I use cfg.funparameter = 'nai', I get this error message: > > >> sliceinterp(cfg, sourceInterp) > ??? Error using ==> sliceinterp at 175 > no functional data supplied Hi Brian, Is the neural activity computed in your data? Please check whether you have besides the field source.avg.pow also the field source.avg.nai. Computing the neural activity index requires cfg.projectnoise=yes in sourceanalysis, and furthermore requires that you call sourcedescriptives after sourceanalysis. I suggest that you use the new sourceplot function instead of the old sliceinterp function. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Tue Apr 10 13:09:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 10 Apr 2007 13:09:27 +0200 Subject: covariance in timelockanalysis In-Reply-To: <07891259-31FE-47E6-B5D1-2FA6354B862C@fcdonders.ru.nl> Message-ID: Hi Sameer, > cov: [308x308 double] ... > however, cov_avg.cov is essentially all zeros. Is there something I > am missing here? > > the scaling in the covariance matrix depends on the scaling of your > signals - if you have the data in units of Tesla (as opposed to > femto) then of course the covariances are going to be very small. > This can cause some covariance based analysis methods to "think" > that your data is rank deficient, etc ... Since you have 308 channels instead of 306, the units of the channels will be different since not all of your channels are apparently MEG channels. The covariance between two channels is in the units of the two channels, i.e. the EEG-MEG covariance is in units of V*T (Volts timese Tesla) or uV*fT or something similar. Robert From sameer at ANDREW.CMU.EDU Tue Apr 10 18:40:55 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 12:40:55 -0400 Subject: length of freq vector in freqanalysis Message-ID: Hello, I find that freqanalysis (cfg.method = mtmfft) generates two different .freq vectors (different lengths, but spanning the correct [min max] as indicated by cfg.foilim) for two different datasets passed with same cfg (but one dataset has more time points than the other). Plotting the power spectra of the two datasets simultaneously using singleplotER works just fine, but multiplotER shows one spectrum spanning smaller range than the other. Funnily, it is the frequency distribution with the larger .freq vector which is graphed smaller. Is there some way I can specify not only the frequency range but also the number of frequency points to be generated? The details are given below. 1> re: freqanalysis I use the same cfg structure (given below) to pass two datasets to freqanalysis. Yet the frequency vectors for each dataset has very different lengths. I wonder if the different time lengths of each set make a difference. cfg = []; cfg.ouput='powandcsd'; cfg.method='mtmfft'; cfg.keeptrials='no'; cfg.tapsmofrq=4; cfg.foilim =[30 90]; cfg.channel = 'MEG' ; cfg.channelcmb = {'MEG' 'MEG'}; pre1 = -.300 ; pre2 = -.100 ; post1 = .000 ; post2 = .500 ; (this line tells my defined function Breakdata to pass on only data between times 300msec to 100 msec before event and from event to 500 msec after. [data_pre, data_post] = Breakdata(data, pre1, pre2, post1, post2) freq_pre = freqanalysis(cfg,data_pre); freq_post = freqanalysis(cfg,data_post); fd_pre = freqdescriptives([], freq_pre) fd_post = freqdescriptives([], freq_post) In the above line Breakdata is a function I have written (I know I could use TFRs to do the same, but I had already written the function and have not yet had time to consider the other option). Now, my question is, >> size(freq_pre.freq) ans = 1 13 >> size(freq_post.freq) ans = 1 31 Why the difference? (they do however span the interval [30 90].). Needless to mention, fd_pre and fd_post are also effected. 2>re: multiplot. I use cfg = []; cfg.xparam = 'freq'; cfg.zparam = 'cohspctrm'; cfg.zlim = [0 1e-27]; cfg.channel = 'all'; cfg.cohrefchannel = 'MEG1833'; cfg.layout = 'NM306mag.lay'; multiplotER(cfg, fd_pre,fd_post) I would expect the plotting would not be affected as both datasets have their frequency vector noted for the x-axis. Yet, the graph of the first dataset is 1/3rd as long on the plot. How can I fix this? (Incidently, singleplotER works fine for the power spectrum ). Thanks for your help. Best, sameer From jan.schoffelen at FCDONDERS.RU.NL Tue Apr 10 20:58:41 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Tue, 10 Apr 2007 20:58:41 +0200 Subject: length of freq vector in freqanalysis Message-ID: Dear Sameer, Your questions are related to some fundamental aspects of fourier-analysis. In general: the length of your data determines the frequency-resolution of the powerspectrum calculated from it. For a good introduction on fourier-analysis you could have a look at www.dspguide.com. Regarding your question about multiplotER: apparently the function expects two data-structures with the same frequency-axis. This can be achieved with zero-padding. You can specify cfg.pad before calling freqanalysis (for a good introduction on zero-padding: see www.dspguide.com I think). If you take this cfg.pad equal for the freqanalysis on data_pre and data_post (it should be >= the longest trials you have, so in your specific case >= 0.5 (it is defined in seconds)), the frequency axes come out identical and I expect multiplotER to behave itself. By the way: cfg.tapsmofrq should be an integer multiple of the frequency-resolution of your data, i.e. an integer multiple of 1./(data-length [this includes the padding if you are comparing data with different length]) Yours, Jan-Mathijs ----- Original Message ----- From: Sameer Walawalkar Date: Tuesday, April 10, 2007 6:40 pm Subject: [FIELDTRIP] length of freq vector in freqanalysis > Hello, > > I find that freqanalysis (cfg.method = mtmfft) generates two > different > .freq vectors (different lengths, but spanning the correct [min > max] as > indicated by cfg.foilim) for two different datasets passed with > same cfg > (but one dataset has more time points than the other). > > Plotting the power spectra of the two datasets simultaneously using > singleplotER works just fine, but multiplotER shows one spectrum > spanning > smaller range than the other. Funnily, it is the frequency > distribution > with the larger .freq vector which is graphed smaller. > > Is there some way I can specify not only the frequency range but > also the > number of frequency points to be generated? > > The details are given below. > > 1> re: freqanalysis > I use the same cfg structure (given below) to pass two datasets to > freqanalysis. Yet the frequency vectors for each dataset has very > different lengths. I wonder if the different time lengths of each > set > make a difference. > > cfg = []; > cfg.ouput='powandcsd'; > cfg.method='mtmfft'; > cfg.keeptrials='no'; > cfg.tapsmofrq=4; > cfg.foilim =[30 90]; > cfg.channel = 'MEG' ; > cfg.channelcmb = {'MEG' 'MEG'}; > > > pre1 = -.300 ; > pre2 = -.100 ; > post1 = .000 ; > post2 = .500 ; > (this line tells my defined function Breakdata to pass on only data > between times 300msec to 100 msec before event and from event to > 500 msec > after. > > [data_pre, data_post] = Breakdata(data, pre1, pre2, > post1, post2) > freq_pre = freqanalysis(cfg,data_pre); > freq_post = freqanalysis(cfg,data_post); > > fd_pre = freqdescriptives([], freq_pre) > fd_post = freqdescriptives([], freq_post) > > In the above line Breakdata is a function I have written (I know I > could > use TFRs to do the same, but I had already written the function and > have > not yet had time to consider the other option). > > Now, my question is, > >> size(freq_pre.freq) > > ans = > > 1 13 > > >> size(freq_post.freq) > > ans = > > 1 31 > > Why the difference? (they do however span the interval [30 90].). > Needless to mention, fd_pre and fd_post are also effected. > > 2>re: multiplot. > I use > cfg = []; > cfg.xparam = 'freq'; > cfg.zparam = 'cohspctrm'; > cfg.zlim = [0 1e-27]; > cfg.channel = 'all'; > cfg.cohrefchannel = 'MEG1833'; > cfg.layout = 'NM306mag.lay'; > multiplotER(cfg, fd_pre,fd_post) > > I would expect the plotting would not be affected as both datasets > have > their frequency vector noted for the x-axis. Yet, the graph of the > first > dataset is 1/3rd as long on the plot. > > How can I fix this? (Incidently, singleplotER works fine for the > power > spectrum ). > > Thanks for your help. > > Best, > sameer > > From sameer at ANDREW.CMU.EDU Tue Apr 10 22:39:27 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 10 Apr 2007 16:39:27 -0400 Subject: removing line frequency Message-ID: Hello, I have been removing line frequency using the notch filter so far and it works fine. However, my data shows lines at 120 and 180 Hz as well (line frequency in US is 60Hz). So I tried cfg.lnfreq = [60 120]; It is accepted, but it does not work. Infact now, even the 60Hz notch filtering does not work. Is there a way to implement both? thanks, sameer From ingew at SOCSCI.RU.NL Wed Apr 11 10:09:10 2007 From: ingew at SOCSCI.RU.NL (Inge Westmijse) Date: Wed, 11 Apr 2007 10:09:10 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis Message-ID: Hi all, I am trying to perform sourceanalysis, but get an error message I cannot explain. It's probably something very basic, but I just don't get it! Here's my code: % Defining the dataset cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg = definetrial(cfg); cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 1]; dataBroadBand = preprocessing(cfg); cfg = []; cfg.dataset = 'Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'; cfg.channel = 'MEG'; cfg.datatype = 'continuous'; cfg.trialfun = 'trialfun_ctf_continuous_withmarkers'; cfg.bpfilter = 'yes'; cfg.bpfreq = [300 20]; dataBandPassed = preprocessing(cfg); % Performing time-lock analysis on bp-filtered signal cfg = []; cfg.covariance = 'yes'; cfg.keeptrials = 'yes'; TLDataBandPassed = timelockanalysis(cfg,dataBandPassed); % prepare_localspheres hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg = []; cfg.grad = hdr.grad; cfg.headshape = 'Ptn2b.shape'; [ft_headshape,cfg] = prepare_localspheres(cfg); % preparation of leadfields based on the local sphere model cfg = []; cfg.vol = ft_headshape; hdr = read_fcdc_header('Ptn2_epilepsy_20060510_02-SWD-unfiltered.ds'); cfg.grid.resolution = 1; cfg.grad = hdr.grad; cfg.reducerank = 2; Grid = prepare_leadfield(cfg,TLDataBandPassed); % Source analysis with this broadband data cfg = []; cfg.method = 'lcmv'; cfg.vol = ft_headshape; cfg.grid = Grid; cfg.rawtrial = 'no'; cfg.keepfilter = 'yes'; SourceBP = sourceanalysis(cfg,TLDataBandPassed); Everything goes fine until this last line, then I get the following error: ??? Index exceeds matrix dimensions. Error in ==> sourceanalysis at 944 data.cov = data.cov(seldata,seldata); Error in ==> SAMimitation_v110407 at 64 SourceBP = sourceanalysis(cfg,TLDataBandPassed); I hope someone can help me, thanks in advance! Inge Westmijse ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:19:31 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:19:31 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <1176278950.461c97a66ffa2@trajanus.socsci.kun.nl> Message-ID: On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From r.oostenveld at FCDONDERS.RU.NL Wed Apr 11 21:40:52 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 11 Apr 2007 21:40:52 +0200 Subject: removing line frequency In-Reply-To: Message-ID: Hi Sameer On 10 Apr 2007, at 22:39, Sameer Walawalkar wrote: > I have been removing line frequency using the notch filter so far > and it works fine. However, my data shows lines at 120 and 180 Hz > as well (line frequency in US is 60Hz). > > So I tried > > cfg.lnfreq = [60 120]; > > It is accepted, but it does not work. Infact now, even the 60Hz > notch filtering does not work. > > Is there a way to implement both? if you look into private/preproc.m, you see that the function doing the actual work is private/notchfilter. That function documents it as if Fline is specified as 50, a band of 48-52 is filtered out if Fline is specified as [low high], that band is filtered out So hence your first specification works, the second indeed not (since the 60 is at the border). Furthermore, that function also specifies a default notch width of +- 2 Hz. So you cannot pass multiple frequencies at the moment, but it is easy to add line 264 in private/preproc reads if strcmp(cfg.lnfilter, 'yes'), dat = notchfilter(dat, fsample, cfg.lnfreq, cfg.lnfiltord); end line 265-... in private/preproc read if strcmp(cfg.dftfilter, 'yes'), for i=1:length(cfg.dftfreq) % filter out the 50Hz noise, optionally also the 100 and 150 Hz harmonics dat = dftfilter(dat, fsample, cfg.dftfreq(i)); end end if you change the line 264 into something similar, like "for each cfg.lnfreq do notchfilter", then you'll have what you want. I will change it in the release version, it will be on the ftp version in a few days. If the sampling frequency of your MEG system is accurately specified, and if your data segments are long enough, you can also use the dftfilter. That is a much sharper filter (maximally sharp). It might require filter padding though (cfg.padding in preprocessing). It is especially usefull for frequency analysis with multitapering, for timelocked analysis you won't see much benefit. You can read the details on the method in the supplementary online material in our 2005 Science paper (see http://www2.ru.nl/fcdonders/fieldtrip/ doku.php?id=fieldtrip:publications). best regards, Robert From alotof_xd at YAHOO.COM Thu Apr 12 08:39:47 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 11 Apr 2007 23:39:47 -0700 Subject: same scale for plot Message-ID: Hi, experts, Sorry for asking a stupid question... When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : 0.6], the color scale for each map is different. How can I set the same scale for all the maps? Thanks. Best, Eve --------------------------------- Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Thu Apr 12 08:53:36 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Thu, 12 Apr 2007 08:53:36 +0200 Subject: same scale for plot In-Reply-To: <689836.79585.qm@web56613.mail.re3.yahoo.com> Message-ID: Hi Eve, i believe you just have to define similar to cfg.xlim, a cfg.zlim = [A B] (A and B being max and min values). Best, Juan alotof eve wrote: > Hi, experts, > > Sorry for asking a stupid question... > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > 0.6], the color scale for each map is different. How can I set the > same scale for all the maps? Thanks. > > Best, > Eve > > ------------------------------------------------------------------------ > Finding fabulous fares is fun. > Let Yahoo! FareChase search your favorite travel sites > > to find flight and hotel bargains. From gmcauley at LLU.EDU Thu Apr 12 19:12:16 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Thu, 12 Apr 2007 10:12:16 -0700 Subject: General EEG/EEG Analysis Questions Message-ID: Hello, I am wondering if there is a list where one could post more general EEG and/or EEG analysis questions (I am doing some analysis of EEG data, but am not currently using FT trip code - am writing in MATLAB however)? Thank you, ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From teresa at DSRF.ORG Thu Apr 12 18:50:34 2007 From: teresa at DSRF.ORG (Teresa Cheung) Date: Thu, 12 Apr 2007 09:50:34 -0700 Subject: Auto Reply Message-ID: Dear Colleagues, I am on vacation from Tuesday April 10 to Friday April 13. If you need to book MEG time, please contact julie at dsrf.org If you need help with MEG analysis, please contact Alexander at amoisieev at dsrf.org For other urgent inquiries, please contact dawn at dsrf.org. Otherwise, I will reply to your email early next week. Best regards, -Teresa Cheung Teresa Cheung MEG Laboratory Manager Down Syndrome Research Foundation 1409 Sperling Avenue Burnaby, BC Office: 604 444 3773 ext 2239 Lab: 604 444 3773 ext 2249 Cell: 604 313 0338 From ali.mazaheri at FCDONDERS.RU.NL Thu Apr 12 19:37:46 2007 From: ali.mazaheri at FCDONDERS.RU.NL (Ali Mazaheri) Date: Thu, 12 Apr 2007 13:37:46 -0400 Subject: same scale for plot Message-ID: Hi Eve, what I do is find the max and min value for one of the maps, then set the cfg.zlim to that value. best ali ----- Original Message ----- From: "Juan R. Vidal" Date: Thursday, April 12, 2007 2:53 am Subject: Re: [FIELDTRIP] same scale for plot > Hi Eve, > > > i believe you just have to define similar to > cfg.xlim, > a cfg.zlim = [A B] (A and B being max and min values). > > Best, > > Juan > > alotof eve wrote: > > > Hi, experts, > > > > Sorry for asking a stupid question... > > When I used topoplotER with time step cfg.xlim = [-0.4 : 0.2 : > > 0.6], the color scale for each map is different. How can I set > the > > same scale for all the maps? Thanks. > > > > Best, > > Eve > > > > ------------------------------------------------------------------ > ------ > > Finding fabulous fares is fun. > > Let Yahoo! FareChase search your favorite travel sites > > 14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--> > > to find flight and hotel bargains. > > From sameer at ANDREW.CMU.EDU Fri Apr 13 15:12:16 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 13 Apr 2007 09:12:16 -0400 Subject: possible a multiplot question Message-ID: Hello, I am interested in linking by lines pairs of MEG channels whose coherences satisfy certain conditions defined by processing that I'll do (after the coherences are generated by using freqanalysis_mtmfft and then freqdescriptives). In an advanced application, the colour of the lines could also include more information. I was thinking of generating necessary MATLAB code, but just wanted to check if there is a simple way to use fieldtrip plotting and layout settings which I might have missed. Thanks for your time. Best, sameer From abastos at BERKELEY.EDU Sat Apr 14 03:11:30 2007 From: abastos at BERKELEY.EDU (Andre Bastos) Date: Fri, 13 Apr 2007 18:11:30 -0700 Subject: using clusterrandanalysis with avgtime = 'yes' In-Reply-To: Message-ID: Dear Trippers, So I am studying the differences in ongoing data between two experimental conditions. Because the data are not time-locked and the differences I expect are between conditions and not necessarily a function of time, it doesn't quite make sense to have a dynamic power spectrum. I have been performing the cluster analysis with my 4-dimensional data (rpt_chan_freq_time), but this still produces clusters that are time-dependent. I set cfg.avgtime = 'yes', but now cluster.stats and .raweffects (and everything else produced by clusterrandanalysis) are NaNs. Here is my cfg: cfg=[]; cfg.statistic = 'indepsamplesT'; cfg.alphathresh = 0.05; cfg.makeclusters = 'yes'; cfg.minnbchan = 2; cfg.clusterteststat = 'maxsum'; cfg.onetwo = 'twosided'; cfg.alpha = 0.05; cfg.nranddraws = 200; cfg.channel = 'all'; cfg.elec = TFR1.elec; cfg.neighbourdist = 49; cfg.avgovertime = 'yes'; I execute: [clusrand] = clusterrandanalysis(cfg, TFR1, TFR2); Here is the Matlab output: Selecting and formatting the data. selected 64 channels averaging over 97 time bins selected 40 frequency bins Calculating the neighbourhood structure of the channels. Obtaining the electrode configuration from the configuration. Running the statistics engine. Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...). randomization 0 200 randomization 1 200 randomization 2 200 ... The script executes, runs pretty fast, and then produces a cluster structure with all NaNs. Anyone know what I am doing wrong? Best, Andre From ychen at BME.UFL.EDU Tue Apr 17 18:14:40 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 17 Apr 2007 18:14:40 +0200 Subject: SPM2 related error message when doing volumesegment Message-ID: Sammeer, Thanks for the kind help. After I defined the full path to T1.mnc file, it still crashed. Here is what I am doing: mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.template = 'D:\mat\toolbox\spm2\templates\T1.mnc'; cfg.name = 'segment'; cfg.write = 'yes'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is: ??? Error using ==> spm_vol>subfunc1 Can't get volume information for '/home/common/matlab/spm2/templates/T1.mnc' Error in ==> spm_vol>subfunc2 at 51 V = subfunc1(P); Error in ==> spm_vol at 37 V = subfunc2(P); Error in ==> spm_segment>get_affine_mapping at 226 if ~isempty(VG) & ischar(VG), VG = spm_vol(VG); end; 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 235 spm_segment(Va,cfg.template,flags); Error in ==> vol_singleshell at 8 [segmentedmri] = volumesegment(cfg, mri); What wrong I did? Further help is very much appreciated. Chen From andrew.smart at NYU.EDU Tue Apr 17 19:14:28 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 19:14:28 +0200 Subject: group analysis of BESA source coherence Message-ID: Hi, Has anyone done a group analysis on source coherence with coherence files from BESA? I have exported *.tfc files using coherence between BESA dipoles from individual subjects and would now like to compare coherence between sources and conditions on a group level. Can you treat the dipoles from BESA as channels in Fieldtrip and perform statistical analysis? What would be the best way to go about this?? I have attached an example *.tfc file which is coherence between one BESA source in a montage with all other sources in that montage. Thank you! andy -------------- next part -------------- A non-text attachment was scrubbed... Name: LP_ELAN_05_M100_Fried_prep_gram.tfc Type: application/octet-stream Size: 28035 bytes Desc: not available URL: From andrew.smart at NYU.EDU Tue Apr 17 23:48:43 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Tue, 17 Apr 2007 23:48:43 +0200 Subject: BESA source coherence errors Message-ID: Hi, I have been trying to do statistics on BESA source coherence files and I get this error if I try to use freqgrandaverage ??? Reference to non-existent field 'label'. Error in ==> freqgrandaverage at 117 cfg.channel = channelselection(cfg.channel, varargin{i}.label); Error in ==> coherence_test at 92 freq = freqgrandaverage(cfg, Prepgram{:}); The output from besa2fieldtrip has a field called 'labelcmb' instead of 'label', is this why freqgrandaverage cannot find label? If I change 'label' in freqgrandaverage to 'labelcmb' then the script won't find the cohspctrm field. But the field 'labelcmb' seems to be supported in the freq scripts. I would like to average coherence across subjects and do randomization tests between conditions. The coherence is cortico-cortical coherence between planted dipoles, not channels. Any suggestions? Thanks! andy From myles.reilly at HSC.UTAH.EDU Tue Apr 17 23:48:04 2007 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 17 Apr 2007 23:48:04 +0200 Subject: Neuromag event values Message-ID: Hello, I have been trying timelockanalysis on continuous Neuromag data. It does do the average but the results don't match averages calculated by Neuromag applications. In Fieldtrip I can see a single event named 'trigger' that has 2 values, [3.0953e-004] and [6.1907e-004]. There are actually two triggers with the values 1 and 2. Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration factor at work here. I suspect both triggers are being averaged together. Thank you for any direction you can give me on this, Myles From scrofa at GMAIL.COM Wed Apr 18 00:12:17 2007 From: scrofa at GMAIL.COM (Daniel Kislyuk) Date: Wed, 18 Apr 2007 01:12:17 +0300 Subject: Neuromag event values In-Reply-To: Message-ID: What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From c.hesse at FCDONDERS.RU.NL Wed Apr 18 09:26:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 18 Apr 2007 09:26:23 +0200 Subject: Neuromag event values In-Reply-To: <489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: Hi, FT automatically extracts trigger values (onset and offset) from channel STI014. I am not 100% sure why the values are scaled as they are (it is what is written in the file), but it turns out that if you divide all your trigger values by the "magnitude of the smallest non- zero trigger value" you will have nice integers again. Alternatively you could just tell trialfun to look for the funny trigger values. Hope this helps, Christian On 18 Apr 2007, at 00:12, Daniel Kislyuk wrote: > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: >> Hello, >> >> I have been trying timelockanalysis on continuous Neuromag data. >> It does do the average but the results don't match averages >> calculated by >> Neuromag applications. In Fieldtrip I can see a single event >> named 'trigger' that has 2 values, [3.0953e-004] >> and [6.1907e-004]. There are actually two triggers with the values >> 1 and 2. >> >> Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a >> calibration >> factor at work here. >> >> I suspect both triggers are being averaged together. >> >> Thank you for any direction you can give me on this, >> >> Myles >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Wed Apr 18 14:36:09 2007 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Wed, 18 Apr 2007 16:36:09 +0400 Subject: EGI layout Message-ID: Dear all, Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Best Regards, Olga ============================================================= Olga Sysoeva, PhD Researcher Institute of Higher Nervous Activity and Neurophysiology Russian Academy of Sciences (RAS) 5a Butlerova str. MOSCOW 117485, RUSSIA Tel.: +(7 495) 7893852; Fax: +(7 495) 3388500 E-mail: olga at graphicmind.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From Myles.Reilly at HSC.UTAH.EDU Wed Apr 18 16:16:32 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Wed, 18 Apr 2007 08:16:32 -0600 Subject: Neuromag event values In-Reply-To: A<489aa9f90704171512r595decceo5c0f784033ea156b@mail.gmail.com> Message-ID: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > From I.Westmijse at NICI.RU.NL Wed Apr 18 16:16:18 2007 From: I.Westmijse at NICI.RU.NL (Inge Westmijse) Date: Wed, 18 Apr 2007 16:16:18 +0200 Subject: Index exceeds matrix dimensions error during sourceanalysis In-Reply-To: <917AE84F-D4B3-449A-833B-A74A77425A94@fcdonders.ru.nl> Message-ID: Hi Robert (and everyone else) You solution unfortunately did not work. I have looked into the problem in more detail and it seems the problem lies in a miscommunication between timelockanalysis and sourceanalysis. I have created a dataset consisting of one trial, based on two markers (Start and Stop). As far as I can see, Timelockanalysis creates a covariance matrix with the dimensions: [1,151,151]. I could not see any squeezing happening before the cov becomes part of the results of timelockanalysis. Then these results are used in sourceanalysis, but this code expects for nTrials = 1, a covariance matrix in the shape of [151,151]. So, when he tries to read data.cov(2,1) it's error. Do I see this correctly and if so how can it be solved? Of course, otherwise, what is the problem then? Best, Inge -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: woensdag 11 april 2007 21:20 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Index exceeds matrix dimensions error during sourceanalysis On 11 Apr 2007, at 10:09, Inge Westmijse wrote: > % Source analysis with this broadband data > cfg = []; > cfg.method = 'lcmv'; > cfg.vol = ft_headshape; > cfg.grid = Grid; > cfg.rawtrial = 'no'; > cfg.keepfilter = 'yes'; > > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > Everything goes fine until this last line, then I get the following > error: > ??? Index exceeds matrix dimensions. > > Error in ==> sourceanalysis at 944 > data.cov = data.cov(seldata,seldata); > > Error in ==> SAMimitation_v110407 at 64 > SourceBP = sourceanalysis(cfg,TLDataBandPassed); > > I hope someone can help me, thanks in advance! Inge Westmijse Hi Inge There is a problem with selecting the data belonging to the desired channels in the covariance matrix. Your timelock data contains only 151 MEG channels, and I suspect that you try to beam using both the 151 regular MEG channels but also the 23 or so reference MEG channels. You should make sure that you select exactly the same channels when preparing the leadfield, and when computing the LCMV filter that you want to use in the subsequent broad-band beaming. Please add cfg.channel="MEG' to each of the prepare_leadfield and sourceanalysis steps. Robert From alotof_xd at YAHOO.COM Wed Apr 18 20:10:39 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Wed, 18 Apr 2007 11:10:39 -0700 Subject: Neuromag event values In-Reply-To: <5081A4F38BFD4E4D92F4191FBCF41E004D8BD5@CAMPUSV3.xds.umail.utah.edu> Message-ID: Hi, My data is also from Vectorview, 306 sensors. The trigger in my data is on 'STI101'. You might check this by commond: unique({event.type}) My unique event.type is: 'STI101' 'STI301' 'trial' Then I use: [event(find(strcmp('bckpanel trigger', {event.type}))).value] The value I got are exactly the same as the triggers I set. But I did this before timelock analysis. Myles Reilly wrote: It's a Vectorview, 306 sensors. The first one actually. Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daniel Kislyuk Sent: Tuesday, April 17, 2007 4:12 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values What Neuromag system do you have? With the newer models it's enough to look at the channel STI 014 only, where the events are very clearly coded in an easily extractible way. -daniel On 4/18/07, Myles Reilly wrote: > Hello, > > I have been trying timelockanalysis on continuous Neuromag data. > It does do the average but the results don't match averages calculated by > Neuromag applications. In Fieldtrip I can see a single event > named 'trigger' that has 2 values, [3.0953e-004] > and [6.1907e-004]. There are actually two triggers with the values 1 and 2. > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a calibration > factor at work here. > > I suspect both triggers are being averaged together. > > Thank you for any direction you can give me on this, > > Myles > --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lauri at NEURO.HUT.FI Wed Apr 18 23:43:38 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Thu, 19 Apr 2007 00:43:38 +0300 Subject: Neuromag event values In-Reply-To: <411335.43847.qm@web56604.mail.re3.yahoo.com> Message-ID: Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From andrew.smart at NYU.EDU Thu Apr 19 00:28:27 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 00:28:27 +0200 Subject: another help request for *.tfc files Message-ID: I have been trying to do group analysis on source coherence files in fieldtrip, and fieldtrip doesn't seem to like the output of besa2fieldtrip when the *.tfc files have coherence. The problem seems to be that fieldtrip is looking for the 'label' field in the output structure, which when the *.tfc file has coherence becomes 'labelcmb'. I debugged through fieldtrip and changed prepare_timefreq_data (there is FIXME about this in freqstatistics but it is in Dutch, but I believe it says to replace data.label with data.labelcmb(:,2), however it doesn't specify in which function to do this) In prepare_timefreq_data I changed: output.label = input.label; to output.label = input.labelcmb; To accomodate the labelcmb field in the fieldtrip structure. This gets me by the errors about the field 'label' not existing. But then I get the following errors (for 10 subjects) reading time-frequency representation using BESA toolbox reading coherence between 4 channel pairs renaming parameter 'cohspctrm' into 'powspctrm' selected 1 channels selected 41 time bins selected 24 frequency bins using "statistics_montecarlo" for the statistical testing ??? Error using ==> fieldtrip-20070320\private\statistics_wrapper the size of the design matrix does not match the number of observations in the data Error in ==> freqstatistics at 87 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> coherence_test at 82 Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); This is the code I have used which generates the above error, which I cannot figure out: clear all; close all; pack; filename_Prepgram = { 'LP_ELAN_05_M100_Fried_prep_gram.tfc' 'LP_ELAN_06_M100_Fried_prep_gram.tfc' 'LP_ELAN_07_M100_Fried_prep_gram.tfc' 'LP_ELAN_08_M100_Fried_prep_gram.tfc' 'LP_ELAN_10_M100_Fried_prep_gram.tfc' 'LP_ELAN_11_M100_Fried_prep_gram.tfc' 'LP_ELAN_12_M100_Fried_prep_gram.tfc' 'LP_ELAN_13_M100_Fried_prep_gram.tfc' 'LP_ELAN_14_M100_Fried_prep_gram.tfc' 'LP_ELAN_16_M100_Fried_prep_gram.tfc' }; % this is the list of BESA datafiles in the other condition filename_Prepungram = { 'LP_ELAN_05_M100_Fried_prep_ungram.tfc' 'LP_ELAN_06_M100_Fried_prep_ungram.tfc' 'LP_ELAN_07_M100_Fried_prep_ungram.tfc' 'LP_ELAN_08_M100_Fried_prep_ungram.tfc' 'LP_ELAN_10_M100_Fried_prep_ungram.tfc' 'LP_ELAN_11_M100_Fried_prep_ungram.tfc' 'LP_ELAN_12_M100_Fried_prep_ungram.tfc' 'LP_ELAN_13_M100_Fried_prep_ungram.tfc' 'LP_ELAN_14_M100_Fried_prep_ungram.tfc' 'LP_ELAN_16_M100_Fried_prep_ungram.tfc' }; nsubj = length(filename_Prepgram); %read in BESA for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; cfg.channel = 'Fried_RH_elan_FL'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'max'; cfg.numrandomization = 200; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 % subject 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ]; % condition number cfg.uvar = 1; % "subject" cfg.ivar = 2; % "condition" Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i}); % any help would be greatly appreciated, thanks! andy From sdmuthu at CARDIFF.AC.UK Thu Apr 19 10:10:14 2007 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Thu, 19 Apr 2007 10:10:14 +0200 Subject: Estimating the power in EEG frequency bands Message-ID: Hi Fieldtrippers, A late follow-up to this topic. I have recentrly been musing over how to get a "clean" measure of the non-phase locked activity. I have tried subtracting the ERF out prior to time-frequency computation but this produces quite a bit of artifact...presumably since the single trial data will have considerable ;atency "jitter" The comments from Christian below make sense ( I think) why simply subtracting the two time-frequency power representaions is not valid. But I wonder would this subtractive approach be valid if one worked with the magnitude of the signal rather than power..omitting all the squaring operations? If this right theoretically, how to achieve this in Fieldtrip?. Would setting cfg.output = 'fourier then abs'ing the output work. My suspicion is no since the summing is being done first here. Alternatively, does one need to hack the code to return the magnitude. Thanks for your help on this and sorry for waking old threads :) - Suresh On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse wrote: >One further comment (please see below): > >> Hi Thomas, >>> Following up on this conversation. It seems that the ‘induced >>> activity’ contains both phase-locked and non-phase-locked >>> activity, whereby the ‘evoked’ activity contains only phase-locked >>> activity. Is it then kosher to separate these components by linear >>> subtraction? For example, if we first compute the ‘induced’ >>> activity by averaging power over individual trials, and from that >>> subtract the ‘evoked activity’ (calculated based on average >>> response) to get the induced activity without any phase-locked >>> activity? >> >> It is not correct to subtract because computing the induced and >> evoked power spectra involves squaring signal amplitudes (a non- >> linear operation), and hence, taking your terminology to refer to >> the instantaneous amplitudes of the signal components (this applies >> to any time-frequency tile) >>> Induced = Phase + Non-Phase >>> >>> And >>> >>> Evoked = Phase >>> >>> Then >>> >>> Non-Phase = Induced – Evoked >>> >>> >> what you actually get from spectral or time-frequency analysis is >> the power of your MEASURED signal >> >> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >> Non-Phase^2 >> >> Evoked^2 = Phase^2 >> >> Then >> >> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >> Phase^2 >> >Note that the other crucial thing to consider here is that you are in >one case averaging power over trials over trials: > >E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >Phase^2) ] + E[ 2*Phase*Non-Phase ] > >this is why taking the square root of sqrt(Induced^2) does not give >(Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). > >in the evoked case you are taking the power of the average amplitude > >Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) > >so in subtracting you are actually assuming that E[Phase]^2 = E >[(Phase)^2] which is unlikely to be accurate the case in finite samples. > >Hope I have not confused others (or myself) here. >Christian > > >---------------------------------------------------------------------- >Christian Hesse, PhD, MIEEE > >F.C. Donders Centre for Cognitive Neuroimaging >P.O. Box 9101 >NL-6500 HB Nijmegen >The Netherlands > >Tel.: +31 (0)24 36 68293 >Fax: +31 (0)24 36 10989 > >Email: c.hesse at fcdonders.ru.nl >Web: www.fcdonders.ru.nl >---------------------------------------------------------------------- > > > > >Date: Thu, 22 Feb 2007 15:52:56 +0100 Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl Sender: FieldTrip discussion list From: Marcel Bastiaansen Subject: Re: Estimating the power in EEG frequency bands In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> Content-type: text/html; charset=ISO-8859-1 Dear Thomas, This is indeed the approach that I have followed succesfully a couple of times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that you are using is somewhat confusing. I (and I guess most people) would refer to induced activity as that part of the EEG that is non-phase-locked, so I would restate your equation to: induced = EEG - evoked. However, there is a drawback to this approach, since it assumes that the ERP is absolutely stationary over trials. This is not the case in reality (e.g. subjects' attentional level or other states may change from trial to trial, giving rise to variability in the single-trial ERPs). This means that by subtracting the average ERP, one may introduce frequency components in the residual EEG that were not present before. Klimesch, and Kalcher and Pfurtscheller, have come up with ways of scaling the average ERP so as to yield a best fit of the average with each single-trial ERP, but also that approach may be sub-optimal. My latest way around the problem is to run a TF analysis on the untreated EEG (containing both evoked and induced activity), and comparing this to a TF analysis of the subject-averaged ERPs (the evoked activity alone). Qualitative differences between the two analyses can now only be attributed to induced activity. Marcel Thomas Thesen wrote: > > Hi FieldTrippers, > > > > Following up on this conversation. It seems that the ‘induced activity’ contains both phase-locked and non-phase-locked activity, whereby the ‘evoked’ activity contains only phase-locked activity. Is it then kosher to separate these components by linear subtraction? For example, if we first compute the ‘induced’ activity by averaging power over individual trials, and from that subtract the ‘evoked activity’ (calculated based on average response) to get the induced activity without any phase-locked activity? > > > > So if > > Induced = Phase + Non-Phase > > And > > Evoked = Phase > > Then > > Non-Phase = Induced – Evoked > > > > Or does the fact that this is a linear operations on data that have been constructed through a non-linear process render this somehow invalid? It has certainly been done before. Your comments would be much appreciated. > > > > Cheers, > > Thomas From c.hesse at FCDONDERS.RU.NL Thu Apr 19 10:58:23 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 19 Apr 2007 10:58:23 +0200 Subject: Estimating the power in EEG frequency bands In-Reply-To: Message-ID: Hi > A late follow-up to this topic. I have recentrly been musing > over how to > get a "clean" measure of the non-phase locked activity. I have tried > subtracting the ERF out prior to time-frequency computation but this > produces quite a bit of artifact...presumably since the single > trial data > will have considerable ;atency "jitter" The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity. > The comments from Christian below make sense ( I think) why simply > subtracting the two time-frequency power representaions is not > valid. But I > wonder would this subtractive approach be valid if one worked with the > magnitude of the signal rather than power..omitting all the > squaring operations? Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum) Hope this helps, Christian > If this right theoretically, how to achieve this in Fieldtrip?. > Would > setting cfg.output = 'fourier then abs'ing the output work. My > suspicion is > no since the summing is being done first here. Alternatively, does > one need > to hack the code to return the magnitude. > > Thanks for your help on this and sorry for waking old threads :) > > - Suresh > > On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse > wrote: > >> One further comment (please see below): >> >>> Hi Thomas, >>>> Following up on this conversation. It seems that the ‘induced >>>> activity’ contains both phase-locked and non-phase-locked >>>> activity, whereby the ‘evoked’ activity contains only phase-locked >>>> activity. Is it then kosher to separate these components by linear >>>> subtraction? For example, if we first compute the ‘induced’ >>>> activity by averaging power over individual trials, and from that >>>> subtract the ‘evoked activity’ (calculated based on average >>>> response) to get the induced activity without any phase-locked >>>> activity? >>> >>> It is not correct to subtract because computing the induced and >>> evoked power spectra involves squaring signal amplitudes (a non- >>> linear operation), and hence, taking your terminology to refer to >>> the instantaneous amplitudes of the signal components (this applies >>> to any time-frequency tile) >>>> Induced = Phase + Non-Phase >>>> >>>> And >>>> >>>> Evoked = Phase >>>> >>>> Then >>>> >>>> Non-Phase = Induced – Evoked >>>> >>>> >>> what you actually get from spectral or time-frequency analysis is >>> the power of your MEASURED signal >>> >>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase + >>> Non-Phase^2 >>> >>> Evoked^2 = Phase^2 >>> >>> Then >>> >>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2 AND NOT Non- >>> Phase^2 >>> >> Note that the other crucial thing to consider here is that you are in >> one case averaging power over trials over trials: >> >> E[ (Induced^2) ] = E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 + >> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non- >> Phase^2) ] + E[ 2*Phase*Non-Phase ] >> >> this is why taking the square root of sqrt(Induced^2) does not give >> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]). >> >> in the evoked case you are taking the power of the average amplitude >> >> Evoked^2 = E[ Phase ]^2 (---> note the ^2 on the outside of the sum) >> >> so in subtracting you are actually assuming that E[Phase]^2 = E >> [(Phase)^2] which is unlikely to be accurate the case in finite >> samples. >> >> Hope I have not confused others (or myself) here. >> Christian >> >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> >> Date: Thu, 22 Feb 2007 15:52:56 +0100 > Reply-To: Marcel.Bastiaansen at fcdonders.ru.nl > Sender: FieldTrip discussion list > From: Marcel Bastiaansen > Subject: Re: Estimating the power in EEG frequency bands > In-Reply-To: <001d01c7568f$4b0d1890$0202fea9 at D3K61L91> > Content-type: text/html; charset=ISO-8859-1 > > Dear Thomas, > > This is indeed the approach that I have followed succesfully a > couple of > times (e.g. Bastiaansen et al., JOCN 2006), although the > terminology that > you are using is somewhat confusing. I (and I guess most people) > would refer > to induced activity as that part of the EEG that is non-phase- > locked, so I > would restate your equation to: > induced = EEG - evoked. > > However, there is a drawback to this approach, since it assumes > that the ERP > is absolutely stationary over trials. This is not the case in > reality (e.g. > subjects' attentional level or other states may change from trial > to trial, > giving rise to variability in the single-trial ERPs). This means > that by > subtracting the average ERP, one may introduce frequency components > in the > residual EEG that were not present before. Klimesch, and Kalcher and > Pfurtscheller, have come up with ways of scaling the average ERP so > as to > yield a best fit of the average with each single-trial ERP, but > also that > approach may be sub-optimal. > My latest way around the problem is to run a TF analysis on the > untreated > EEG (containing both evoked and induced activity), and comparing > this to a > TF analysis of the subject-averaged ERPs (the evoked activity alone). > Qualitative differences between the two analyses can now only be > attributed > to induced activity. > > Marcel > > Thomas Thesen wrote: >> >> Hi FieldTrippers, >> >> >> >> Following up on this conversation. It seems that the ‘induced >> activity’ > contains both phase-locked and non-phase-locked activity, whereby the > ‘evoked’ activity contains only phase-locked activity. Is it then > kosher to > separate these components by linear subtraction? For example, if we > first > compute the ‘induced’ activity by averaging power over individual > trials, > and from that subtract the ‘evoked activity’ (calculated based on > average > response) to get the induced activity without any phase-locked > activity? >> >> >> >> So if >> >> Induced = Phase + Non-Phase >> >> And >> >> Evoked = Phase >> >> Then >> >> Non-Phase = Induced – Evoked >> >> >> >> Or does the fact that this is a linear operations on data that >> have been > constructed through a non-linear process render this somehow > invalid? It has > certainly been done before. Your comments would be much appreciated. >> >> >> >> Cheers, >> >> Thomas > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:22:17 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:22:17 +0200 Subject: Postdoc in MEG pain research In-Reply-To: Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus job posting.doc job posting.doc -------------- next part -------------- A non-text attachment was scrubbed... Name: 5b008fe.jpg Type: image/jpeg Size: 2053 bytes Desc: not available URL: From butzm at UNI-DUESSELDORF.DE Thu Apr 19 17:38:38 2007 From: butzm at UNI-DUESSELDORF.DE (Markus Butz) Date: Thu, 19 Apr 2007 17:38:38 +0200 Subject: Postdoc in MEG pain research Message-ID: Attached is information about a Postdoc position in MEG pain research, at the MEG-Laboratory, Department of Neurology, Heinrich-Heine-University, Düsseldorf, Germany. Best regards, Markus -------------- next part -------------- A non-text attachment was scrubbed... Name: job_posting_meg.doc Type: application/msword Size: 24064 bytes Desc: not available URL: From andrew.smart at NYU.EDU Thu Apr 19 17:43:19 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 17:43:19 +0200 Subject: problem partially solved Message-ID: Hi, I found why I was getting the error embarrassingly I had {i} instead of {:}! My general question remains about the possibility of doing statistical group analysis on coherence between BESA dipoles, or in source space in general. It seems most of the coherence analyses are set up to do coherence between channels and an external reference such as EMG. Thanks and sorry for all the messages! andy From jan.schoffelen at FCDONDERS.RU.NL Thu Apr 19 21:22:15 2007 From: jan.schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 19 Apr 2007 21:22:15 +0200 Subject: problem partially solved Message-ID: Dear Andy, Please allow me to point you to the fact that fieldtrip has no restriction on the type of data you want to cohere. The rather mundane reason why the tutorial documentation on coherence is about cortico-muscular stuff, is related to the fact that the interpretation of cortico-muscular coherence is far more straightforward than the interpretation of coherence between EEG/MEG-channels, or between virtual electrodes/dipoles. However, the statistical routines don't care whether the coherence spectra you pass to them are between similar channels, or between dipole locations in the brain. Yours, Jan-Mathijs ----- Original Message ----- From: Andrew Smart Date: Thursday, April 19, 2007 5:43 pm Subject: [FIELDTRIP] problem partially solved > Hi, > I found why I was getting the error > embarrassingly I had {i} instead of {:}! > > My general question remains about the possibility of doing > statistical group > analysis on coherence between BESA dipoles, or in source space in > general. > It seems most of the coherence analyses are set up to do coherence > betweenchannels and an external reference such as EMG. > > Thanks and sorry for all the messages! > > andy From andrew.smart at NYU.EDU Thu Apr 19 21:43:45 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 19 Apr 2007 15:43:45 -0400 Subject: problem partially solved In-Reply-To: Message-ID: Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From Brian.Roach at YALE.EDU Thu Apr 19 21:51:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 19 Apr 2007 15:51:38 -0400 Subject: source analysis example images Message-ID: fieldTrip users, I've run a source analysis using the DICS method and EEG data. Here is the code the leads me to the attached sourceplot results: cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.tapsmofrq = 2; cfg.foilim = [80 81]; freq = freqanalysis(cfg, data); cfg.method = 'dics'; cfg.frequency = 80; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2; cfg.projectnoise= 'yes'; tic;source = sourceanalysis(cfg, freq);toc cfg.mriunits = 'mm'; cfg.sourceunits = 'mm'; cfg.funparameter = 'nai'; sourceD = sourcedescriptives([], source); mriFile = '/home/bjr39/FTsource/t1_icbm_normal_1mm_pn0_rf0.mnc'; tic; sourceF = source2full(sourceD); toc tic; sourceInterp = sourceinterpolate(cfg, sourceF, mriFile); toc sourceplot(cfg, sourceInterp) I am wondering if this type of result seems reasonable (if it looks as though I have not made any huge mistakes)? If so, I would run another condition for the same subject and try to use the statistics functions. Also, what does this color scale describe? What are its units? thanks, Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput2.png Type: application/octet-stream Size: 98772 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: naiOutput.png Type: application/octet-stream Size: 106585 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Thu Apr 19 23:22:05 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 19 Apr 2007 17:22:05 -0400 Subject: using prepare_layout and gradfile to generate mags and planar layout Message-ID: Hello, I want to try and use cfg.gradfile configuration during multiplot becasue of the following issues. If in my configuration, I include cfg.gradfile = file.fif'; everything seems to work fine. But, if I use cfg.layout = NM306all.lay I get the foll error.: the input is freq data with 306 channels, 61 frequencybins and 29 timebins reading layout from file NM306mag.lay ??? Error using ==> multiplotTFR labels in data and labels in layout do not match Usually this meant lay.labels did not have MEG in them. In the past, I have taken care of these errors by making changes to Topoplot and multiplot and adding the MEG to the labels. But with each version of changes being made, it becomes tougher and tougher to keep up with this. So I want to use cfg.gradfile, but then how does one use it for plotting mags and planar only? Incidently, my most currently download (april 18) is giving this weird error for mags.lay : cfg.layout = NM306mags.lay; reading layout from file NM306all.lay ??? Trouble reading floating point number from file (row 1, field 1) ==> MATLAB 5.0 MAT-file, Platform: Error in ==> textread at 177 [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> prepare_layout>readlay at 192 [chNum,X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %f %q %q'); Error in ==> prepare_layout at 108 lay = readlay(cfg.layout); Error in ==> multiplotTFR at 238 lay = prepare_layout(cfg, data); Error in ==> SomeMaster at 21 multiplotTFR(cfgTFRout, TFRmultLL_2_One); Thanks, Sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Apr 20 13:40:53 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 20 Apr 2007 13:40:53 +0200 Subject: problem partially solved In-Reply-To: Message-ID: Dear Andy, It seems as if you already solved the problem for your purpose. Anyway, instead of making a hack in one of the (deep) fieldtrip functions, I would rather change the frequency structure a bit before passing it to freqstatistics. Typically what I do, is the following. Please note that this workaround is ugly, but at present that's a way how it works. In order to keep track of how to interpret the different channels in the data, fieldtrip uses the field 'label', for which it assumes that the number of labels is equal to the first dimension (when 'dimord' = 'chan_freq...etc'), or to the second dimension (when 'dimord' = 'rpt_chan_etc') of your parameter of interest. However, when you are indeed interested in coherence, it's the field 'cohspctrm' which is the relevant field, and for this, fieldtrip looks into 'labelcmb' to interpret which channels have been used to compute coherence. If you put labelcmb on the place of label (which you did in prepare_timefreq_data), but it's a dangerous solution, because 'labelcmb' contains two columns and I guess the fieldtrip-function which checks the labels only looks in the first column. This potentially leads to double occurrences of some labels (for example if for one reason or another your 'reference' channel is in the first column, or if you have more than one reference channel). Therefore, I'd suggest to 'convert' the labelcmb into uniquely identifiable labels, by for example concatenating the two labels in the pair: Newlabel = cell(size(freq.labelcmb,1),1); for j = 1:size(freq.labelcmb,1) Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; end freq.labelold = freq.label; freq.label = newlabel; Hope this helps, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Andrew Smart Sent: Thursday, April 19, 2007 9:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem partially solved Hi Jan, Thanks for the answer, everything works now ok. I did follow this FIXME in freqstatistics % FIXME in the hase of coherence, the code above does not work since "label" is then incorrect. % marbas reported the following % als ik freqstatistics gebruik om coherence data te analyseren met % cfg.parameter = coherence, dan wordt het powspctrm vervangen door % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als % er 1 referentiekanaal in zit), waardoor de informatie uit data.label % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval % van cfg.parameter = coherence, moeten worden vervangen door % data.labelcmb(:,2), dan werkt het wel. And I changed prepare_timefreq_data output.label = input.label: to output.label = input.labelcmb; Otherwise fieldtrip crashes because the structure of the coherence data does not have a label field, but a labelcmb with the coherence between channels and the ref channel. Is there a way to get fieldtrip to accomodate coherence structures? andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Thursday, April 19, 2007 3:22 pm Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > Please allow me to point you to the fact that fieldtrip has no > restriction on the type of data you want to cohere. The rather mundane > reason why the tutorial documentation on coherence is about > cortico-muscular stuff, is related to the fact that the interpretation > of cortico-muscular coherence is far more straightforward than the > interpretation of coherence between EEG/MEG-channels, or between > virtual electrodes/dipoles. However, the statistical routines don't > care whether the coherence spectra you pass to them are between > similar channels, or between dipole locations in the brain. > > Yours, > > Jan-Mathijs > > ----- Original Message ----- > From: Andrew Smart > Date: Thursday, April 19, 2007 5:43 pm > Subject: [FIELDTRIP] problem partially solved > > > Hi, > > I found why I was getting the error > > embarrassingly I had {i} instead of {:}! > > > > My general question remains about the possibility of doing > > statistical group > > analysis on coherence between BESA dipoles, or in source space in > > general. > > It seems most of the coherence analyses are set up to do coherence > > betweenchannels and an external reference such as EMG. > > > > Thanks and sorry for all the messages! > > > > andy From andrew.smart at NYU.EDU Fri Apr 20 19:38:50 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Fri, 20 Apr 2007 13:38:50 -0400 Subject: problem partially solved In-Reply-To: <001601c78340$c0610d80$902dae83@fcdonders.nl> Message-ID: Hi Jan, Thank you for tip. I agree that it's not good to hack fieldtrip this way, and I would want to find another work around. Thanks for the code too! I was wondering though I bring the *.tfc files from BESA into Fieldtrip for example: for i=1:nsubj Prepgram{i} = besa2fieldtrip(filename_Prepgram{i}); Prepungram{i} = besa2fieldtrip(filename_Prepungram{i}); end This gives me a 1x10 cell arry with structures for each subject with the following fields: time <1x41> freq <1x24> labelcmb <4x2> cohspctrm <4x24x41> dimord 'chan_freq_time' cfg <1x1> Now with your code: Newlabel = cell(size(Prepgram{i}.labelcmb,1),1); for j = 1:size(Prepgram{i}.labelcmb,1) Newlabel{j} = [Prepgram{i}.labelcmb{j,1},'_',Prepgram{i}.labelcmb{j,2}]; end freq.labelold = freq.label; Prepgram{i}.label = Newlabel; However this doesn't seem to create a label field in the structure associated to each subject. Am I missing something? In our script we would like to test the coherence in one condition between one dipole and the other dipoles in the model, to see if there is significant coherence when taking all the subjects together. Or does this make sense? If there is significant coherence for each subject, does it make sense to look at this on a group level? thanks! andy ----- Original Message ----- From: Jan Mathijs Schoffelen Date: Friday, April 20, 2007 7:41 am Subject: Re: [FIELDTRIP] problem partially solved To: FIELDTRIP at NIC.SURFNET.NL > Dear Andy, > > It seems as if you already solved the problem for your purpose. Anyway, > instead of making a hack in one of the (deep) fieldtrip functions, I would > rather change the frequency structure a bit before passing it to > freqstatistics. Typically what I do, is the following. Please note > that this > workaround is ugly, but at present that's a way how it works. > > In order to keep track of how to interpret the different channels in the > data, fieldtrip uses the field 'label', for which it assumes that the > number > of labels is equal to the first dimension (when 'dimord' = > 'chan_freq...etc'), or to the second dimension (when 'dimord' = > 'rpt_chan_etc') of your parameter of interest. However, when you are indeed > interested in coherence, it's the field 'cohspctrm' which is the relevant > field, and for this, fieldtrip looks into 'labelcmb' to interpret which > channels have been used to compute coherence. If you put labelcmb on the > place of label (which you did in prepare_timefreq_data), but it's a > dangerous solution, because 'labelcmb' contains two columns and I > guess the > fieldtrip-function which checks the labels only looks in the first column. > This potentially leads to double occurrences of some labels (for > example if > for one reason or another your 'reference' channel is in the first column, > or if you have more than one reference channel). Therefore, I'd > suggest to > 'convert' the labelcmb into uniquely identifiable labels, by for example > concatenating the two labels in the pair: > > Newlabel = cell(size(freq.labelcmb,1),1); > for j = 1:size(freq.labelcmb,1) > Newlabel{j} = [freq.labelcmb{j,1},'_',freq.labelcmb{j,2}]; > end > freq.labelold = freq.label; > freq.label = newlabel; > > Hope this helps, > > Jan-Mathijs > > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Andrew Smart > Sent: Thursday, April 19, 2007 9:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem partially solved > > Hi Jan, > Thanks for the answer, everything works now ok. > > I did follow this FIXME in freqstatistics > > % FIXME in the hase of coherence, the code above does not work since "label" > is then incorrect. > % marbas reported the following > % als ik freqstatistics gebruik om coherence data te analyseren met > % cfg.parameter = coherence, dan wordt het powspctrm vervangen door > % het cohspctrm. Het laatste heeft echter 1 kanaal minder (dwz als > % er 1 referentiekanaal in zit), waardoor de informatie uit data.label > % niet meer klopt, en freqstatistics crasht. Data.label zou, in geval > % van cfg.parameter = coherence, moeten worden vervangen door > % data.labelcmb(:,2), dan werkt het wel. > > And I changed prepare_timefreq_data > > output.label = input.label: > > to > > output.label = input.labelcmb; > > Otherwise fieldtrip crashes because the structure of the coherence > data does > not have a label field, but a labelcmb with the coherence between channels > and the ref channel. > > Is there a way to get fieldtrip to accomodate coherence structures? > > andy > > ----- Original Message ----- > From: Jan Mathijs Schoffelen > Date: Thursday, April 19, 2007 3:22 pm > Subject: Re: [FIELDTRIP] problem partially solved > To: FIELDTRIP at NIC.SURFNET.NL > > > > Dear Andy, > > > > Please allow me to point you to the fact that fieldtrip has no > > restriction on the type of data you want to cohere. The rather > mundane > > reason why the tutorial documentation on coherence is about > > cortico-muscular stuff, is related to the fact that the > interpretation > > of cortico-muscular coherence is far more straightforward than the > > interpretation of coherence between EEG/MEG-channels, or between > > virtual electrodes/dipoles. However, the statistical routines don't > > > care whether the coherence spectra you pass to them are between > > similar channels, or between dipole locations in the brain. > > > > Yours, > > > > Jan-Mathijs > > > > ----- Original Message ----- > > From: Andrew Smart > > Date: Thursday, April 19, 2007 5:43 pm > > Subject: [FIELDTRIP] problem partially solved > > > > > Hi, > > > I found why I was getting the error > > > embarrassingly I had {i} instead of {:}! > > > > > > My general question remains about the possibility of doing > > > statistical group > > > analysis on coherence between BESA dipoles, or in source space in > > > > general. > > > It seems most of the coherence analyses are set up to do coherence > > > > betweenchannels and an external reference such as EMG. > > > > > > Thanks and sorry for all the messages! > > > > > > andy From Myles.Reilly at HSC.UTAH.EDU Fri Apr 20 21:59:07 2007 From: Myles.Reilly at HSC.UTAH.EDU (Myles Reilly) Date: Fri, 20 Apr 2007 13:59:07 -0600 Subject: Neuromag event values In-Reply-To: A<4626910A.9020503@neuro.hut.fi> Message-ID: First thanks to all who have replied, I am very impressed with the support on this group. Lauri: I'll be looking into your suggestions and if you can send the utility in I would appreciate it. A research group here will be looking at raw data from Grandfather Vectorview and I'll pass this all on to them. Moi, Myles -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lauri Parkkonen Sent: Wednesday, April 18, 2007 3:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Neuromag event values Hi, To clear the confusion with the Neuromag trigger channels, here is the "evolution" of trigger handling in the Neuromag MEG systems: 1. The 122-channel system has only analog-like trigger channels. There is a separate channel for each trigger line or bit, and the names of those channels are STI 001 ... STI 006. The signals are TTL-level pulses, i.e., about +5 volts for the active state and about zero otherwise. 2. With the first 306-channel systems, the triggers are already handled as digital signals but for backwards compatibility with some analysis software modules, the system emulates the analog-like channels STI 001 .. STI 006, again using TTL-level pulses. The compound digital trigger channel STI 014 first existed as an "undocumented feature", and in the early versions of the acquisition software it's calibration coefficient was erroneously not set to unity, which resulted in strange values if the calibration coefficient was applied. This is most likely what Myles is seeing in his datafile. There are workarounds: 1) divide the trigger values with the calibration coefficient within FT to get back to the normal binary representation, or 2) run a small utility on the data file which fixes the calibration info (I can send that utility). Note that this problem exists only with the rather early versions of the front-end acquisition software. 3. The new 306-channel systems (installed in or after Aug 2005) have a redesigned trigger system. The primary trigger channel is STI101 (note that there is no space in the name anymore -- this applies to all channel names in the new system) which holds 16 trigger bits or lines. Optionally, one may use the two trigger interface units as separate, which gives another 16 trigger lines on STI102. There are also trigger channels STI201 (for triggers from the internal function generator) and STI301 (for housekeeping functions), both of which should normally be ignored in FT. I hope this clarifies this trivial but in practice somewhat complicated issue. Best regards, Lauri alotof eve wrote: > Hi, My data is also from Vectorview, 306 sensors. > The trigger in my data is on 'STI101'. You might check this by commond: > unique({event.type}) > My unique event.type is: 'STI101' 'STI301' 'trial' > Then I use: > [event(find(strcmp('bckpanel trigger', {event.type}))).value] > > The value I got are exactly the same as the triggers I set. > > But I did this before timelock analysis. > > > */Myles Reilly /* wrote: > > It's a Vectorview, 306 sensors. The first one actually. > > Myles > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Daniel Kislyuk > Sent: Tuesday, April 17, 2007 4:12 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Neuromag event values > > What Neuromag system do you have? With the newer models it's enough to > look at the channel STI 014 only, where the events are very clearly > coded in an easily extractible way. > > -daniel > > On 4/18/07, Myles Reilly wrote: > > Hello, > > > > I have been trying timelockanalysis on continuous Neuromag data. > > It does do the average but the results don't match averages > calculated > by > > Neuromag applications. In Fieldtrip I can see a single event > > named 'trigger' that has 2 values, [3.0953e-004] > > and [6.1907e-004]. There are actually two triggers with the values 1 > and 2. > > > > Interestingly 3.0953 * 2 = 6.196 so I wonder if there is a > calibration > > factor at work here. > > > > I suspect both triggers are being averaged together. > > > > Thank you for any direction you can give me on this, > > > > Myles > > > > > ------------------------------------------------------------------------ > Ahhh...imagining that irresistible "new car" smell? > Check out new cars at Yahoo! Autos. > From CRosenau at WEB.DE Tue Apr 24 14:22:01 2007 From: CRosenau at WEB.DE (Christian Rosenau) Date: Tue, 24 Apr 2007 14:22:01 +0200 Subject: loreta2fieldtrip output Message-ID: Hello all, I have a Problem with the loreta2fieldtrip function. I want to plot the solution of sLoreta-Key on the colin mri from the MNI (analyze format). I want to use the sourceplot function of fieldtrip for doing this. I think I have to run sourceinterpolate first on the mri and source data. I read the .img data with read_fcdc_mri, and the source data with loreta2fieldtrip this is the struct which is created by loreta2fieldtrip dim: [37 44 36] xgrid: [1x29 double] ygrid: [1x34 double] zgrid: [1x24 double] transform: [4x4 double] inside: [6239x1 double] outside: [52369x1 double] avg: [1x1 struct] cfg: [1x1 struct] this is the script I use for interpolating %Interpolate sources and mri to the same grid sinterp_cfg.interpmethod='nearest'; sinterp_cfg.sourceunits='mm'; interp=sourceinterpolate(sinterp_cfg,source,mri); sourceplot(sourcepl_cfg,interp); and this is the error message ??? Error using ==> fieldtrip-20070402\private\grid2transform dimensions do not correspond Error in ==> fieldtrip-20070402\private\fixvolume at 22 volume = grid2transform(volume); Error in ==> sourceinterpolate at 166 functional = fixvolume(functional); Error in ==> sourceplotscript at 14 interp=sourceinterpolate(sinterp_cfg,source,mri); I think it has something to do with the different dimensions of the grid variables and the dim field in the source struct, but how can I fix this? Greetings Christian Rosenau From r.oostenveld at FCDONDERS.RU.NL Tue Apr 24 22:26:56 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 24 Apr 2007 22:26:56 +0200 Subject: EGI layout In-Reply-To: <01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: On 18 Apr 2007, at 14:36, Olga Sysoeva wrote: > Does anybody has a *.lay file for the 128 Elecrtical Geodesics cap? Dear Olga, You can download *.sfp files from ftp://ftp.egi.com/pub/software/ besa. These contain the labels and xyz positions of all electrodes, and you can read them into matlab with READ_FCDC_ELEC. Using the function PRERARE_LAYOUT, you can make a 2D flat layout from them for use with topoplotting and multiplotting. Something like this should wourk (assuming that you have a recent copy of fieldtrip, since this was only added a few weeks ago) cfg = []; cfg.elecfile = 'GNS128.sfp'; mylay = prepare_layout(cfg); and then use cfg = [] cfg = ... % related to the topoplot or multiplot cfg.layout = mylay in your calls to topoplotXX and multiplotXX. hope this helps, Robert From rongf at NIDCD.NIH.GOV Wed Apr 25 18:02:01 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Wed, 25 Apr 2007 12:02:01 -0400 Subject: dics method for coherence analysis In-Reply-To: A<01b301c781b6$243061d0$51210ad9@acer027f9640b7> Message-ID: Dear all, I have a question regarding the comparison of coherence between virtual channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},eoidata.label); eoifreq = freqanalysis(cfg,eoidata); clear eoidata load(datafile,'ldf'); cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); In which bldata and eoidata are from the same dataset epoched with two windows, ldf is the grid which has been computed based on the same dataset. The purpose of this analysis is to compare the coherence between the selected seed channel and other virtual channels within alpha band between the two time windows. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Best, Feng _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Thu Apr 26 00:35:22 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Thu, 26 Apr 2007 00:35:22 +0200 Subject: source coherence in one condition Message-ID: Hi, I would like to try to compute whether there is significant coherence across subjects but within one condition and between two dipoles. This code generates graphs but I am unclear about what they mean: for i = 1 : length(the_sources) %this is coherence between pairs of BESA %dipoles, imported *.tfc files cfg = []; cfg.keepindividual = 'yes'; cfg.cohrefchannel= 'M100'; %I would like to test coherence between % this dipole and the other dipoles in the % BESA model on a group level cfg.channel = the_sources{i}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.neighbours = []; cfg.time = 'all'; cfg.freq = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.computeprob = 'yes'; cfg.computecritval = 'yes'; cfg.statistic = 'indepsamplesregrT' ; %only stat test that works cfg.correctm = 'max'; cfg.numrandomization = 500; cfg.design = [ 1 2 3 4 5 6 7 8 9 10 %is this correct? 1 1 1 1 1 1 1 1 1 1 ] ; %i have 10 subjects cfg.uvar = 1; %one condition cfg.ivar = 1; cfg.wvar = 1; Prepstat = freqstatistics(cfg, Prepgram{:}); cfg = []; cfg.xparam = 'time'; cfg.yparam = 'freq'; cfg.zparam = 'stat'; %what are the values in this field? cfg.zlim = 'absmax'; figure; singleplotTFR(cfg,Prepstat(:)); title([the_sources{i} '_coherence']); colormap jet end Do you have any suggestions for improving this and making the results more interpretable? (what do the results mean?) Are there other available statistical tests in Fieldtrip, for example is 'indepsamplesZcoh' implemented? Thanks, 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From d.stoffers at VUMC.NL Thu Apr 26 14:08:09 2007 From: d.stoffers at VUMC.NL (Diederick Stoffers) Date: Thu, 26 Apr 2007 14:08:09 +0200 Subject: definetrial Message-ID: Dear all, As a relative newbie to fieldtrip, just followed the 3.5 day course, I am having trouble performing trial definition. Experiment: Simple Eriksen flanker task in CTF 151-channel MEG environment, 80 patients and 20 controls Trials: 80 congruent and 80 incongruent Trial definition: 1s prestimulus and 1.2 second poststimulus (-1.0 to 2.2s) Trial contains stimulus marker and marker for trialtype at t=0, no triggers The CTF dataset has been modified and now contains 160 trials with a length of 3.2 seconds and two markers (stimulus onset and trialtype) at 1 second into the trial as well as a marker for artefacts. Could anyone please advice what to include in mytrialfun.m ? Is it only possible to use triggers (in that case I will have to convert markers to triggers) or can I also use the information in MarkerFile.mrk? I have attached a trialfun.m file which holds some of the information. Cheers, Diederick Stoffers. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ From Jan.Schoffelen at FCDONDERS.RU.NL Sat Apr 28 18:32:12 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Sat, 28 Apr 2007 18:32:12 +0200 Subject: dics method for coherence analysis In-Reply-To: <52C93A9A6058924E92A69CDF43966F1B01C9A40E@NIHCESMLBX8.nih.gov> Message-ID: Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rongf at NIDCD.NIH.GOV Mon Apr 30 18:47:16 2007 From: rongf at NIDCD.NIH.GOV (Rong, Feng (NIH/NIDCD) [V]) Date: Mon, 30 Apr 2007 12:47:16 -0400 Subject: dics method for coherence analysis In-Reply-To: A<007901c789b2$c678d4a0$902dae83@fcdonders.nl> Message-ID: Jan-Mathijs, Thanks for the comprehensive feedback. It is really helpful. I have downloaded the new version and will try. As you have predicted, this procedure is time-consuming. May I know what can I do to revise the script so that I can save some time? Best, Feng -----Original Message----- From: Jan Mathijs Schoffelen [mailto:Jan.Schoffelen at FCDONDERS.RU.NL] Sent: Saturday, April 28, 2007 11:32 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] dics method for coherence analysis Dear Feng, I see that you use the following configuration for your frequency-analysis: channels with the dics method, following is my script: cfg = []; cfg.method='mtmfft'; cfg.ouput='powandcsd'; cfg.keeptrials='yes'; cfg.taper='dpss'; cfg.tapsmofrq=4; cfg.foilim =[8 12]; cfg.sgncmb = channelcombination({'MEG','MEG'},bldata.label); blfreq = freqanalysis(cfg,bldata); clear bldata This in itself is OK, but given the fact that you use cfg.sgncmb instead of cfg.channelcmb, you seem to use an old version of the freqanalysis function (with old syntax, but newer versions are backward-compatible with respect to these formulations). I'm not sure, but the tutorial documentation on the fieldtrip-website, as well as the help content of the respective m-file should contain the most up-to-date info about the proper configuration terminology (provided you have the most up-to-date version of fieldtrip). I would advise anyhow to get the latest version (see below as well). For the sourceanalysis you use the following configuration: cfg = []; cfg.grid = source2sparse(ldf); % Only consider gridpoints within head volume cfg.method = 'power'; cfg.refdip=refdip; cfg.numrandomization = 100; cfg.randomization = 'yes'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.hdmfile = headmodel; cfg.frequency = (foi(1)+foi(2))/2; cfg.keepleadfield = 'no'; cfg.feedback = 'none'; [sourceRand] = sourceanalysis(cfg, eoifreq, blfreq); I don't see why this shouldn't work but it is computationally very demanding (as you might have noticed), because you recompute for each randomization two volumes based on two sets of newly computed spatial filters (for each of the shuffled conditions). Moreover, in your comparison between the baseline and your epoch of interest (of your observed data), you compute two sets of spatial filters as well. Our experience however is, that source reconstruction is more robust (and computationally less expensive, and interpretation-wise less complicated) when you use common filters, i.e. collapsing the cross-spectral densities for the baseline and the active condition (even though there might be a clear difference between the conditions, e.g. dipoles switching on or off). Either way, you betray yourself using an old version of fieldtrip by specifying cfg.method = 'power', which should be cfg.method = 'dics'. cfg=[]; cfg.comparestat = 'relchange' ; cfg.method = 'randomization' ; cfg.parameter = 'coh' ; cfg.approach = 'parametric'; sourcestat = sourcestatistics(cfg,sourceRand); Again, this configuration is a relic from old times, and you should use the function sourcedescriptives to get what you want (given your preceding steps). I guess, that your variable sourceRand contains the fields avgA, avgB, and trialA, and trialB. If you look into the code (of the latest sourcedescriptives.m) you should be able to get an idea of what's going on there. I found in the output variable sourceRand subfield 'pow' and 'coh', which one shall I use for statistical analysis? I assume it should be 'coh', then what does 'pow' stand for? Is it the psd with the target frequency range for each virtual channel? Then will the 'pow' values be different from the computation without specifying reference virtual channel in the script? Indeed, pow stands for the power at the specified voxels. This shouldn't change when you use a reference channel. Yours, Jan-Mathijs _______________________________________________ The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ -------------- next part -------------- An HTML attachment was scrubbed... URL: