From cgra05 at HST.AUC.DK Thu Jun 5 14:13:34 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 5 Jun 2008 14:13:34 +0200 Subject: Problems with frequency analysis... In-Reply-To: <483D7520.5000907@fil.ion.ucl.ac.uk> Message-ID: Hi. I have a problem regarding the function "freqanalysis", that I hope some of you can help me with. I have a Neuroscan .avg file called testdata.avg, and I would like to see a time-frequency plot of all the 64 channels. ___ In order to do this, I try the following: cfg1 = []; cfg1.datafile = 'testdata.avg' cfg1.headerfile = 'testdata.avg' dataFIC = preprocessing(cfg1); This gives me the data in dataFIC, and if I look at the data in dataFIC.trial{1} I get the correct data for all the 64 channels, so no problem here :o). ___ The next I try is: cfg2 = []; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.method = 'mtmconvol'; cfg2.taper = 'hanning'; cfg2.foi = 2:2:30; cfg2.t_ftimwin = ones(length(cfg2.foi),1).*0.5; cfg2.toi = 0.050:0.005:0.500; TFRhann = freqanalysis(cfg2, dataFIC); I would have expected to get the time-frequency coefficients in the TFRhann.powspctrm, but all I get is a lot of NaNs :o(. Am I doing something wrong, and should I set more parameters for the cfg2 ??? ___ When the problem with the freqanalysis is solved, I expect to be able to make the plots this way - does it look right (the testlay_64.lay file is one I have generated myself, and if I just run the code with the TFRhann with all the NaNs, at least the electrodes appear at the right location in the plot. cfg3.zparam = 'powspctrm'; cfg3.xlim = [0 0.5]; cfg3.ylim = [1 29]; cfg3.zlim = [-3e-27 3e-27]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) ___ I look forward to all suggestions regarding the problems with "freqanalysis". Best regards, Carina Graversen Ph.D student at Aalborg Hospital, Denmark ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 5 14:16:45 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 5 Jun 2008 14:16:45 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080605141334.mztnmdbf17eso448@webmail.kom.aau.dk> Message-ID: Hi Carina, What's the length and time axis of your original data segments? If the length of your data is shorter than the t_ftimwin specified in the configuration for freqanalysis, and/or the time points specified in toi do not overlap with the data's time-axis, NaNs will be the consequence :o(. Information about the time-axis can be found in data.time. Take care that the units correspond. Thus when data.time is in milliseconds, the specification in the configuration to freqanalysis should also be in milliseconds. Hope this helps. JM On Jun 5, 2008, at 2:13 PM, Carina Graversen wrote: > Hi. > > I have a problem regarding the function "freqanalysis", that I hope > some of you can help me with. > > I have a Neuroscan .avg file called testdata.avg, and I would like > to see a time-frequency plot of all the 64 channels. > ___ > > In order to do this, I try the following: > > cfg1 = []; > cfg1.datafile = 'testdata.avg' > cfg1.headerfile = 'testdata.avg' > dataFIC = preprocessing(cfg1); > > This gives me the data in dataFIC, and if I look at the data in > dataFIC.trial{1} I get the correct data for all the 64 channels, so > no problem here :o). > ___ > > The next I try is: > > cfg2 = []; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.method = 'mtmconvol'; > cfg2.taper = 'hanning'; > cfg2.foi = 2:2:30; > cfg2.t_ftimwin = ones(length(cfg2.foi), > 1).*0.5; > cfg2.toi = 0.050:0.005:0.500; > > TFRhann = freqanalysis(cfg2, dataFIC); > > I would have expected to get the time-frequency coefficients in the > TFRhann.powspctrm, but all I get is a lot of NaNs :o(. > > Am I doing something wrong, and should I set more parameters for > the cfg2 ??? > ___ > > When the problem with the freqanalysis is solved, I expect to be > able to make the plots this way - does it look right (the > testlay_64.lay file is one I have generated myself, and if I just > run the code with the TFRhann with all the NaNs, at least the > electrodes appear at the right location in the plot. > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0 0.5]; > cfg3.ylim = [1 29]; > cfg3.zlim = [-3e-27 3e-27]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > ___ > > I look forward to all suggestions regarding the problems with > "freqanalysis". > > Best regards, > Carina Graversen > Ph.D student at Aalborg Hospital, Denmark > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:00:35 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:00:35 +0200 Subject: Problems with frequency analysis... In-Reply-To: <3AD7A174-CE0B-41A2-B11E-557439220BB8@psy.gla.ac.uk> Message-ID: Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 12 14:13:06 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 12 Jun 2008 14:13:06 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612140035.n7s28eg6h0g0o8ks@webmail.kom.aau.dk> Message-ID: Hi Carina, I think this has nothing to do with the cfg settings of multiplot, but with the data that you are plotting. Did you first do time-frequency analysis? And what did you exactly plot? It looks like you plot the sinusoid itself isa the power of the sinusoid. Best Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 12, 2008 2:01 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Problems with frequency analysis... Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:17:07 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:17:07 +0200 Subject: Problems with frequency analysis... In-Reply-To: <003901c8cc85$abbac580$642dae83@fcdonders.nl> Message-ID: Hi Ingrid. First I extract the data by: dataFIC = preprocessing(cfg1); - And then overwrite the dataFIC.trial data with a sinusoid... Next I do a frequency analysis: TFRhann = freqanalysis(cfg2, dataFIC); And finally I try to plot the results of the frequency analysis: multiplotTFR(cfg3, TFRhann) I think this should plot the time-frequency results, right ??? Best regards, Carina Quoting Ingrid Nieuwenhuis : > Hi Carina, > > I think this has nothing to do with the cfg settings of multiplot, but with > the data that you are plotting. Did you first do time-frequency analysis? > And what did you exactly plot? It looks like you plot the sinusoid itself > isa the power of the sinusoid. > > Best Ingrid > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Carina Graversen > Sent: Thursday, June 12, 2008 2:01 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Problems with frequency analysis... > > Hi Jan. > > Thanks for your reply - that helped quite a lot :o). > > However, now I have another problem, when I want to plot the > time-frequency results. I use the code below, and as you will notice I > just load an .avg file, and overwrite all the data in the file to be a > single sinusoid with a frequency of 5 Hz. > > However, the results I get from multiplotTFR doesn't look as expected :o( > > The data I put in dataFIC.trial for all channels can be watched at: > http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg > > And the result from multiplot TFR can be seen at: > http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg > > - where I of course would have expected to have high power for all time > instances at a frequency of 5 Hz. So I was wondering if anyone can tell > which parameter to change in my configuration variables :o). > > Best regards, Carina > > > > > > > > function [] = diabetestest() > > close all > clear all > clc > > cfg1 = []; > cfg1.datafile = 'diabetestest.avg' > cfg1.headerfile = 'diabetestest.avg' > > dataFIC = preprocessing(cfg1); > > % ************************************************************************* > % ------------------------------ DEBUG CODE ------------------------------ > % ************************************************************************* > > test_frequency = 5; % Test frequency > sample_frequency = 1000; % Sample frequency > > % Generating the dummy signal: > for i = 1:301 > dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); > end > > for i = 1:1:68 > dummy_matrix(i, :) = dummy_signal; end > > dataFIC.trial{1} = dummy_matrix; > > figure(101) > plot(dummy_matrix(1, :), 'r') > > % ************************************************************************* > % --------------------------- END OF DEBUG CODE --------------------------- > % ************************************************************************* > > cfg2 = []; > cfg2.method = 'wltconvol'; %= 'mtmconvol'; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.foi = 0.1:0.05:20; > cfg2.toi = 0.050:0.001:0.300 > cfg2.width = 0.0005; > > TFRhann = freqanalysis(cfg2, dataFIC); > > % ------------------------------------------------------------------------- > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0.050 0.300]; > cfg3.ylim = [1 10]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > > % ------------------------------------------------------------------------- > > % cfg4 = []; > % cfg4.channel = 'FP1'; > % clf > % % singleplotTFR(cfg4, TFRhann); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > - - - Carina Graversen M.Sc. Biomedical Engineering, Ph.D. student Aalborg hospital +45 26282093 cgra05 at hst.auc.dk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 12 14:23:10 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 12 Jun 2008 14:23:10 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612141707.vd9suhwv9hzscs8w@webmail.kom.aau.dk> Message-ID: Hi Carina, I'm not a wavelet expert, but the cfg.width specification looks a bit odd to me. I would expect this to be an integer number, specifying the number of oscillation-cycles at each frequency. Irrespective of this, you might want to generate different surrogate data in the first place: the data segments are only 0.3 seconds long. This means that you can only optimally fit frequencies of multiples of 1/0.3, so 3.33333, 6.666667 etc. It only makes sense to try to estimate low frequency data, if the data segments are really long (and according to your specification this would be at least 20 seconds). Yours, Jan-Mathijs On Jun 12, 2008, at 2:17 PM, Carina Graversen wrote: > Hi Ingrid. > > First I extract the data by: > dataFIC = preprocessing(cfg1); > - And then overwrite the dataFIC.trial data with a sinusoid... > > Next I do a frequency analysis: > TFRhann = freqanalysis(cfg2, dataFIC); > > And finally I try to plot the results of the frequency analysis: > multiplotTFR(cfg3, TFRhann) > > > I think this should plot the time-frequency results, right ??? > > Best regards, Carina > > > > Quoting Ingrid Nieuwenhuis : > >> Hi Carina, >> >> I think this has nothing to do with the cfg settings of multiplot, >> but with >> the data that you are plotting. Did you first do time-frequency >> analysis? >> And what did you exactly plot? It looks like you plot the sinusoid >> itself >> isa the power of the sinusoid. >> >> Best Ingrid >> >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] >> On Behalf >> Of Carina Graversen >> Sent: Thursday, June 12, 2008 2:01 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] Problems with frequency analysis... >> >> Hi Jan. >> >> Thanks for your reply - that helped quite a lot :o). >> >> However, now I have another problem, when I want to plot the >> time-frequency results. I use the code below, and as you will >> notice I >> just load an .avg file, and overwrite all the data in the file to >> be a >> single sinusoid with a frequency of 5 Hz. >> >> However, the results I get from multiplotTFR doesn't look as >> expected :o( >> >> The data I put in dataFIC.trial for all channels can be watched at: >> http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg >> >> And the result from multiplot TFR can be seen at: >> http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg >> >> - where I of course would have expected to have high power for all >> time >> instances at a frequency of 5 Hz. So I was wondering if anyone can >> tell >> which parameter to change in my configuration variables :o). >> >> Best regards, Carina >> >> >> >> >> >> >> >> function [] = diabetestest() >> >> close all >> clear all >> clc >> >> cfg1 = []; >> cfg1.datafile = 'diabetestest.avg' >> cfg1.headerfile = 'diabetestest.avg' >> >> dataFIC = preprocessing(cfg1); >> >> % >> ********************************************************************* >> **** >> % ------------------------------ DEBUG CODE >> ------------------------------ >> % >> ********************************************************************* >> **** >> >> test_frequency = 5; % Test frequency >> sample_frequency = 1000; % Sample frequency >> >> % Generating the dummy signal: >> for i = 1:301 >> dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); >> end >> >> for i = 1:1:68 >> dummy_matrix(i, :) = dummy_signal; end >> >> dataFIC.trial{1} = dummy_matrix; >> >> figure(101) >> plot(dummy_matrix(1, :), 'r') >> >> % >> ********************************************************************* >> **** >> % --------------------------- END OF DEBUG CODE >> --------------------------- >> % >> ********************************************************************* >> **** >> >> cfg2 = []; >> cfg2.method = 'wltconvol'; %= >> 'mtmconvol'; >> cfg2.output = 'pow'; >> cfg2.channel = 'all'; >> cfg2.foi = 0.1:0.05:20; >> cfg2.toi = 0.050:0.001:0.300 >> cfg2.width = 0.0005; >> >> TFRhann = freqanalysis(cfg2, >> dataFIC); >> >> % >> --------------------------------------------------------------------- >> ---- >> >> cfg3.zparam = 'powspctrm'; >> cfg3.xlim = [0.050 0.300]; >> cfg3.ylim = [1 10]; >> cfg3.layout = 'testlay_64.lay'; >> cfg3.showlabels = 'yes'; >> >> multiplotTFR(cfg3, TFRhann) >> >> % >> --------------------------------------------------------------------- >> ---- >> >> % cfg4 = []; >> % cfg4.channel = 'FP1'; >> % clf >> % % singleplotTFR(cfg4, TFRhann); >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. >> > > > > - - - > Carina Graversen > M.Sc. Biomedical Engineering, Ph.D. student > Aalborg hospital > +45 26282093 > cgra05 at hst.auc.dk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Fri Jun 13 18:20:51 2008 From: findley at GMAIL.COM (Will Findley) Date: Fri, 13 Jun 2008 18:20:51 +0200 Subject: Using ICBM Probabilistic Atlases Message-ID: I would like to localize activity onto the ICBM probabilistic atlases from LONI. It is unclear to me how and where I should modify the DICS localization procedure to utilize them (particularly the tissue atlas). I also do not know how to obtain fiducial positions for them. Does anyone have experience localizing onto these atlases that would help? Thanks, Will ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:45:51 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:45:51 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Dear Will, I haven't use these particular atlases but I've recently worked on a similar problem. Basically you can interpolate your source data on any MRI. To do that you should set the source.transform field (where 'source' is beamformer output) to the transformation matrix from the coordinate system in which you did the beamformer to the coordinate system of the target MRI. Then you call sourceinterpolate() with that modified source struct and the target MRI as inputs. To get that transformation matrix you will need some fiducials and with that I can't help you. If that atlas has a corresponding structural image you can load that image with some software (I use SPM) and click on some landmarks to find their coordinates. You can then find the coordinates of the same landmarks in your beamformer coordinate system. Of course the precision of your coregistration will depend directly on how precisely you can define the fiducials in the two systems. Given at least 3 matching landmarks the transformation matrix can be computed. How it's done exactly depends on some details that I wouldn't like to get into here. If you don't get better help, write me and I can try to share what I know. Best, Vladimir On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: > I would like to localize activity onto the ICBM probabilistic atlases from > LONI. It is unclear to me how and where I should modify the DICS > localization procedure to utilize them (particularly the tissue atlas). I > also do not know how to obtain fiducial positions for them. Does anyone > have experience localizing onto these atlases that would help? > > Thanks, > Will > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:54:39 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:54:39 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Just one slightly simpler idea. If you have a structural image of your subject that you use for beamforming and there is a structural that comes with the atlas you can coregister these two (that can be done in SPM) and then (given that you know how the space of the subject's structural relates to the beamformer space) you won't need any fiducials. Best, Vladimir On Fri, Jun 13, 2008 at 6:45 PM, Vladimir Litvak wrote: > Dear Will, > > I haven't use these particular atlases but I've recently worked on a > similar problem. Basically you can interpolate your source data on any > MRI. To do that you should set the source.transform field (where > 'source' is beamformer output) to the transformation matrix from the > coordinate system in which you did the beamformer to the coordinate > system of the target MRI. Then you call sourceinterpolate() with that > modified source struct and the target MRI as inputs. > > To get that transformation matrix you will need some fiducials and > with that I can't help you. If that atlas has a corresponding > structural image you can load that image with some software (I use > SPM) and click on some landmarks to find their coordinates. You can > then find the coordinates of the same landmarks in your beamformer > coordinate system. Of course the precision of your coregistration will > depend directly on how precisely you can define the fiducials in the > two systems. Given at least 3 matching landmarks the transformation > matrix can be computed. How it's done exactly depends on some details > that I wouldn't like to get into here. > > If you don't get better help, write me and I can try to share what I know. > > Best, > > Vladimir > > > > > On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: >> I would like to localize activity onto the ICBM probabilistic atlases from >> LONI. It is unclear to me how and where I should modify the DICS >> localization procedure to utilize them (particularly the tissue atlas). I >> also do not know how to obtain fiducial positions for them. Does anyone >> have experience localizing onto these atlases that would help? >> >> Thanks, >> Will >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Mon Jun 16 18:59:40 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Mon, 16 Jun 2008 11:59:40 -0500 Subject: CMCorig data, Coherence Tutorial Message-ID: Jan-Mathijs - Thank you for responding. I have waited to reply as I have steadily worked my way through the Coherence Tutorial, and most all of the beamforming tutorial - there a major question at this point: My segmented MRI is never aligned with the MRI image it is derived from. I am using the program MRIcro to convert *.dcm files to an *.img file before I read it into fieldtrip using the read_fcdc_mri.m function. Then I segment using spm2 through fieldtrip's volumesegment.m function, and flip dimensions as discussed in the tutorial. This works correctly for the sample data, file Subject01.mri, but for my *.img files, when I use sourceplot to see if the segmented brain fits and the MRI are aligned correctly, they are unfortunately not. I have tried different flipping methods to no avail. Any suggestions? Thank you in advance, Nathan Dees ----- Original Message ----- From: "jan-mathijs schoffelen" To: Sent: Friday, May 09, 2008 3:39 AM Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > Dear Nathan, > > Indeed the CMCorig mat-file is missing from the ftp-server, but in > principle it can be generated by executing the preceding steps in the > tutorial. We will change the tutorial accordingly. Historically, the > tutorials have been used at the FCDC toolkit-courses for data analysis, > and students had the mat-file available to save some time. > However, from your mail I conclude that you had some problems running the > tutorial itself, probably unrelated to the (un)availability of the > CMCorig file. If so, could you just retry running the tutorial and let us > know whether and where specified problems arise? > > Thanks, > > Jan-Mathijs > > On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > >> How can one gain access to the dataset 'CMCorig' discussed in the >> tutorials, specifically the tutorial on Coherence? This file is not >> included in the SubjectCMC data posted on the tutorial data section of >> the >> website. >> >> Has anyone else had trouble running the Coherence tutorial from start to >> finish - I thought having access to this data might help me get through >> certain sections? >> >> Thank you >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Erick.Ortiz at MED.UNI-TUEBINGEN.DE Mon Jun 16 19:40:53 2008 From: Erick.Ortiz at MED.UNI-TUEBINGEN.DE (Erick Britis Ortiz) Date: Mon, 16 Jun 2008 19:40:53 +0200 Subject: bwlabeln / bug reports Message-ID: Hello all, About cluster-based statistics: when I set cfg.correctm = ‘cluster’, the funcion "findcluster" tries to call "bwlabeln", that is part of the Image Processing Toolbox. But this toolbox is not available to me at the moment. How to deal with that? Any alternatives to enable the use of cluster-based statistics? I also would like to contribute some bug reports (even solutions!), so should I submit them to the list or is there some web interface or a person to whom to send them directly? Best, Erick ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Jun 17 08:24:14 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 17 Jun 2008 08:24:14 +0200 Subject: bwlabeln / bug reports In-Reply-To: <4856A5A5.2050205@med.uni-tuebingen.de> Message-ID: Hi, > About cluster-based statistics: when I set cfg.correctm = ‘cluster’, > the funcion "findcluster" tries to call "bwlabeln", that is part of > the Image Processing Toolbox. But this toolbox is not available to > me at the moment. you may try running your (cluster-stats) code in Octave: http://www.octave.org/ the code is usually very compatible and sometimes only needs a little tweaking. don't forget to also download octaveforge which should have image processing functions included. here is a reference of available functions: http://octave.sourceforge.net/doc/index.html good luck, nathan > > > How to deal with that? Any alternatives to enable the use of cluster- > based statistics? > > > I also would like to contribute some bug reports (even solutions!), > so should I submit them to the list or is there some web interface > or a person to whom to send them directly? > > > Best, > Erick > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Thu Jun 19 12:09:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 19 Jun 2008 12:09:43 +0200 Subject: MEG's Lead Field Message-ID: An HTML attachment was scrubbed... URL: From soren.r.christensen at GSK.COM Thu Jun 19 13:04:22 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Thu, 19 Jun 2008 12:04:22 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 18-Jun-2008 and will not return until 24-Jun-2008. I'll be back June 24th ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Jun 20 16:34:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 20 Jun 2008 16:34:43 +0200 Subject: Lead Field Message-ID: Hi everybody I tested the leadfield routine (compute_leadfield.m) for current dipole in MEG forward solution. How are the units expressed? I expect the current dipole to be expressed in nA.m according to CTF convention (i am using a 275 channels MEG CTF system), the gradiometers' positions in cm and the lead field in Tesla. Nevertheless i compared it with CTF software and there is quite a high mismatch in the scaling factor, and the field is not perfectly distributed as in CTF software forward solution. In the Fieldtrip documentation it is mentioned a leadfield computation method from Lütkenhöner, Habilschrift '92 which i could not find. How do i get to the article? I attach the code: dip_pos = [2 2 10]; % cm dip_mom = [10 0 0]; % 10 nA*m % grad: gradiometers structure % vol: conductive sphere model lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Fri Jun 20 19:10:51 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Fri, 20 Jun 2008 18:10:51 +0100 Subject: Lead Field In-Reply-To: Message-ID: Hi Cristiano, I'll attempt to help you with this but I'd also appreciate some input on this topic from others on the list to check my thinking is correct. I think your strange results are due to the mixing of several different units of measurement. If the positions of sensor and source are expressed in metres and the dipole moment in A-m (i.e. all in standard units), then the field strengths due to the source as calculated by compute_leadfield.m will be in Tesla. Of course, you can use cm or mm for your scale but that will just linearly scale the field values, i.e. converting the distances from metres to cm (increase of 10^2) will _decrease_ the field values (reduction of 10^2) if the same moment value is specified in both calculations. Similarly, expressing the moment in units of nA-m will also scale the field values linearly, but in that case it will increase the fields by 10^9 relative to the same moment expressed in A-m. For your example the use of cm will decrease the field values by 10^2 and specifiying the dipole moment in nA-m will increase it by 10^9 - all this is relative to standard units. Therefore, if interpreted as Teslas, your fields are probably too large by a factor of 10^7 for your desired source stregth of 10nA-m. You could standardise your units by multiplying the resultant fields by 1e-7 or by using the following when you compute them: dip_mom = [1e-8 0 0]; % 10 nA-m as A-m but presumably as your sensor positions and orientations are in cm so you could either convert them and the dipole position to metres beforehand, or otherwise if you use the above moment value you will still have to multiply the resulting fields by 10^2 to compensate for the cm scaling, which should give you reasonable field strengths in Tesla. Hope that helps and does not confuse, Padraig Cristiano Micheli wrote: > Hi everybody > I tested the leadfield routine (compute_leadfield.m) for current dipole in > MEG forward solution. > How are the units expressed? > I expect the current dipole to be expressed in nA.m according to CTF > convention (i am using a 275 channels MEG CTF system), the gradiometers' > positions in cm and the lead field in Tesla. > Nevertheless i compared it with CTF software and there is quite a high > mismatch in the scaling factor, and the field is not perfectly distributed > as in CTF software forward solution. > In the Fieldtrip documentation it is mentioned a leadfield computation > method from Lütkenhöner, Habilschrift '92 which i could not find. How do i > get to the article? > I attach the code: > > dip_pos = [2 2 10]; % cm > dip_mom = [10 0 0]; % 10 nA*m > % grad: gradiometers structure > % vol: conductive sphere model > lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Jun 20 21:01:12 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 20 Jun 2008 14:01:12 -0500 Subject: Lead Field In-Reply-To: <485BE49B.9060204@psych.york.ac.uk> Message-ID: Greetings Padgaig, thank you for that explanation. I am analysing some MEG/EEG data using EEGLAB (which incorporates several Fieldtrip routines!). When I exported the data to SPSS-PC and graphs show values in the 10,000 and 100,000 micro volt range. EEG data was gathered together with the MEG in a MEG chamber. Am I seeing the same issue there or is it something else. I appreciate any help. regards gopa Quoting Pádraig Kitterick : > Hi Cristiano, > > I'll attempt to help you with this but I'd also appreciate some input > on > this topic from others on the list to check my thinking is correct. > > I think your strange results are due to the mixing of several > different > units of measurement. If the positions of sensor and source are > expressed in metres and the dipole moment in A-m (i.e. all in > standard > units), then the field strengths due to the source as calculated by > compute_leadfield.m will be in Tesla. Of course, you can use cm or mm > > for your scale but that will just linearly scale the field values, > i.e. > converting the distances from metres to cm (increase of 10^2) will > _decrease_ the field values (reduction of 10^2) if the same moment > value > is specified in both calculations. Similarly, expressing the moment > in > units of nA-m will also scale the field values linearly, but in that > > case it will increase the fields by 10^9 relative to the same moment > > expressed in A-m. > > For your example the use of cm will decrease the field values by 10^2 > > and specifiying the dipole moment in nA-m will increase it by 10^9 - > all > this is relative to standard units. Therefore, if interpreted as > Teslas, > your fields are probably too large by a factor of 10^7 for your > desired > source stregth of 10nA-m. You could standardise your units by > multiplying the resultant fields by 1e-7 or by using the following > when > you compute them: > > dip_mom = [1e-8 0 0]; % 10 nA-m as A-m > > but presumably as your sensor positions and orientations are in cm so > > you could either convert them and the dipole position to metres > beforehand, or otherwise if you use the above moment value you will > still have to multiply the resulting fields by 10^2 to compensate for > > the cm scaling, which should give you reasonable field strengths in > Tesla. > > Hope that helps and does not confuse, > > Padraig > > Cristiano Micheli wrote: > > Hi everybody > > I tested the leadfield routine (compute_leadfield.m) for current > dipole in > > MEG forward solution. > > How are the units expressed? > > I expect the current dipole to be expressed in nA.m according to > CTF > > convention (i am using a 275 channels MEG CTF system), the > gradiometers' > > positions in cm and the lead field in Tesla. > > Nevertheless i compared it with CTF software and there is quite a > high > > mismatch in the scaling factor, and the field is not perfectly > distributed > > as in CTF software forward solution. > > In the Fieldtrip documentation it is mentioned a leadfield > computation > > method from Lütkenhöner, Habilschrift '92 which i could not find. > How do i > > get to the article? > > I attach the code: > > > > dip_pos = [2 2 10]; % cm > > dip_mom = [10 0 0]; % 10 nA*m > > % grad: gradiometers structure > > % vol: conductive sphere model > > lf = compute_leadfield(dip_pos, grad, vol, > 'singlesphere','yes')*dip_mom'; > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 13:09:43 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 12:09:43 +0100 Subject: Lead Field In-Reply-To: <1213988472.485bfe7830cfe@bamamail.ua.edu> Message-ID: I honestly couldn't say without knowing more about the way in which the data was processed (not too familiar with EEGLAB), but it seems as if you are referring to raw data and not leadfield calculations. Therefore, it's unlikely that the issues discussed previously would be affecting you. Padraig Gopakumar Venugopalan wrote: > Greetings Padgaig, thank you for that explanation. I am analysing some > MEG/EEG data using EEGLAB (which incorporates several Fieldtrip > routines!). When I exported the data to SPSS-PC and graphs show values > in the 10,000 and 100,000 micro volt range. EEG data was gathered > together with the MEG in a MEG chamber. Am I seeing the same issue > there or is it something else. I appreciate any help. > regards > gopa > > > Quoting Pádraig Kitterick : > >> Hi Cristiano, >> >> I'll attempt to help you with this but I'd also appreciate some input >> on >> this topic from others on the list to check my thinking is correct. >> >> I think your strange results are due to the mixing of several >> different >> units of measurement. If the positions of sensor and source are >> expressed in metres and the dipole moment in A-m (i.e. all in >> standard >> units), then the field strengths due to the source as calculated by >> compute_leadfield.m will be in Tesla. Of course, you can use cm or mm >> >> for your scale but that will just linearly scale the field values, >> i.e. >> converting the distances from metres to cm (increase of 10^2) will >> _decrease_ the field values (reduction of 10^2) if the same moment >> value >> is specified in both calculations. Similarly, expressing the moment >> in >> units of nA-m will also scale the field values linearly, but in that >> >> case it will increase the fields by 10^9 relative to the same moment >> >> expressed in A-m. >> >> For your example the use of cm will decrease the field values by 10^2 >> >> and specifiying the dipole moment in nA-m will increase it by 10^9 - >> all >> this is relative to standard units. Therefore, if interpreted as >> Teslas, >> your fields are probably too large by a factor of 10^7 for your >> desired >> source stregth of 10nA-m. You could standardise your units by >> multiplying the resultant fields by 1e-7 or by using the following >> when >> you compute them: >> >> dip_mom = [1e-8 0 0]; % 10 nA-m as A-m >> >> but presumably as your sensor positions and orientations are in cm so >> >> you could either convert them and the dipole position to metres >> beforehand, or otherwise if you use the above moment value you will >> still have to multiply the resulting fields by 10^2 to compensate for >> >> the cm scaling, which should give you reasonable field strengths in >> Tesla. >> >> Hope that helps and does not confuse, >> >> Padraig >> >> Cristiano Micheli wrote: >>> Hi everybody >>> I tested the leadfield routine (compute_leadfield.m) for current >> dipole in >>> MEG forward solution. >>> How are the units expressed? >>> I expect the current dipole to be expressed in nA.m according to >> CTF >>> convention (i am using a 275 channels MEG CTF system), the >> gradiometers' >>> positions in cm and the lead field in Tesla. >>> Nevertheless i compared it with CTF software and there is quite a >> high >>> mismatch in the scaling factor, and the field is not perfectly >> distributed >>> as in CTF software forward solution. >>> In the Fieldtrip documentation it is mentioned a leadfield >> computation >>> method from Lütkenhöner, Habilschrift '92 which i could not find. >> How do i >>> get to the article? >>> I attach the code: >>> >>> dip_pos = [2 2 10]; % cm >>> dip_mom = [10 0 0]; % 10 nA*m >>> % grad: gradiometers structure >>> % vol: conductive sphere model >>> lf = compute_leadfield(dip_pos, grad, vol, >> 'singlesphere','yes')*dip_mom'; >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> -- >> Pádraig Kitterick >> Graduate Student >> Department of Psychology >> University of York >> Heslington >> York YO10 5DD >> UK >> >> Tel: +44 (0) 1904 43 3170 >> Email: p.kitterick at psych.york.ac.uk >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 15:46:08 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 15:46:08 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: <007e01c8cfd2$5dd01960$2d01a8c0@DGDPBS81> Message-ID: Dear Nathan, Indeed, the flipping as applied in the tutorial should be applied for volumes, segmented from .mri files. This has an obscure reason, which I never managed to find. Importantly, the flipping has to be applied in order for the transformation-matrix, as stored in mri.transform (or segment.transform), to correctly transform from volume-based voxel indices into head-space. Did you check, whether the segmentation itself worked? In other words, do the gray/white/csf volumes look reasonable with respect to the anatomy from which it is derived? As far as I know, the spm segmentation routine which is used by fieldtrip, matches the input anatomy to some gray/white/csf template volumes, but assumes a quite good coregistration between the templates and the input volume, both in terms of coordinate-frame (which should be spm-based), and in the way the volumetric data are stored physically in the data-matrix. These issues are taken care of when volumesegment is instructed to interpret the coordinate-system as being 'ctf'-based, either by some user-interactions prompted when the function is executed, or by explicitly putting cfg.coordinates to 'ctf'. You mention you convert your dicoms to analyze format, but this step in itself does not tell fieldtrip how to interpret the volumetric data. Does the image have a transformation matrix attached when loaded in? If not, you should probably first need to use volumerealign to specify the fiducial locations. This will give you a transformation matrix attached to the mri according to ctf-conventions. Next volumesegment should be called with cfg.coordinates = 'ctf'. Hope this helps, Jan-Mathijs On Jun 16, 2008, at 6:59 PM, Nathan Dees wrote: > Jan-Mathijs - > > Thank you for responding. I have waited to reply as I have > steadily worked my way through the Coherence > Tutorial, and most all of the beamforming tutorial - there a major > question at this point: > > My segmented MRI is never aligned with the MRI image it is derived > from. I am using the program MRIcro to convert *.dcm files to an > *.img file before I read it into fieldtrip using the > read_fcdc_mri.m function. Then I segment using spm2 through > fieldtrip's volumesegment.m function, and flip dimensions as > discussed in the tutorial. This works correctly for the sample > data, file Subject01.mri, but for my *.img files, when I use > sourceplot to see if the segmented brain fits and the MRI are > aligned correctly, they are unfortunately not. I have tried > different flipping methods to no avail. > > Any suggestions? > > Thank you in advance, > Nathan Dees > > > > ----- Original Message ----- From: "jan-mathijs schoffelen" > > To: > Sent: Friday, May 09, 2008 3:39 AM > Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > > >> Dear Nathan, >> >> Indeed the CMCorig mat-file is missing from the ftp-server, but in >> principle it can be generated by executing the preceding steps in the >> tutorial. We will change the tutorial accordingly. Historically, the >> tutorials have been used at the FCDC toolkit-courses for data >> analysis, >> and students had the mat-file available to save some time. >> However, from your mail I conclude that you had some problems >> running the >> tutorial itself, probably unrelated to the (un)availability of the >> CMCorig file. If so, could you just retry running the tutorial >> and let us >> know whether and where specified problems arise? >> >> Thanks, >> >> Jan-Mathijs >> >> On May 7, 2008, at 12:54 AM, Nathan Dees wrote: >> >>> How can one gain access to the dataset 'CMCorig' discussed in the >>> tutorials, specifically the tutorial on Coherence? This file is not >>> included in the SubjectCMC data posted on the tutorial data >>> section of >>> the >>> website. >>> >>> Has anyone else had trouble running the Coherence tutorial from >>> start to >>> finish - I thought having access to this data might help me get >>> through >>> certain sections? >>> >>> Thank you >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of >>> the FieldTrip toolbox, to share experiences and to discuss new >>> ideas >>> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Mon Jun 23 15:59:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Mon, 23 Jun 2008 15:59:20 +0200 Subject: Lead Field Message-ID: Hi Pádraig Thank you for the answer. It helped to fix the scaling factor. Now i get a magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick up coils (with Fieldtrip routine). Still i cannot get the same field as for the CTF software. In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. I think the two routines use different equations. CTF implements Sarvas' forward model for a spherical conductor in a homogeneus medium ("Basic mathematical and electromagnetic concepts of the biomagnetic inverse problem", Sarvas J, 1987). I cannot get to the source of Fieldtrip's method for the forward model, which is mentioned in meg_leadfield1.m routine head comment (adapted from Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. I found from Lütkenhöner : "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: LIT-Verlag, 1992 Unfortunately i do not have access neither to the book nor to formulas. How can i check it? If it does not depend on implementation details (which sounds also plausible since the error is quite high), what can be again the problem to make the two fields match? Thank you Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 16:16:33 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 15:16:33 +0100 Subject: Lead Field In-Reply-To: Message-ID: The method implemented in meg_leadfield1.m gives the same result as the equations of Sarvas. It's just a different formulation of the forward problem. I've produced identical leadfields calculated with several different packages, including fieldtrip, and also a direct implementation of the Sarvas equations. It is possible that the CTF software is accounting for the coil loop radii and other machine-specific inputs to the calculations, but these rarely change the fields by large amounts. Are you using the same sphere to approximate the head in both instances? The meg_leadfield1.m code assumes that the centre of the single sphere is at the origin, (0,0,0). If the centre of the sphere isn't at the origin, then you need to adjust the dipole and sensor locations by subtracting the centre of the sphere from their coordinates. The CTF system could well be doing this adjustment using a pre-programmed sphere centre based on either a general estimation or coregistration information it has available to it. Unless you can access all the information that it is using to do the calculations, it will be very hard to get identical answers. The best thing is to ensure that you have a good estimate of the centre of the single sphere for your sensor array based on an average head/brain or a particular subject you are trying to model. Then your fields will be as accurate, despite not being identical in absolute numerical values to those produced by the CTF software. Padraig Cristiano Micheli wrote: > Hi Pádraig > Thank you for the answer. It helped to fix the scaling factor. Now i get a > magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick > up coils (with Fieldtrip routine). > Still i cannot get the same field as for the CTF software. > In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 > channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. > I think the two routines use different equations. CTF implements Sarvas' > forward model for a spherical conductor in a homogeneus medium ("Basic > mathematical and electromagnetic concepts of the biomagnetic inverse > problem", Sarvas J, 1987). > I cannot get to the source of Fieldtrip's method for the forward model, > which is mentioned in meg_leadfield1.m routine head comment (adapted from > Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. > I found from Lütkenhöner : > "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: > LIT-Verlag, 1992 > Unfortunately i do not have access neither to the book nor to formulas. > How can i check it? > If it does not depend on implementation details (which sounds also plausible > since the error is quite high), what can be again the problem to make the > two fields match? > Thank you > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 16:20:24 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 16:20:24 +0200 Subject: Lead Field In-Reply-To: <485FB041.7050101@psych.york.ac.uk> Message-ID: Hi guys, May I quickly add to the discussion that I remember having seen that Cristiano uses myhead.hdm as an input to prepare_headmodel, and the resulting vol-structure for compute_leadfield. Is myhead.hdm a multisphere model? Just to be sure: The call to compute_leadfield with additional inputs 'singlesphere' 'yes' does not lead to a single-sphere-based leadfield, as far as I know. Single sphericity is only ensured when vol contains just one .o, and one .r. Yours, JM On Jun 23, 2008, at 4:16 PM, Pádraig Kitterick wrote: > The method implemented in meg_leadfield1.m gives the same result as > the equations of Sarvas. It's just a different formulation of the > forward problem. I've produced identical leadfields calculated with > several different packages, including fieldtrip, and also a direct > implementation of the Sarvas equations. > > It is possible that the CTF software is accounting for the coil > loop radii and other machine-specific inputs to the calculations, > but these rarely change the fields by large amounts. Are you using > the same sphere to approximate the head in both instances? The > meg_leadfield1.m code assumes that the centre of the single sphere > is at the origin, (0,0,0). If the centre of the sphere isn't at the > origin, then you need to adjust the dipole and sensor locations by > subtracting the centre of the sphere from their coordinates. The > CTF system could well be doing this adjustment using a pre- > programmed sphere centre based on either a general estimation or > coregistration information it has available to it. Unless you can > access all the information that it is using to do the calculations, > it will be very hard to get identical answers. > > The best thing is to ensure that you have a good estimate of the > centre of the single sphere for your sensor array based on an > average head/brain or a particular subject you are trying to model. > Then your fields will be as accurate, despite not being identical > in absolute numerical values to those produced by the CTF software. > > Padraig > > Cristiano Micheli wrote: >> Hi Pádraig >> Thank you for the answer. It helped to fix the scaling factor. Now >> i get a >> magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far >> from the pick >> up coils (with Fieldtrip routine). >> Still i cannot get the same field as for the CTF software. In CTF >> leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 >> channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. >> I think the two routines use different equations. CTF implements >> Sarvas' >> forward model for a spherical conductor in a homogeneus medium >> ("Basic >> mathematical and electromagnetic concepts of the biomagnetic inverse >> problem", Sarvas J, 1987). >> I cannot get to the source of Fieldtrip's method for the forward >> model, >> which is mentioned in meg_leadfield1.m routine head comment >> (adapted from >> Luetkenhoener, Habilschrift '92). It sounds like an habilitation >> work. >> I found from Lütkenhöner : >> "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", >> Münster: >> LIT-Verlag, 1992 >> Unfortunately i do not have access neither to the book nor to >> formulas. >> How can i check it? If it does not depend on implementation >> details (which sounds also plausible >> since the error is quite high), what can be again the problem to >> make the >> two fields match? >> Thank you >> Cristiano >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 14:51:50 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 14:51:50 +0200 Subject: Lead Field Message-ID: No it's a single sphere head model (only one radius). Actually i had in mind to generate an equivalent multisphere model to test the difference of the two solutions (one sphere-multisphere). I am running a dics with an external reference channel in a isometric pinch protocol and i want to verify what i find with coherence analysis (controlateral M1 activation). Moreover i wanted to find the ipsilateral M1 and cerebellum activations applying a 'stereo' dics. Do you know if this method is already implemented in Fieldtrip? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 15:10:31 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 15:10:31 +0200 Subject: Lead Field Message-ID: ..and i fixed the problem with the lead field. I simply had to set the right grad.tra matrix Since i discovered that [eye(275) -eye(275)] does not give the right results i looked inside the orientations of the magnetometers and i discovered that they are randomly pointing upwards or inwards. I fixed it and now the results match with ctf software. Thank you for the advices. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From myles.reilly at HSC.UTAH.EDU Tue Jun 24 23:29:36 2008 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 24 Jun 2008 23:29:36 +0200 Subject: Neuromag coherence Message-ID: Hi, The tutorial Analysis of corticomuscular coherence shows the methods for computing coherence between MEG and a single EMG channel. I have tried to fit Neuromag / EMG data through the same routines without success. There are too many errors to bother listing at this point. Has anyone else been able to accomplish this? Thanks, Myles ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Wed Jun 25 00:12:10 2008 From: findley at GMAIL.COM (Will Findley) Date: Wed, 25 Jun 2008 00:12:10 +0200 Subject: Co-registration of fiducials for leadfields Message-ID: As best I can tell, before calculating the leadfields for the forward model, the sensor positions are adjusted by the center of the spherical head approximation as such: lines 201-205 in compute_leadfield.m if isfield(vol, 'o') % shift dipole and magnetometers to origin of sphere pos = pos - repmat(vol.o, Ndipoles, 1); pnt = pnt - repmat(vol.o, size(pnt,1), 1); end However, I can't find where the modification occurs to vol.o (the sphere's origin determined in read_ctf_hdm.m) to take into account aligning the fiducials for the spherical head model to the head coil positions during the scan. Does anyone know where this calculation is performed? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.hesse at FCDONDERS.RU.NL Wed Jun 25 08:33:42 2008 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 25 Jun 2008 08:33:42 +0200 Subject: Neuromag coherence In-Reply-To: Message-ID: Hi Myles, without a clearer description of the errors you get it is of course difficult to offer advice; however, people have often reported difficulty in reading the MEG data from Neuromag systems into Fieldtrip. You can check the discussion list archive for posts related to the issues regarding reading Neuromag data into FT. Once the data has been read in successfully, you should not encounter any problems, as all the computations are not data format specific, and work. Regards, Christian On 24 Jun 2008, at 23:29, Myles Reilly wrote: > Hi, > > The tutorial Analysis of corticomuscular coherence shows the > methods for > computing coherence between MEG and a single EMG channel. I have tried > to fit Neuromag / EMG data through the same routines without success. > There are too many errors to bother listing at this point. > > Has anyone else been able to accomplish this? > > Thanks, > > Myles > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Wed Jun 25 12:26:22 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Wed, 25 Jun 2008 12:26:22 +0200 Subject: Neuromag coherence Message-ID: Hi All I checked the tutorials: "Localizing oscillatory sources using beamformer techniques" and "Analysis of corticomuscular coherence" and it seems that cortico-muscular coherence calculations and dics have to do with sourceanalysis.m routine. I managed to have it working after having calculated frequency power spectra and cross-spectral densities as inputs for this function. After i select the other inputs (head model, gradiometer's positions, lambda) i have to set a frequency upon which to let the dics run (i selected, like in the examples, the peak of maximal coherence spectra). The result of the run is a 3D map of coherence or power activities for every point inside the head grid and i used a scatter3.m to visualize it, not to mess up with the co-registration of MRI images (the next step i will speak about). I compared the result with a coherence topography calculated with CTF software and i get an activation in the controlateral area with a clear dipolar shape. Unfortunately i do not see an equivalent in the same position for the DICS output. Reading the documentation i realised that it can be because of a biasing of the spatial filter toward the center of the sphere. I recalculated the dics with a baseline condition and after all i subtracted it from the task activation, still the result is far away from being a localized source activity, according to me. I also tried with different lambda but the result is not localized. How can i fix it? Thanks in advance for the help Sincerely, Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 00:09:33 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 00:09:33 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, For my bachelor's assignment, I'm trying to find a visual stimulus of a hand movement that triggers the 'largest' modulation of the EEG. I.e. , when the subject looks at a right hand movement, literature suggest a decrease in power in the 8-13 Hz band, relative to a baseline period around electrode position C3. I'm trying to use Fieldtrip's freqstatistics.m function to test this decrease in power for significance. Following a tutorial in the Fieldtrip wiki, http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments which I thought applied to my situation gave me a lot of error messages. I've already redefined my trials, so I have a separate set of trials, one containing 2 seconds of baseline, and one containing 2 seconds of stimulus. The baseline time axis is shifted so it overlaps the stimulus time axis I then use this code to calculate TFR's for those datasets: cfgfreq.method = 'mtmconvol'; cfgfreq.output = 'pow' ; cfgfreq.taper = ' hanning' ; cfgfreq.foi = 8:1:13; cfgfreq.t_ftimwin = 10./cfgfreq.foi; cfgfreq.toi = 5:1/100:7; cfgfreq.tapsmofrq = cfgfreq.foi*0.4; [baselineTFR] = freqanalysis(cfgfreq,baselinedata); [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); And then I have to do the significance test. cfg = []; sfg.method = 'analytic'; cfg.statistics = 'actvsblT'; cfg.alpha = 0.05; ? [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); I think I have to do something with the design matrix, but I can't find anything about that in the wiki (or the rest of the internet). Thanks, Thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Thu Jun 26 08:45:06 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 26 Jun 2008 08:45:06 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 09:29:16 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 09:29:16 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, I'm currently in the pilot phase, testing various stimuli on myself and my supervisor. I want to do this analysis to get an indication which stimulus has the best potential, so I can test that on a sufficient large group. The data I'm testing the statistical analysis script on consists of 50 trials, the subject was asked to perform motor imagery while looking at the screen. Each trial consists of 3 seconds baseline (empty background on screen) and 5 seconds stimulus ( hand squeezing a ball on screen). I don't need the TFR's of the individual trials, since the mean TFR will (that's what I expect) show a more prominent in power in the 8-13 Hz band when I compare baseline vs stimulus. The error message I get when I run the script now is: ??? Undefined variable "data" or class "data.biol". Error in ==> prepare_design at 92 nrepl=size(data.biol,1); Error in ==> statistics_wrapper at 238 [cfg] = prepare_design(cfg); Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> fieldtripstatanalyse at 36 [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); Thanks for your input, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Nathan Weisz Verzonden: do 26-6-2008 8:45 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: Re: [FIELDTRIP] Significance test frequency power decrease baseline vs stimulation hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:36:30 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:36:30 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: Dear Thomas, It's hard to say what's going wrong, but I would suggest a different approach in the first place. I could imagine that you are interested in the first place whether there's a difference in activation vs. baseline, and not so much in the moment in time that this occurs. Then the player of my choice would be freqanalysis_mtmfft. In that case you collapse over the time dimension, and increase your statistical power. Importantly, using either approach, I believe it is mandatory to use equal length trials in both 'conditions'. I don't believe this causes your error message but I see that you use different length trials and will lead to problems when the current problem is fixed and you proceed in the function. As I said I would try to run freqanalysis with cfg.method = 'mtmfft'. As Nathan pointed out, it is mandatory to do cfg.keeptrials = 'yes', otherwise you cannot do any statistics. (This is also the case when you would use mtmconvol). This is a very important notion. Otherwise it would just suffice to look at the difference of the averages. The fact that you want to compute a T-value implies that you want to take the variance across trials into account, and therefore you need 'keeptrials' = 'yes' (This could very well be the cause of your problem). Then I would call freqstatistics with either cfg.statistic = 'depsamplesT' (when you have paired observations) or cfg.statistic='indepsamplesT' (when the observations are unpaired). As a sidestep, when encountering errors in general, it might make sense to use matlab's debugging functionality. When you type on the commandline 'dbstop if error' before running your analysis script, matlab enters the debugging mode when an error is encountered. This means that you stick to the local workspace of the function in which the error occurred, and you can see what is going wrong. In your case apparently there is no variable called data present in the workspace for the function prepare_design. You can toggle up and down between the calling functions by using dbup and dbdown. This usually gives useful information and points to the core of the problem. This can be both handy for yourself (you might be able to solve the problem yourself) or for anybody trying to help from a distance. Anyway, something seems to go wrong in prepare_design. I'd rather fix this if I were you, but you could also see whether you can bypass this problem when specifying a design in your configuration for freqstatistics. This will bypass the function prepare_design altogether. There is some information on the fieldtrip wiki in the tutorial about cluster-based permutation tests. You could also type help prepare_design in the matlab commandline. I hope this helps, Jan-Mathijs On Jun 26, 2008, at 9:29 AM, Thomas Dijkman wrote: > Hi, > > I'm currently in the pilot phase, testing various stimuli on myself > and my supervisor. I want to do this analysis to get an indication > which stimulus has the best potential, so I can test that on a > sufficient large group. > > The data I'm testing the statistical analysis script on consists of > 50 trials, the subject was asked to perform motor imagery while > looking at the screen. Each trial consists of 3 seconds baseline > (empty background on screen) and 5 seconds stimulus ( hand > squeezing a ball on screen). > I don't need the TFR's of the individual trials, since the mean TFR > will (that's what I expect) show a more prominent in power in the > 8-13 Hz band when I compare baseline vs stimulus. > > The error message I get when I run the script now is: > > ??? Undefined variable "data" or class "data.biol". > > Error in ==> prepare_design at 92 > nrepl=size(data.biol,1); > > Error in ==> statistics_wrapper at 238 > [cfg] = prepare_design(cfg); > > Error in ==> freqstatistics at 132 > [stat] = statistics_wrapper(cfg, varargin{:}); > > Error in ==> fieldtripstatanalyse at 36 > [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); > > Thanks for your input, > > Thomas > > > -----Oorspronkelijk bericht----- > Van: FieldTrip discussion list namens Nathan Weisz > Verzonden: do 26-6-2008 8:45 > Aan: FIELDTRIP at NIC.SURFNET.NL > Onderwerp: Re: [FIELDTRIP] Significance test frequency power > decrease baseline vs stimulation > > hi, > > you want individual subject stats? i'm pretty sure then that you need > to add something like > cfg.keeptrials='yes'; > when doing your freqanalysis. > > btw, adding the actual error message is also a good idea when posting > questions. > > good luck, > n > > > On 26.06.2008, at 00:09, Thomas Dijkman wrote: > >> Hi, >> >> For my bachelor's assignment, I'm trying to find a visual stimulus >> of a hand >> movement that triggers the 'largest' modulation of the EEG. I.e. , >> when the >> subject looks at a right hand movement, literature suggest a >> decrease in >> power in the 8-13 Hz band, relative to a baseline period around >> electrode >> position C3. >> I'm trying to use Fieldtrip's freqstatistics.m function to test this >> decrease in power for significance. Following a tutorial in the >> Fieldtrip wiki, >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_p >> ermutation_tests_for_time- >> frequency_representationswithin_trial_experiments >> >> which I thought applied to my situation gave me a lot of error >> messages. >> >> I've already redefined my trials, so I have a separate set of >> trials, one >> containing 2 seconds of baseline, and one containing 2 seconds of >> stimulus. >> The baseline time axis is shifted so it overlaps the stimulus time >> axis >> >> I then use this code to calculate TFR's for those datasets: >> >> cfgfreq.method = 'mtmconvol'; >> cfgfreq.output = 'pow' ; >> cfgfreq.taper = ' hanning' ; >> cfgfreq.foi = 8:1:13; >> cfgfreq.t_ftimwin = 10./cfgfreq.foi; >> cfgfreq.toi = 5:1/100:7; >> cfgfreq.tapsmofrq = cfgfreq.foi*0.4; >> [baselineTFR] = freqanalysis(cfgfreq,baselinedata); >> [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); >> >> And then I have to do the significance test. >> >> cfg = []; >> sfg.method = 'analytic'; >> cfg.statistics = 'actvsblT'; >> cfg.alpha = 0.05; >> ? >> [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); >> >> I think I have to do something with the design matrix, but I can't >> find >> anything about that in the wiki (or the rest of the internet). >> >> Thanks, >> >> Thomas >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------- > Dr. Nathan Weisz > > INSERM - Unité 821 > Dynamique cérébrale et cognition > Centre Hospitalier Le Vinatier, Bâtiment 452 > 95 Boulevard Pinel > 69500 Bron, France > > Tel: ++33 - (0)4 - 7213 8915 > Email: nathan.weisz at inserm.fr > Chat-AV: nathanweisz at mac.com > Homepage: http://web.mac.com/nathanweisz > Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 > > Please avoid sending me Word or PowerPoint attachments. > See http://www.gnu.org/philosophy/no-word-attachments.html > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:48:57 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:48:57 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I took the liberty to change the subject of your posting into a more appropriate one. Did you have a look at the topography of the coherence on the scalp, using fieldtrip. This is a first check I would do, to get an indication that at least the other important ingredient to the beamformer (apart from the leadfields), i.e. the csd, has been computed more or less ok. Two additional points: you mention something about the coregistration with the MRI. It is of course extremely important that your volume conductor model is aligned with the MRI. Checking the topography of the scalp level CMC using CTF's software does not guarantee this. Second point: spatial filters are biased towards the depth and therefore people often use quantities like pseudo-T/F/Z, neural activity indices, constrast between conditions, or normalised leadfields in order to make sense out of the volumetric images. However, coherence is normalised for the power by definition, so I would not expect a problem per se in the visualisation. Yours, Jan-Mathijs On Jun 25, 2008, at 12:26 PM, Cristiano Micheli wrote: > Hi All > I checked the tutorials: > "Localizing oscillatory sources using beamformer techniques" and > "Analysis > of corticomuscular coherence" and it seems that cortico-muscular > coherence > calculations and dics have to do with sourceanalysis.m routine. > I managed to have it working after having calculated frequency > power spectra > and cross-spectral densities as inputs for this function. > After i select the other inputs (head model, gradiometer's positions, > lambda) i have to set a frequency upon which to let the dics run (i > selected, like in the examples, the peak of maximal coherence > spectra). > The result of the run is a 3D map of coherence or power activities > for every > point inside the head grid and i used a scatter3.m to visualize it, > not to > mess up with the co-registration of MRI images (the next step i > will speak > about). > I compared the result with a coherence topography calculated with CTF > software and i get an activation in the controlateral area with a > clear > dipolar shape. > Unfortunately i do not see an equivalent in the same position for > the DICS > output. > Reading the documentation i realised that it can be because of a > biasing of > the spatial filter toward the center of the sphere. I recalculated > the dics > with a baseline condition and after all i subtracted it from the task > activation, still the result is far away from being a localized source > activity, according to me. I also tried with different lambda but > the result > is not localized. > How can i fix it? > > Thanks in advance for the help > Sincerely, > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Jun 26 12:42:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 26 Jun 2008 12:42:18 +0200 Subject: CTF275 coherence Message-ID: Thank you for the feedback The coherence is ok. I attach the topography for coherence's peak. I took a head model not corresponding to the subject to test the algorithm quickly. This can be the matter. Anyway the single lead field should be influenced only by head model center, not by its radius, if i am not wrong. The radius defines only the grid i think. The particular case i consider has center (in head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position [0 0 5] influence so much the result? Are there documents about it? About errors depending on the conductor position? I'm trying now to simulate it with surrogate data with corresponding gradiometers-head model relative position. I really would like to keep the topic active Sincerely Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: field.png Type: image/png Size: 16240 bytes Desc: not available URL: From p.kitterick at PSYCH.YORK.AC.UK Thu Jun 26 12:48:13 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Thu, 26 Jun 2008 11:48:13 +0100 Subject: CTF275 coherence In-Reply-To: Message-ID: Yes, the radius of the sphere is not relevant to the calculations. The presumtion is always that the measurement device is outside the sphere. Padraig Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. I took a > head model not corresponding to the subject to test the algorithm quickly. > This can be the matter. Anyway the single lead field should be influenced > only by head model center, not by its radius, if i am not wrong. The radius > defines only the grid i think. The particular case i consider has center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position > [0 0 5] influence so much the result? Are there documents about it? About > errors depending on the conductor position? I'm trying now to simulate it > with surrogate data with corresponding gradiometers-head model relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From englerea at CC.JYU.FI Thu Jun 26 17:14:56 2008 From: englerea at CC.JYU.FI (Enrico Glerean) Date: Thu, 26 Jun 2008 18:14:56 +0300 Subject: options for cluster-based permutation tests Message-ID: Hello dear people, I have a very quick question that hopefully has not been answered before: we have to run cluster based permutation tests using clustering in time and frequency but not in space. Which means not considering neighbor channels. I think that the best option would be using the parameter cfg.neighbourdist = 0.0; which means that there are no neighbor electrodes. Is that correct or is there a better option? Should cfg.minnbchan be changed as well and set to 0? the whole lists of config parameters passed to freqstatistics() would be: cfg = []; cfg.channel = choi; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 5; cfg.correctm='cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 0; cfg.clustertail = 0; cfg.neighbourdist = 0.0; thanks in advance for your help best regards -- Enrico Glerean englerea at cc.jyu.fi Jyväskylä, Finland ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 12:50:22 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 12:50:22 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I don't expect that the exact specifications of your single sphere (in particular the slight shift of the origin) will cause the localization to fail totally. I would guess that the problems lie more in the quality of the estimated cross-spectral density matrix. In a previous reply I mentioned about the topography only giving an indication about the correctness of the computation of the csd's. Obviously, this only gives a hint about the EMG-MEG coherence. The beamformer needs the csd between all MEG-sensor pairs. It could be that this is badly estimated. On how many repetitions is it based (trials x tapers)? Did you remove artifacts from the data? The trial number and presence of artifacts might severely compromise the quality of the csd-matrix. Additionally, I am not sure which gradiometer specification you use. From your previous mails it seems that you generate it yourself. However, fieldtrip should do it for you. If you are using your own hack, is there any reason for it? Yours, JM On Jun 26, 2008, at 12:42 PM, Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. > I took a > head model not corresponding to the subject to test the algorithm > quickly. > This can be the matter. Anyway the single lead field should be > influenced > only by head model center, not by its radius, if i am not wrong. > The radius > defines only the grid i think. The particular case i consider has > center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal > position > [0 0 5] influence so much the result? Are there documents about it? > About > errors depending on the conductor position? I'm trying now to > simulate it > with surrogate data with corresponding gradiometers-head model > relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 13:01:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 13:01:49 +0200 Subject: options for cluster-based permutation tests In-Reply-To: <2521.82.58.220.82.1214493296.squirrel@webmail1.cc.jyu.fi> Message-ID: Dear Enrico, It seems that cfg.neighbourdist should do the trick: The generation of lists of neighbouring channels for each channel is done by the function neighbourselection. As far as I can see, the inclusion of neighbours is indeed based on the distance. Putting it to zeros should be OK. Another way of going about it, is to explicitly define the neighbourhood structure in the configuration: cfg.neighbours = []; for k = 1:length(choi) cfg.neighbours.label{k} = choi{k}; cfg.neighbours.neighblabel = {}; end This prevents statistics_wrapper.m to go into the computation of the neighbourhood altogether. Good luck, Jan-Mathijs On Jun 26, 2008, at 5:14 PM, Enrico Glerean wrote: > Hello dear people, > > I have a very quick question that hopefully has not been answered > before: > we have to run cluster based permutation tests using clustering in > time > and frequency but not in space. Which means not considering neighbor > channels. > > I think that the best option would be using the parameter > > cfg.neighbourdist = 0.0; > > which means that there are no neighbor electrodes. > > Is that correct or is there a better option? Should cfg.minnbchan be > changed as well and set to 0? > > > the whole lists of config parameters passed to freqstatistics() > would be: > > cfg = []; > cfg.channel = choi; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.tail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 5; > > cfg.correctm='cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 0; > cfg.clustertail = 0; > cfg.neighbourdist = 0.0; > > > thanks in advance for your help > > best regards > > -- > Enrico Glerean > englerea at cc.jyu.fi > Jyväskylä, Finland > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Jun 27 16:11:21 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 16:11:21 +0200 Subject: CTF275 coherence Message-ID: Dear Jan-Mathijs In the preprocessing i performed baseline correction for meg data and 10 Hz hi-pass filtering for emg (sampling at ~300 Hz). However since normally the correlated activities for isometric pinch take place in the beta band, and eye-blinks and other artifacts are in other bands or uncorrelated with the emg, i did not think about applying artifacts removal. For sure i will have a look at it but what for me constitutes the signal of a good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography, which i took as a good result. And i expect dics to be more sensible than emg-meg coherence in detecting sources, with the right settings. I specify the settings of frequency analysis like that: refch = 'EMG_lH'; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [max_f max_f]; % peak of coherence spectrum cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'MEG' refch}; cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; freqcond = freqanalysis(cfg,data); cfg = []; fd = freqdescriptives(cfg,freqcond); Maybe i should use another method for csd calculations or another smoothing factor. Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials of 10 seconds each and then i cut each trial in segments of 1 second each. The reason why i use my own gradiometers definitions is because i already have this information ready in my code from a CTF routine. Also i did not get how to look for it in the documentation. How can i do it easier? Then I run the dics with the following parameters: cfg = []; cfg.grad = grads; cfg.grid = grids_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = max_f; cfg.hdmfile = 'myhead.hdm'; sourcecond = sourceanalysis(cfg, freqcond); In the simulations i get the same problem whereas the spectra look reasonable and the dipole fit localizes the source in the right place from coherence peak. The simulations were done with one source (virtual emg) coherent in phase and amplitude with the source time course. Source is modelled by a dipole in position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m How do i perform a good frequency analysis in order to have a good localization? If it does not depend on fr. analysis which other factors can cause this problem? Thank you for the patience Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 16:35:14 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 16:35:14 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, Very quickly: the gradiometer description is present in the data- structure as data.grad (and will be passed on to freq.grad when calling freqanalysis). This at least should be there when you read in your data using preprocessing. You do not have to specify cfg.grad before your call to sourceanalysis, because it will take the gradiometer structure from the data. This will ensure that the csd and gradiometer description really match. As long as you use your own grad-structure you have to be absolutely sure that this one corresponds to the specifications of the dataset at hand. I cannot judge that this really is the case, so I would drop the cfg.grad from your configuration to sourceanalysis in the first place. I totally agree with you that a 'good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography', and I did not claim otherwise. Only: the sensor-level csd is much richer in structure than the part you plot on the topography and a good topography is no guarantee for a good source result (please take my word on it: I have looked at these things a couple of times myself, so I should know ;o) ). The number of trials is sufficient I guess. Yours, JM On Jun 27, 2008, at 4:11 PM, Cristiano Micheli wrote: > Dear Jan-Mathijs > In the preprocessing i performed baseline correction for meg data > and 10 Hz > hi-pass filtering for emg (sampling at ~300 Hz). > However since normally the correlated activities for isometric > pinch take > place in the beta band, and eye-blinks and other artifacts are in > other > bands or uncorrelated with the emg, i did not think about applying > artifacts > removal. > For sure i will have a look at it but what for me constitutes the > signal of > a good emg-meg correlation is not only the peak in the spectrum but > also two > controlateral dipolar 'spots' in the topography, which i took as a > good > result. And i expect dics to be more sensible than emg-meg > coherence in > detecting sources, with the right settings. > I specify the settings of frequency analysis like that: > refch = 'EMG_lH'; > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [max_f max_f]; % peak of coherence spectrum > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'MEG' refch}; > cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; > freqcond = freqanalysis(cfg,data); > cfg = []; > fd = freqdescriptives(cfg,freqcond); > > Maybe i should use another method for csd calculations or another > smoothing > factor. > Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials > of 10 > seconds each and then i cut each trial in segments of 1 second each. > The reason why i use my own gradiometers definitions is because i > already > have this information ready in my code from a CTF routine. Also i > did not > get how to look for it in the documentation. How can i do it easier? > Then I run the dics with the following parameters: > cfg = []; > cfg.grad = grads; > cfg.grid = grids_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = max_f; > cfg.hdmfile = 'myhead.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > In the simulations i get the same problem whereas the spectra look > reasonable and the dipole fit localizes the source in the right > place from > coherence peak. > The simulations were done with one source (virtual emg) coherent in > phase > and amplitude with the source time course. Source is modelled by a > dipole in > position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m > How do i perform a good frequency analysis in order to have a good > localization? > If it does not depend on fr. analysis which other factors can cause > this > problem? > Thank you for the patience > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri Jun 27 18:17:05 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 27 Jun 2008 18:17:05 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Dear Fieldtrippers, I am experiencing problems with the indexing of the MEG sensors in fieldtrip and the topographical representation of these sensors. For the layout file I am using the CTF274.lay file. I also use the regexp function and cfg.label to get the indexes of the sensors I want. In the figure that I have attached you can see where my problem comes from. Somehow the indexes corresponding to the sensors seem not to index the right sensors. Can anyone tell me what this could be related to? Thanks in advance for any helpful suggestions. Frederic _________________________________________________________________ Windows Live Messenger: Direkter Zugriff auf Ihre E-Mails! Ohne Neuanmeldung! http://get.live.com/de-de/messenger/overview ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: topo.gif Type: image/gif Size: 25115 bytes Desc: not available URL: From michelic72 at GMAIL.COM Fri Jun 27 18:34:45 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 18:34:45 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Hi Frederic In CTF274.lay you find all channels apart from sensor MRF43. Maybe in your case you have to exclude another sensor. This would be enough to shift the mapping of the channels on your topography. I would create my own CTF274_fred.lay and exclude the unnecessary sensor. Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Fri Jun 27 18:56:08 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Fri, 27 Jun 2008 09:56:08 -0700 Subject: research position in San Francisco, CA Message-ID: FieldTrip users, We are looking for new and experienced brain imagers wanting to work in our UCSF-affiliated research lab. Please apply at the following link if interested: http://www.ncire.org/positions.php?id=145 thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From enteka at HOTMAIL.COM Fri Jun 27 19:29:18 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 27 Jun 2008 17:29:18 +0000 Subject: wrong sensor indexes for topographical mapping In-Reply-To: Message-ID: Also, make sure that you are using the channel numbering used in the data structure, not the one in the .lay file. help topomap ... cfg.highlight = 'off' or the channel numbers you want to highlight (default = 'off'). These numbers should correspond with the channels in the data, not in the layout file. ... Nic ---------------------------------------- > Date: Fri, 27 Jun 2008 18:34:45 +0200 > From: michelic72 at GMAIL.COM > Subject: Re: [FIELDTRIP] wrong sensor indexes for topographical mapping > To: FIELDTRIP at NIC.SURFNET.NL > > Hi Frederic > In CTF274.lay you find all channels apart from sensor MRF43. > Maybe in your case you have to exclude another sensor. This would be enough > to shift the mapping of the channels on your topography. I would create my > own CTF274_fred.lay and exclude the unnecessary sensor. > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sun Jun 29 13:59:05 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 29 Jun 2008 13:59:05 +0200 Subject: CTF275 coherence Message-ID: Now works. I had some overloaded function somewhere for the routine cell2mat.m which masked the default one, and i could not read the grad structure from the dataset! Thanks! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From monikamellem at GMAIL.COM Mon Jun 30 13:21:33 2008 From: monikamellem at GMAIL.COM (Monika Mellem) Date: Mon, 30 Jun 2008 13:21:33 +0200 Subject: Reading in Neuroscan files Message-ID: Hello, I have noticed some things when reading in both Neuroscan .eeg and .cnt files. 1) When reading a Neuroscan .eeg file, read_event.m seems to put either "accept" or "reject" into the field event.value. According to how event.field is used later on, it should be putting the trigger values in this field which are in tmp.sweep.type. I modified the code as shown below. At line 885: event(end).value = tmp.sweep.type; rather than event(end).value = 'accept'; This line of code is within an if statement (if tmp.sweep.accept), and I'm not sure how the else statement should be modified if a trial/sweep should be rejected. 2) When reading in a Neuroscan .cnt file, read_header.m puts some bad channel labels into hdr.label using what it gets from the read_ns_cnt.m file (around line 564). Whatever is in orig.chan.names starts with the correct channels (about 10 of them) and then has blank values or odd characters for the rest of the channel labels. As a quick fix for just the channel labels, I just took the channel labels that read_ns_hdr.m finds and substituted them into hdr.label. See below. This doesn't fix the underlying problem in read_ns_cnt.m though which seems to be with the variables chandat and r.chan.names (lines 140-141). orig = read_ns_hdr(filename); hdr.label = orig.label; hdr.orig.chan.names = orig.label; Thanks! Monika Mellem ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 5 14:13:34 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 5 Jun 2008 14:13:34 +0200 Subject: Problems with frequency analysis... In-Reply-To: <483D7520.5000907@fil.ion.ucl.ac.uk> Message-ID: Hi. I have a problem regarding the function "freqanalysis", that I hope some of you can help me with. I have a Neuroscan .avg file called testdata.avg, and I would like to see a time-frequency plot of all the 64 channels. ___ In order to do this, I try the following: cfg1 = []; cfg1.datafile = 'testdata.avg' cfg1.headerfile = 'testdata.avg' dataFIC = preprocessing(cfg1); This gives me the data in dataFIC, and if I look at the data in dataFIC.trial{1} I get the correct data for all the 64 channels, so no problem here :o). ___ The next I try is: cfg2 = []; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.method = 'mtmconvol'; cfg2.taper = 'hanning'; cfg2.foi = 2:2:30; cfg2.t_ftimwin = ones(length(cfg2.foi),1).*0.5; cfg2.toi = 0.050:0.005:0.500; TFRhann = freqanalysis(cfg2, dataFIC); I would have expected to get the time-frequency coefficients in the TFRhann.powspctrm, but all I get is a lot of NaNs :o(. Am I doing something wrong, and should I set more parameters for the cfg2 ??? ___ When the problem with the freqanalysis is solved, I expect to be able to make the plots this way - does it look right (the testlay_64.lay file is one I have generated myself, and if I just run the code with the TFRhann with all the NaNs, at least the electrodes appear at the right location in the plot. cfg3.zparam = 'powspctrm'; cfg3.xlim = [0 0.5]; cfg3.ylim = [1 29]; cfg3.zlim = [-3e-27 3e-27]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) ___ I look forward to all suggestions regarding the problems with "freqanalysis". Best regards, Carina Graversen Ph.D student at Aalborg Hospital, Denmark ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 5 14:16:45 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 5 Jun 2008 14:16:45 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080605141334.mztnmdbf17eso448@webmail.kom.aau.dk> Message-ID: Hi Carina, What's the length and time axis of your original data segments? If the length of your data is shorter than the t_ftimwin specified in the configuration for freqanalysis, and/or the time points specified in toi do not overlap with the data's time-axis, NaNs will be the consequence :o(. Information about the time-axis can be found in data.time. Take care that the units correspond. Thus when data.time is in milliseconds, the specification in the configuration to freqanalysis should also be in milliseconds. Hope this helps. JM On Jun 5, 2008, at 2:13 PM, Carina Graversen wrote: > Hi. > > I have a problem regarding the function "freqanalysis", that I hope > some of you can help me with. > > I have a Neuroscan .avg file called testdata.avg, and I would like > to see a time-frequency plot of all the 64 channels. > ___ > > In order to do this, I try the following: > > cfg1 = []; > cfg1.datafile = 'testdata.avg' > cfg1.headerfile = 'testdata.avg' > dataFIC = preprocessing(cfg1); > > This gives me the data in dataFIC, and if I look at the data in > dataFIC.trial{1} I get the correct data for all the 64 channels, so > no problem here :o). > ___ > > The next I try is: > > cfg2 = []; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.method = 'mtmconvol'; > cfg2.taper = 'hanning'; > cfg2.foi = 2:2:30; > cfg2.t_ftimwin = ones(length(cfg2.foi), > 1).*0.5; > cfg2.toi = 0.050:0.005:0.500; > > TFRhann = freqanalysis(cfg2, dataFIC); > > I would have expected to get the time-frequency coefficients in the > TFRhann.powspctrm, but all I get is a lot of NaNs :o(. > > Am I doing something wrong, and should I set more parameters for > the cfg2 ??? > ___ > > When the problem with the freqanalysis is solved, I expect to be > able to make the plots this way - does it look right (the > testlay_64.lay file is one I have generated myself, and if I just > run the code with the TFRhann with all the NaNs, at least the > electrodes appear at the right location in the plot. > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0 0.5]; > cfg3.ylim = [1 29]; > cfg3.zlim = [-3e-27 3e-27]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > ___ > > I look forward to all suggestions regarding the problems with > "freqanalysis". > > Best regards, > Carina Graversen > Ph.D student at Aalborg Hospital, Denmark > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:00:35 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:00:35 +0200 Subject: Problems with frequency analysis... In-Reply-To: <3AD7A174-CE0B-41A2-B11E-557439220BB8@psy.gla.ac.uk> Message-ID: Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 12 14:13:06 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 12 Jun 2008 14:13:06 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612140035.n7s28eg6h0g0o8ks@webmail.kom.aau.dk> Message-ID: Hi Carina, I think this has nothing to do with the cfg settings of multiplot, but with the data that you are plotting. Did you first do time-frequency analysis? And what did you exactly plot? It looks like you plot the sinusoid itself isa the power of the sinusoid. Best Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 12, 2008 2:01 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Problems with frequency analysis... Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:17:07 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:17:07 +0200 Subject: Problems with frequency analysis... In-Reply-To: <003901c8cc85$abbac580$642dae83@fcdonders.nl> Message-ID: Hi Ingrid. First I extract the data by: dataFIC = preprocessing(cfg1); - And then overwrite the dataFIC.trial data with a sinusoid... Next I do a frequency analysis: TFRhann = freqanalysis(cfg2, dataFIC); And finally I try to plot the results of the frequency analysis: multiplotTFR(cfg3, TFRhann) I think this should plot the time-frequency results, right ??? Best regards, Carina Quoting Ingrid Nieuwenhuis : > Hi Carina, > > I think this has nothing to do with the cfg settings of multiplot, but with > the data that you are plotting. Did you first do time-frequency analysis? > And what did you exactly plot? It looks like you plot the sinusoid itself > isa the power of the sinusoid. > > Best Ingrid > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Carina Graversen > Sent: Thursday, June 12, 2008 2:01 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Problems with frequency analysis... > > Hi Jan. > > Thanks for your reply - that helped quite a lot :o). > > However, now I have another problem, when I want to plot the > time-frequency results. I use the code below, and as you will notice I > just load an .avg file, and overwrite all the data in the file to be a > single sinusoid with a frequency of 5 Hz. > > However, the results I get from multiplotTFR doesn't look as expected :o( > > The data I put in dataFIC.trial for all channels can be watched at: > http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg > > And the result from multiplot TFR can be seen at: > http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg > > - where I of course would have expected to have high power for all time > instances at a frequency of 5 Hz. So I was wondering if anyone can tell > which parameter to change in my configuration variables :o). > > Best regards, Carina > > > > > > > > function [] = diabetestest() > > close all > clear all > clc > > cfg1 = []; > cfg1.datafile = 'diabetestest.avg' > cfg1.headerfile = 'diabetestest.avg' > > dataFIC = preprocessing(cfg1); > > % ************************************************************************* > % ------------------------------ DEBUG CODE ------------------------------ > % ************************************************************************* > > test_frequency = 5; % Test frequency > sample_frequency = 1000; % Sample frequency > > % Generating the dummy signal: > for i = 1:301 > dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); > end > > for i = 1:1:68 > dummy_matrix(i, :) = dummy_signal; end > > dataFIC.trial{1} = dummy_matrix; > > figure(101) > plot(dummy_matrix(1, :), 'r') > > % ************************************************************************* > % --------------------------- END OF DEBUG CODE --------------------------- > % ************************************************************************* > > cfg2 = []; > cfg2.method = 'wltconvol'; %= 'mtmconvol'; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.foi = 0.1:0.05:20; > cfg2.toi = 0.050:0.001:0.300 > cfg2.width = 0.0005; > > TFRhann = freqanalysis(cfg2, dataFIC); > > % ------------------------------------------------------------------------- > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0.050 0.300]; > cfg3.ylim = [1 10]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > > % ------------------------------------------------------------------------- > > % cfg4 = []; > % cfg4.channel = 'FP1'; > % clf > % % singleplotTFR(cfg4, TFRhann); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > - - - Carina Graversen M.Sc. Biomedical Engineering, Ph.D. student Aalborg hospital +45 26282093 cgra05 at hst.auc.dk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 12 14:23:10 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 12 Jun 2008 14:23:10 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612141707.vd9suhwv9hzscs8w@webmail.kom.aau.dk> Message-ID: Hi Carina, I'm not a wavelet expert, but the cfg.width specification looks a bit odd to me. I would expect this to be an integer number, specifying the number of oscillation-cycles at each frequency. Irrespective of this, you might want to generate different surrogate data in the first place: the data segments are only 0.3 seconds long. This means that you can only optimally fit frequencies of multiples of 1/0.3, so 3.33333, 6.666667 etc. It only makes sense to try to estimate low frequency data, if the data segments are really long (and according to your specification this would be at least 20 seconds). Yours, Jan-Mathijs On Jun 12, 2008, at 2:17 PM, Carina Graversen wrote: > Hi Ingrid. > > First I extract the data by: > dataFIC = preprocessing(cfg1); > - And then overwrite the dataFIC.trial data with a sinusoid... > > Next I do a frequency analysis: > TFRhann = freqanalysis(cfg2, dataFIC); > > And finally I try to plot the results of the frequency analysis: > multiplotTFR(cfg3, TFRhann) > > > I think this should plot the time-frequency results, right ??? > > Best regards, Carina > > > > Quoting Ingrid Nieuwenhuis : > >> Hi Carina, >> >> I think this has nothing to do with the cfg settings of multiplot, >> but with >> the data that you are plotting. Did you first do time-frequency >> analysis? >> And what did you exactly plot? It looks like you plot the sinusoid >> itself >> isa the power of the sinusoid. >> >> Best Ingrid >> >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] >> On Behalf >> Of Carina Graversen >> Sent: Thursday, June 12, 2008 2:01 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] Problems with frequency analysis... >> >> Hi Jan. >> >> Thanks for your reply - that helped quite a lot :o). >> >> However, now I have another problem, when I want to plot the >> time-frequency results. I use the code below, and as you will >> notice I >> just load an .avg file, and overwrite all the data in the file to >> be a >> single sinusoid with a frequency of 5 Hz. >> >> However, the results I get from multiplotTFR doesn't look as >> expected :o( >> >> The data I put in dataFIC.trial for all channels can be watched at: >> http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg >> >> And the result from multiplot TFR can be seen at: >> http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg >> >> - where I of course would have expected to have high power for all >> time >> instances at a frequency of 5 Hz. So I was wondering if anyone can >> tell >> which parameter to change in my configuration variables :o). >> >> Best regards, Carina >> >> >> >> >> >> >> >> function [] = diabetestest() >> >> close all >> clear all >> clc >> >> cfg1 = []; >> cfg1.datafile = 'diabetestest.avg' >> cfg1.headerfile = 'diabetestest.avg' >> >> dataFIC = preprocessing(cfg1); >> >> % >> ********************************************************************* >> **** >> % ------------------------------ DEBUG CODE >> ------------------------------ >> % >> ********************************************************************* >> **** >> >> test_frequency = 5; % Test frequency >> sample_frequency = 1000; % Sample frequency >> >> % Generating the dummy signal: >> for i = 1:301 >> dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); >> end >> >> for i = 1:1:68 >> dummy_matrix(i, :) = dummy_signal; end >> >> dataFIC.trial{1} = dummy_matrix; >> >> figure(101) >> plot(dummy_matrix(1, :), 'r') >> >> % >> ********************************************************************* >> **** >> % --------------------------- END OF DEBUG CODE >> --------------------------- >> % >> ********************************************************************* >> **** >> >> cfg2 = []; >> cfg2.method = 'wltconvol'; %= >> 'mtmconvol'; >> cfg2.output = 'pow'; >> cfg2.channel = 'all'; >> cfg2.foi = 0.1:0.05:20; >> cfg2.toi = 0.050:0.001:0.300 >> cfg2.width = 0.0005; >> >> TFRhann = freqanalysis(cfg2, >> dataFIC); >> >> % >> --------------------------------------------------------------------- >> ---- >> >> cfg3.zparam = 'powspctrm'; >> cfg3.xlim = [0.050 0.300]; >> cfg3.ylim = [1 10]; >> cfg3.layout = 'testlay_64.lay'; >> cfg3.showlabels = 'yes'; >> >> multiplotTFR(cfg3, TFRhann) >> >> % >> --------------------------------------------------------------------- >> ---- >> >> % cfg4 = []; >> % cfg4.channel = 'FP1'; >> % clf >> % % singleplotTFR(cfg4, TFRhann); >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. >> > > > > - - - > Carina Graversen > M.Sc. Biomedical Engineering, Ph.D. student > Aalborg hospital > +45 26282093 > cgra05 at hst.auc.dk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Fri Jun 13 18:20:51 2008 From: findley at GMAIL.COM (Will Findley) Date: Fri, 13 Jun 2008 18:20:51 +0200 Subject: Using ICBM Probabilistic Atlases Message-ID: I would like to localize activity onto the ICBM probabilistic atlases from LONI. It is unclear to me how and where I should modify the DICS localization procedure to utilize them (particularly the tissue atlas). I also do not know how to obtain fiducial positions for them. Does anyone have experience localizing onto these atlases that would help? Thanks, Will ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:45:51 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:45:51 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Dear Will, I haven't use these particular atlases but I've recently worked on a similar problem. Basically you can interpolate your source data on any MRI. To do that you should set the source.transform field (where 'source' is beamformer output) to the transformation matrix from the coordinate system in which you did the beamformer to the coordinate system of the target MRI. Then you call sourceinterpolate() with that modified source struct and the target MRI as inputs. To get that transformation matrix you will need some fiducials and with that I can't help you. If that atlas has a corresponding structural image you can load that image with some software (I use SPM) and click on some landmarks to find their coordinates. You can then find the coordinates of the same landmarks in your beamformer coordinate system. Of course the precision of your coregistration will depend directly on how precisely you can define the fiducials in the two systems. Given at least 3 matching landmarks the transformation matrix can be computed. How it's done exactly depends on some details that I wouldn't like to get into here. If you don't get better help, write me and I can try to share what I know. Best, Vladimir On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: > I would like to localize activity onto the ICBM probabilistic atlases from > LONI. It is unclear to me how and where I should modify the DICS > localization procedure to utilize them (particularly the tissue atlas). I > also do not know how to obtain fiducial positions for them. Does anyone > have experience localizing onto these atlases that would help? > > Thanks, > Will > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:54:39 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:54:39 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Just one slightly simpler idea. If you have a structural image of your subject that you use for beamforming and there is a structural that comes with the atlas you can coregister these two (that can be done in SPM) and then (given that you know how the space of the subject's structural relates to the beamformer space) you won't need any fiducials. Best, Vladimir On Fri, Jun 13, 2008 at 6:45 PM, Vladimir Litvak wrote: > Dear Will, > > I haven't use these particular atlases but I've recently worked on a > similar problem. Basically you can interpolate your source data on any > MRI. To do that you should set the source.transform field (where > 'source' is beamformer output) to the transformation matrix from the > coordinate system in which you did the beamformer to the coordinate > system of the target MRI. Then you call sourceinterpolate() with that > modified source struct and the target MRI as inputs. > > To get that transformation matrix you will need some fiducials and > with that I can't help you. If that atlas has a corresponding > structural image you can load that image with some software (I use > SPM) and click on some landmarks to find their coordinates. You can > then find the coordinates of the same landmarks in your beamformer > coordinate system. Of course the precision of your coregistration will > depend directly on how precisely you can define the fiducials in the > two systems. Given at least 3 matching landmarks the transformation > matrix can be computed. How it's done exactly depends on some details > that I wouldn't like to get into here. > > If you don't get better help, write me and I can try to share what I know. > > Best, > > Vladimir > > > > > On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: >> I would like to localize activity onto the ICBM probabilistic atlases from >> LONI. It is unclear to me how and where I should modify the DICS >> localization procedure to utilize them (particularly the tissue atlas). I >> also do not know how to obtain fiducial positions for them. Does anyone >> have experience localizing onto these atlases that would help? >> >> Thanks, >> Will >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Mon Jun 16 18:59:40 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Mon, 16 Jun 2008 11:59:40 -0500 Subject: CMCorig data, Coherence Tutorial Message-ID: Jan-Mathijs - Thank you for responding. I have waited to reply as I have steadily worked my way through the Coherence Tutorial, and most all of the beamforming tutorial - there a major question at this point: My segmented MRI is never aligned with the MRI image it is derived from. I am using the program MRIcro to convert *.dcm files to an *.img file before I read it into fieldtrip using the read_fcdc_mri.m function. Then I segment using spm2 through fieldtrip's volumesegment.m function, and flip dimensions as discussed in the tutorial. This works correctly for the sample data, file Subject01.mri, but for my *.img files, when I use sourceplot to see if the segmented brain fits and the MRI are aligned correctly, they are unfortunately not. I have tried different flipping methods to no avail. Any suggestions? Thank you in advance, Nathan Dees ----- Original Message ----- From: "jan-mathijs schoffelen" To: Sent: Friday, May 09, 2008 3:39 AM Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > Dear Nathan, > > Indeed the CMCorig mat-file is missing from the ftp-server, but in > principle it can be generated by executing the preceding steps in the > tutorial. We will change the tutorial accordingly. Historically, the > tutorials have been used at the FCDC toolkit-courses for data analysis, > and students had the mat-file available to save some time. > However, from your mail I conclude that you had some problems running the > tutorial itself, probably unrelated to the (un)availability of the > CMCorig file. If so, could you just retry running the tutorial and let us > know whether and where specified problems arise? > > Thanks, > > Jan-Mathijs > > On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > >> How can one gain access to the dataset 'CMCorig' discussed in the >> tutorials, specifically the tutorial on Coherence? This file is not >> included in the SubjectCMC data posted on the tutorial data section of >> the >> website. >> >> Has anyone else had trouble running the Coherence tutorial from start to >> finish - I thought having access to this data might help me get through >> certain sections? >> >> Thank you >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Erick.Ortiz at MED.UNI-TUEBINGEN.DE Mon Jun 16 19:40:53 2008 From: Erick.Ortiz at MED.UNI-TUEBINGEN.DE (Erick Britis Ortiz) Date: Mon, 16 Jun 2008 19:40:53 +0200 Subject: bwlabeln / bug reports Message-ID: Hello all, About cluster-based statistics: when I set cfg.correctm = ‘cluster’, the funcion "findcluster" tries to call "bwlabeln", that is part of the Image Processing Toolbox. But this toolbox is not available to me at the moment. How to deal with that? Any alternatives to enable the use of cluster-based statistics? I also would like to contribute some bug reports (even solutions!), so should I submit them to the list or is there some web interface or a person to whom to send them directly? Best, Erick ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Jun 17 08:24:14 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 17 Jun 2008 08:24:14 +0200 Subject: bwlabeln / bug reports In-Reply-To: <4856A5A5.2050205@med.uni-tuebingen.de> Message-ID: Hi, > About cluster-based statistics: when I set cfg.correctm = ‘cluster’, > the funcion "findcluster" tries to call "bwlabeln", that is part of > the Image Processing Toolbox. But this toolbox is not available to > me at the moment. you may try running your (cluster-stats) code in Octave: http://www.octave.org/ the code is usually very compatible and sometimes only needs a little tweaking. don't forget to also download octaveforge which should have image processing functions included. here is a reference of available functions: http://octave.sourceforge.net/doc/index.html good luck, nathan > > > How to deal with that? Any alternatives to enable the use of cluster- > based statistics? > > > I also would like to contribute some bug reports (even solutions!), > so should I submit them to the list or is there some web interface > or a person to whom to send them directly? > > > Best, > Erick > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Thu Jun 19 12:09:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 19 Jun 2008 12:09:43 +0200 Subject: MEG's Lead Field Message-ID: An HTML attachment was scrubbed... URL: From soren.r.christensen at GSK.COM Thu Jun 19 13:04:22 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Thu, 19 Jun 2008 12:04:22 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 18-Jun-2008 and will not return until 24-Jun-2008. I'll be back June 24th ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Jun 20 16:34:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 20 Jun 2008 16:34:43 +0200 Subject: Lead Field Message-ID: Hi everybody I tested the leadfield routine (compute_leadfield.m) for current dipole in MEG forward solution. How are the units expressed? I expect the current dipole to be expressed in nA.m according to CTF convention (i am using a 275 channels MEG CTF system), the gradiometers' positions in cm and the lead field in Tesla. Nevertheless i compared it with CTF software and there is quite a high mismatch in the scaling factor, and the field is not perfectly distributed as in CTF software forward solution. In the Fieldtrip documentation it is mentioned a leadfield computation method from Lütkenhöner, Habilschrift '92 which i could not find. How do i get to the article? I attach the code: dip_pos = [2 2 10]; % cm dip_mom = [10 0 0]; % 10 nA*m % grad: gradiometers structure % vol: conductive sphere model lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Fri Jun 20 19:10:51 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Fri, 20 Jun 2008 18:10:51 +0100 Subject: Lead Field In-Reply-To: Message-ID: Hi Cristiano, I'll attempt to help you with this but I'd also appreciate some input on this topic from others on the list to check my thinking is correct. I think your strange results are due to the mixing of several different units of measurement. If the positions of sensor and source are expressed in metres and the dipole moment in A-m (i.e. all in standard units), then the field strengths due to the source as calculated by compute_leadfield.m will be in Tesla. Of course, you can use cm or mm for your scale but that will just linearly scale the field values, i.e. converting the distances from metres to cm (increase of 10^2) will _decrease_ the field values (reduction of 10^2) if the same moment value is specified in both calculations. Similarly, expressing the moment in units of nA-m will also scale the field values linearly, but in that case it will increase the fields by 10^9 relative to the same moment expressed in A-m. For your example the use of cm will decrease the field values by 10^2 and specifiying the dipole moment in nA-m will increase it by 10^9 - all this is relative to standard units. Therefore, if interpreted as Teslas, your fields are probably too large by a factor of 10^7 for your desired source stregth of 10nA-m. You could standardise your units by multiplying the resultant fields by 1e-7 or by using the following when you compute them: dip_mom = [1e-8 0 0]; % 10 nA-m as A-m but presumably as your sensor positions and orientations are in cm so you could either convert them and the dipole position to metres beforehand, or otherwise if you use the above moment value you will still have to multiply the resulting fields by 10^2 to compensate for the cm scaling, which should give you reasonable field strengths in Tesla. Hope that helps and does not confuse, Padraig Cristiano Micheli wrote: > Hi everybody > I tested the leadfield routine (compute_leadfield.m) for current dipole in > MEG forward solution. > How are the units expressed? > I expect the current dipole to be expressed in nA.m according to CTF > convention (i am using a 275 channels MEG CTF system), the gradiometers' > positions in cm and the lead field in Tesla. > Nevertheless i compared it with CTF software and there is quite a high > mismatch in the scaling factor, and the field is not perfectly distributed > as in CTF software forward solution. > In the Fieldtrip documentation it is mentioned a leadfield computation > method from Lütkenhöner, Habilschrift '92 which i could not find. How do i > get to the article? > I attach the code: > > dip_pos = [2 2 10]; % cm > dip_mom = [10 0 0]; % 10 nA*m > % grad: gradiometers structure > % vol: conductive sphere model > lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Jun 20 21:01:12 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 20 Jun 2008 14:01:12 -0500 Subject: Lead Field In-Reply-To: <485BE49B.9060204@psych.york.ac.uk> Message-ID: Greetings Padgaig, thank you for that explanation. I am analysing some MEG/EEG data using EEGLAB (which incorporates several Fieldtrip routines!). When I exported the data to SPSS-PC and graphs show values in the 10,000 and 100,000 micro volt range. EEG data was gathered together with the MEG in a MEG chamber. Am I seeing the same issue there or is it something else. I appreciate any help. regards gopa Quoting Pádraig Kitterick : > Hi Cristiano, > > I'll attempt to help you with this but I'd also appreciate some input > on > this topic from others on the list to check my thinking is correct. > > I think your strange results are due to the mixing of several > different > units of measurement. If the positions of sensor and source are > expressed in metres and the dipole moment in A-m (i.e. all in > standard > units), then the field strengths due to the source as calculated by > compute_leadfield.m will be in Tesla. Of course, you can use cm or mm > > for your scale but that will just linearly scale the field values, > i.e. > converting the distances from metres to cm (increase of 10^2) will > _decrease_ the field values (reduction of 10^2) if the same moment > value > is specified in both calculations. Similarly, expressing the moment > in > units of nA-m will also scale the field values linearly, but in that > > case it will increase the fields by 10^9 relative to the same moment > > expressed in A-m. > > For your example the use of cm will decrease the field values by 10^2 > > and specifiying the dipole moment in nA-m will increase it by 10^9 - > all > this is relative to standard units. Therefore, if interpreted as > Teslas, > your fields are probably too large by a factor of 10^7 for your > desired > source stregth of 10nA-m. You could standardise your units by > multiplying the resultant fields by 1e-7 or by using the following > when > you compute them: > > dip_mom = [1e-8 0 0]; % 10 nA-m as A-m > > but presumably as your sensor positions and orientations are in cm so > > you could either convert them and the dipole position to metres > beforehand, or otherwise if you use the above moment value you will > still have to multiply the resulting fields by 10^2 to compensate for > > the cm scaling, which should give you reasonable field strengths in > Tesla. > > Hope that helps and does not confuse, > > Padraig > > Cristiano Micheli wrote: > > Hi everybody > > I tested the leadfield routine (compute_leadfield.m) for current > dipole in > > MEG forward solution. > > How are the units expressed? > > I expect the current dipole to be expressed in nA.m according to > CTF > > convention (i am using a 275 channels MEG CTF system), the > gradiometers' > > positions in cm and the lead field in Tesla. > > Nevertheless i compared it with CTF software and there is quite a > high > > mismatch in the scaling factor, and the field is not perfectly > distributed > > as in CTF software forward solution. > > In the Fieldtrip documentation it is mentioned a leadfield > computation > > method from Lütkenhöner, Habilschrift '92 which i could not find. > How do i > > get to the article? > > I attach the code: > > > > dip_pos = [2 2 10]; % cm > > dip_mom = [10 0 0]; % 10 nA*m > > % grad: gradiometers structure > > % vol: conductive sphere model > > lf = compute_leadfield(dip_pos, grad, vol, > 'singlesphere','yes')*dip_mom'; > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 13:09:43 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 12:09:43 +0100 Subject: Lead Field In-Reply-To: <1213988472.485bfe7830cfe@bamamail.ua.edu> Message-ID: I honestly couldn't say without knowing more about the way in which the data was processed (not too familiar with EEGLAB), but it seems as if you are referring to raw data and not leadfield calculations. Therefore, it's unlikely that the issues discussed previously would be affecting you. Padraig Gopakumar Venugopalan wrote: > Greetings Padgaig, thank you for that explanation. I am analysing some > MEG/EEG data using EEGLAB (which incorporates several Fieldtrip > routines!). When I exported the data to SPSS-PC and graphs show values > in the 10,000 and 100,000 micro volt range. EEG data was gathered > together with the MEG in a MEG chamber. Am I seeing the same issue > there or is it something else. I appreciate any help. > regards > gopa > > > Quoting Pádraig Kitterick : > >> Hi Cristiano, >> >> I'll attempt to help you with this but I'd also appreciate some input >> on >> this topic from others on the list to check my thinking is correct. >> >> I think your strange results are due to the mixing of several >> different >> units of measurement. If the positions of sensor and source are >> expressed in metres and the dipole moment in A-m (i.e. all in >> standard >> units), then the field strengths due to the source as calculated by >> compute_leadfield.m will be in Tesla. Of course, you can use cm or mm >> >> for your scale but that will just linearly scale the field values, >> i.e. >> converting the distances from metres to cm (increase of 10^2) will >> _decrease_ the field values (reduction of 10^2) if the same moment >> value >> is specified in both calculations. Similarly, expressing the moment >> in >> units of nA-m will also scale the field values linearly, but in that >> >> case it will increase the fields by 10^9 relative to the same moment >> >> expressed in A-m. >> >> For your example the use of cm will decrease the field values by 10^2 >> >> and specifiying the dipole moment in nA-m will increase it by 10^9 - >> all >> this is relative to standard units. Therefore, if interpreted as >> Teslas, >> your fields are probably too large by a factor of 10^7 for your >> desired >> source stregth of 10nA-m. You could standardise your units by >> multiplying the resultant fields by 1e-7 or by using the following >> when >> you compute them: >> >> dip_mom = [1e-8 0 0]; % 10 nA-m as A-m >> >> but presumably as your sensor positions and orientations are in cm so >> >> you could either convert them and the dipole position to metres >> beforehand, or otherwise if you use the above moment value you will >> still have to multiply the resulting fields by 10^2 to compensate for >> >> the cm scaling, which should give you reasonable field strengths in >> Tesla. >> >> Hope that helps and does not confuse, >> >> Padraig >> >> Cristiano Micheli wrote: >>> Hi everybody >>> I tested the leadfield routine (compute_leadfield.m) for current >> dipole in >>> MEG forward solution. >>> How are the units expressed? >>> I expect the current dipole to be expressed in nA.m according to >> CTF >>> convention (i am using a 275 channels MEG CTF system), the >> gradiometers' >>> positions in cm and the lead field in Tesla. >>> Nevertheless i compared it with CTF software and there is quite a >> high >>> mismatch in the scaling factor, and the field is not perfectly >> distributed >>> as in CTF software forward solution. >>> In the Fieldtrip documentation it is mentioned a leadfield >> computation >>> method from Lütkenhöner, Habilschrift '92 which i could not find. >> How do i >>> get to the article? >>> I attach the code: >>> >>> dip_pos = [2 2 10]; % cm >>> dip_mom = [10 0 0]; % 10 nA*m >>> % grad: gradiometers structure >>> % vol: conductive sphere model >>> lf = compute_leadfield(dip_pos, grad, vol, >> 'singlesphere','yes')*dip_mom'; >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> -- >> Pádraig Kitterick >> Graduate Student >> Department of Psychology >> University of York >> Heslington >> York YO10 5DD >> UK >> >> Tel: +44 (0) 1904 43 3170 >> Email: p.kitterick at psych.york.ac.uk >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 15:46:08 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 15:46:08 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: <007e01c8cfd2$5dd01960$2d01a8c0@DGDPBS81> Message-ID: Dear Nathan, Indeed, the flipping as applied in the tutorial should be applied for volumes, segmented from .mri files. This has an obscure reason, which I never managed to find. Importantly, the flipping has to be applied in order for the transformation-matrix, as stored in mri.transform (or segment.transform), to correctly transform from volume-based voxel indices into head-space. Did you check, whether the segmentation itself worked? In other words, do the gray/white/csf volumes look reasonable with respect to the anatomy from which it is derived? As far as I know, the spm segmentation routine which is used by fieldtrip, matches the input anatomy to some gray/white/csf template volumes, but assumes a quite good coregistration between the templates and the input volume, both in terms of coordinate-frame (which should be spm-based), and in the way the volumetric data are stored physically in the data-matrix. These issues are taken care of when volumesegment is instructed to interpret the coordinate-system as being 'ctf'-based, either by some user-interactions prompted when the function is executed, or by explicitly putting cfg.coordinates to 'ctf'. You mention you convert your dicoms to analyze format, but this step in itself does not tell fieldtrip how to interpret the volumetric data. Does the image have a transformation matrix attached when loaded in? If not, you should probably first need to use volumerealign to specify the fiducial locations. This will give you a transformation matrix attached to the mri according to ctf-conventions. Next volumesegment should be called with cfg.coordinates = 'ctf'. Hope this helps, Jan-Mathijs On Jun 16, 2008, at 6:59 PM, Nathan Dees wrote: > Jan-Mathijs - > > Thank you for responding. I have waited to reply as I have > steadily worked my way through the Coherence > Tutorial, and most all of the beamforming tutorial - there a major > question at this point: > > My segmented MRI is never aligned with the MRI image it is derived > from. I am using the program MRIcro to convert *.dcm files to an > *.img file before I read it into fieldtrip using the > read_fcdc_mri.m function. Then I segment using spm2 through > fieldtrip's volumesegment.m function, and flip dimensions as > discussed in the tutorial. This works correctly for the sample > data, file Subject01.mri, but for my *.img files, when I use > sourceplot to see if the segmented brain fits and the MRI are > aligned correctly, they are unfortunately not. I have tried > different flipping methods to no avail. > > Any suggestions? > > Thank you in advance, > Nathan Dees > > > > ----- Original Message ----- From: "jan-mathijs schoffelen" > > To: > Sent: Friday, May 09, 2008 3:39 AM > Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > > >> Dear Nathan, >> >> Indeed the CMCorig mat-file is missing from the ftp-server, but in >> principle it can be generated by executing the preceding steps in the >> tutorial. We will change the tutorial accordingly. Historically, the >> tutorials have been used at the FCDC toolkit-courses for data >> analysis, >> and students had the mat-file available to save some time. >> However, from your mail I conclude that you had some problems >> running the >> tutorial itself, probably unrelated to the (un)availability of the >> CMCorig file. If so, could you just retry running the tutorial >> and let us >> know whether and where specified problems arise? >> >> Thanks, >> >> Jan-Mathijs >> >> On May 7, 2008, at 12:54 AM, Nathan Dees wrote: >> >>> How can one gain access to the dataset 'CMCorig' discussed in the >>> tutorials, specifically the tutorial on Coherence? This file is not >>> included in the SubjectCMC data posted on the tutorial data >>> section of >>> the >>> website. >>> >>> Has anyone else had trouble running the Coherence tutorial from >>> start to >>> finish - I thought having access to this data might help me get >>> through >>> certain sections? >>> >>> Thank you >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of >>> the FieldTrip toolbox, to share experiences and to discuss new >>> ideas >>> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Mon Jun 23 15:59:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Mon, 23 Jun 2008 15:59:20 +0200 Subject: Lead Field Message-ID: Hi Pádraig Thank you for the answer. It helped to fix the scaling factor. Now i get a magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick up coils (with Fieldtrip routine). Still i cannot get the same field as for the CTF software. In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. I think the two routines use different equations. CTF implements Sarvas' forward model for a spherical conductor in a homogeneus medium ("Basic mathematical and electromagnetic concepts of the biomagnetic inverse problem", Sarvas J, 1987). I cannot get to the source of Fieldtrip's method for the forward model, which is mentioned in meg_leadfield1.m routine head comment (adapted from Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. I found from Lütkenhöner : "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: LIT-Verlag, 1992 Unfortunately i do not have access neither to the book nor to formulas. How can i check it? If it does not depend on implementation details (which sounds also plausible since the error is quite high), what can be again the problem to make the two fields match? Thank you Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 16:16:33 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 15:16:33 +0100 Subject: Lead Field In-Reply-To: Message-ID: The method implemented in meg_leadfield1.m gives the same result as the equations of Sarvas. It's just a different formulation of the forward problem. I've produced identical leadfields calculated with several different packages, including fieldtrip, and also a direct implementation of the Sarvas equations. It is possible that the CTF software is accounting for the coil loop radii and other machine-specific inputs to the calculations, but these rarely change the fields by large amounts. Are you using the same sphere to approximate the head in both instances? The meg_leadfield1.m code assumes that the centre of the single sphere is at the origin, (0,0,0). If the centre of the sphere isn't at the origin, then you need to adjust the dipole and sensor locations by subtracting the centre of the sphere from their coordinates. The CTF system could well be doing this adjustment using a pre-programmed sphere centre based on either a general estimation or coregistration information it has available to it. Unless you can access all the information that it is using to do the calculations, it will be very hard to get identical answers. The best thing is to ensure that you have a good estimate of the centre of the single sphere for your sensor array based on an average head/brain or a particular subject you are trying to model. Then your fields will be as accurate, despite not being identical in absolute numerical values to those produced by the CTF software. Padraig Cristiano Micheli wrote: > Hi Pádraig > Thank you for the answer. It helped to fix the scaling factor. Now i get a > magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick > up coils (with Fieldtrip routine). > Still i cannot get the same field as for the CTF software. > In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 > channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. > I think the two routines use different equations. CTF implements Sarvas' > forward model for a spherical conductor in a homogeneus medium ("Basic > mathematical and electromagnetic concepts of the biomagnetic inverse > problem", Sarvas J, 1987). > I cannot get to the source of Fieldtrip's method for the forward model, > which is mentioned in meg_leadfield1.m routine head comment (adapted from > Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. > I found from Lütkenhöner : > "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: > LIT-Verlag, 1992 > Unfortunately i do not have access neither to the book nor to formulas. > How can i check it? > If it does not depend on implementation details (which sounds also plausible > since the error is quite high), what can be again the problem to make the > two fields match? > Thank you > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 16:20:24 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 16:20:24 +0200 Subject: Lead Field In-Reply-To: <485FB041.7050101@psych.york.ac.uk> Message-ID: Hi guys, May I quickly add to the discussion that I remember having seen that Cristiano uses myhead.hdm as an input to prepare_headmodel, and the resulting vol-structure for compute_leadfield. Is myhead.hdm a multisphere model? Just to be sure: The call to compute_leadfield with additional inputs 'singlesphere' 'yes' does not lead to a single-sphere-based leadfield, as far as I know. Single sphericity is only ensured when vol contains just one .o, and one .r. Yours, JM On Jun 23, 2008, at 4:16 PM, Pádraig Kitterick wrote: > The method implemented in meg_leadfield1.m gives the same result as > the equations of Sarvas. It's just a different formulation of the > forward problem. I've produced identical leadfields calculated with > several different packages, including fieldtrip, and also a direct > implementation of the Sarvas equations. > > It is possible that the CTF software is accounting for the coil > loop radii and other machine-specific inputs to the calculations, > but these rarely change the fields by large amounts. Are you using > the same sphere to approximate the head in both instances? The > meg_leadfield1.m code assumes that the centre of the single sphere > is at the origin, (0,0,0). If the centre of the sphere isn't at the > origin, then you need to adjust the dipole and sensor locations by > subtracting the centre of the sphere from their coordinates. The > CTF system could well be doing this adjustment using a pre- > programmed sphere centre based on either a general estimation or > coregistration information it has available to it. Unless you can > access all the information that it is using to do the calculations, > it will be very hard to get identical answers. > > The best thing is to ensure that you have a good estimate of the > centre of the single sphere for your sensor array based on an > average head/brain or a particular subject you are trying to model. > Then your fields will be as accurate, despite not being identical > in absolute numerical values to those produced by the CTF software. > > Padraig > > Cristiano Micheli wrote: >> Hi Pádraig >> Thank you for the answer. It helped to fix the scaling factor. Now >> i get a >> magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far >> from the pick >> up coils (with Fieldtrip routine). >> Still i cannot get the same field as for the CTF software. In CTF >> leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 >> channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. >> I think the two routines use different equations. CTF implements >> Sarvas' >> forward model for a spherical conductor in a homogeneus medium >> ("Basic >> mathematical and electromagnetic concepts of the biomagnetic inverse >> problem", Sarvas J, 1987). >> I cannot get to the source of Fieldtrip's method for the forward >> model, >> which is mentioned in meg_leadfield1.m routine head comment >> (adapted from >> Luetkenhoener, Habilschrift '92). It sounds like an habilitation >> work. >> I found from Lütkenhöner : >> "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", >> Münster: >> LIT-Verlag, 1992 >> Unfortunately i do not have access neither to the book nor to >> formulas. >> How can i check it? If it does not depend on implementation >> details (which sounds also plausible >> since the error is quite high), what can be again the problem to >> make the >> two fields match? >> Thank you >> Cristiano >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 14:51:50 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 14:51:50 +0200 Subject: Lead Field Message-ID: No it's a single sphere head model (only one radius). Actually i had in mind to generate an equivalent multisphere model to test the difference of the two solutions (one sphere-multisphere). I am running a dics with an external reference channel in a isometric pinch protocol and i want to verify what i find with coherence analysis (controlateral M1 activation). Moreover i wanted to find the ipsilateral M1 and cerebellum activations applying a 'stereo' dics. Do you know if this method is already implemented in Fieldtrip? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 15:10:31 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 15:10:31 +0200 Subject: Lead Field Message-ID: ..and i fixed the problem with the lead field. I simply had to set the right grad.tra matrix Since i discovered that [eye(275) -eye(275)] does not give the right results i looked inside the orientations of the magnetometers and i discovered that they are randomly pointing upwards or inwards. I fixed it and now the results match with ctf software. Thank you for the advices. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From myles.reilly at HSC.UTAH.EDU Tue Jun 24 23:29:36 2008 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 24 Jun 2008 23:29:36 +0200 Subject: Neuromag coherence Message-ID: Hi, The tutorial Analysis of corticomuscular coherence shows the methods for computing coherence between MEG and a single EMG channel. I have tried to fit Neuromag / EMG data through the same routines without success. There are too many errors to bother listing at this point. Has anyone else been able to accomplish this? Thanks, Myles ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Wed Jun 25 00:12:10 2008 From: findley at GMAIL.COM (Will Findley) Date: Wed, 25 Jun 2008 00:12:10 +0200 Subject: Co-registration of fiducials for leadfields Message-ID: As best I can tell, before calculating the leadfields for the forward model, the sensor positions are adjusted by the center of the spherical head approximation as such: lines 201-205 in compute_leadfield.m if isfield(vol, 'o') % shift dipole and magnetometers to origin of sphere pos = pos - repmat(vol.o, Ndipoles, 1); pnt = pnt - repmat(vol.o, size(pnt,1), 1); end However, I can't find where the modification occurs to vol.o (the sphere's origin determined in read_ctf_hdm.m) to take into account aligning the fiducials for the spherical head model to the head coil positions during the scan. Does anyone know where this calculation is performed? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.hesse at FCDONDERS.RU.NL Wed Jun 25 08:33:42 2008 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 25 Jun 2008 08:33:42 +0200 Subject: Neuromag coherence In-Reply-To: Message-ID: Hi Myles, without a clearer description of the errors you get it is of course difficult to offer advice; however, people have often reported difficulty in reading the MEG data from Neuromag systems into Fieldtrip. You can check the discussion list archive for posts related to the issues regarding reading Neuromag data into FT. Once the data has been read in successfully, you should not encounter any problems, as all the computations are not data format specific, and work. Regards, Christian On 24 Jun 2008, at 23:29, Myles Reilly wrote: > Hi, > > The tutorial Analysis of corticomuscular coherence shows the > methods for > computing coherence between MEG and a single EMG channel. I have tried > to fit Neuromag / EMG data through the same routines without success. > There are too many errors to bother listing at this point. > > Has anyone else been able to accomplish this? > > Thanks, > > Myles > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Wed Jun 25 12:26:22 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Wed, 25 Jun 2008 12:26:22 +0200 Subject: Neuromag coherence Message-ID: Hi All I checked the tutorials: "Localizing oscillatory sources using beamformer techniques" and "Analysis of corticomuscular coherence" and it seems that cortico-muscular coherence calculations and dics have to do with sourceanalysis.m routine. I managed to have it working after having calculated frequency power spectra and cross-spectral densities as inputs for this function. After i select the other inputs (head model, gradiometer's positions, lambda) i have to set a frequency upon which to let the dics run (i selected, like in the examples, the peak of maximal coherence spectra). The result of the run is a 3D map of coherence or power activities for every point inside the head grid and i used a scatter3.m to visualize it, not to mess up with the co-registration of MRI images (the next step i will speak about). I compared the result with a coherence topography calculated with CTF software and i get an activation in the controlateral area with a clear dipolar shape. Unfortunately i do not see an equivalent in the same position for the DICS output. Reading the documentation i realised that it can be because of a biasing of the spatial filter toward the center of the sphere. I recalculated the dics with a baseline condition and after all i subtracted it from the task activation, still the result is far away from being a localized source activity, according to me. I also tried with different lambda but the result is not localized. How can i fix it? Thanks in advance for the help Sincerely, Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 00:09:33 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 00:09:33 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, For my bachelor's assignment, I'm trying to find a visual stimulus of a hand movement that triggers the 'largest' modulation of the EEG. I.e. , when the subject looks at a right hand movement, literature suggest a decrease in power in the 8-13 Hz band, relative to a baseline period around electrode position C3. I'm trying to use Fieldtrip's freqstatistics.m function to test this decrease in power for significance. Following a tutorial in the Fieldtrip wiki, http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments which I thought applied to my situation gave me a lot of error messages. I've already redefined my trials, so I have a separate set of trials, one containing 2 seconds of baseline, and one containing 2 seconds of stimulus. The baseline time axis is shifted so it overlaps the stimulus time axis I then use this code to calculate TFR's for those datasets: cfgfreq.method = 'mtmconvol'; cfgfreq.output = 'pow' ; cfgfreq.taper = ' hanning' ; cfgfreq.foi = 8:1:13; cfgfreq.t_ftimwin = 10./cfgfreq.foi; cfgfreq.toi = 5:1/100:7; cfgfreq.tapsmofrq = cfgfreq.foi*0.4; [baselineTFR] = freqanalysis(cfgfreq,baselinedata); [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); And then I have to do the significance test. cfg = []; sfg.method = 'analytic'; cfg.statistics = 'actvsblT'; cfg.alpha = 0.05; ? [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); I think I have to do something with the design matrix, but I can't find anything about that in the wiki (or the rest of the internet). Thanks, Thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Thu Jun 26 08:45:06 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 26 Jun 2008 08:45:06 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 09:29:16 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 09:29:16 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, I'm currently in the pilot phase, testing various stimuli on myself and my supervisor. I want to do this analysis to get an indication which stimulus has the best potential, so I can test that on a sufficient large group. The data I'm testing the statistical analysis script on consists of 50 trials, the subject was asked to perform motor imagery while looking at the screen. Each trial consists of 3 seconds baseline (empty background on screen) and 5 seconds stimulus ( hand squeezing a ball on screen). I don't need the TFR's of the individual trials, since the mean TFR will (that's what I expect) show a more prominent in power in the 8-13 Hz band when I compare baseline vs stimulus. The error message I get when I run the script now is: ??? Undefined variable "data" or class "data.biol". Error in ==> prepare_design at 92 nrepl=size(data.biol,1); Error in ==> statistics_wrapper at 238 [cfg] = prepare_design(cfg); Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> fieldtripstatanalyse at 36 [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); Thanks for your input, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Nathan Weisz Verzonden: do 26-6-2008 8:45 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: Re: [FIELDTRIP] Significance test frequency power decrease baseline vs stimulation hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:36:30 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:36:30 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: Dear Thomas, It's hard to say what's going wrong, but I would suggest a different approach in the first place. I could imagine that you are interested in the first place whether there's a difference in activation vs. baseline, and not so much in the moment in time that this occurs. Then the player of my choice would be freqanalysis_mtmfft. In that case you collapse over the time dimension, and increase your statistical power. Importantly, using either approach, I believe it is mandatory to use equal length trials in both 'conditions'. I don't believe this causes your error message but I see that you use different length trials and will lead to problems when the current problem is fixed and you proceed in the function. As I said I would try to run freqanalysis with cfg.method = 'mtmfft'. As Nathan pointed out, it is mandatory to do cfg.keeptrials = 'yes', otherwise you cannot do any statistics. (This is also the case when you would use mtmconvol). This is a very important notion. Otherwise it would just suffice to look at the difference of the averages. The fact that you want to compute a T-value implies that you want to take the variance across trials into account, and therefore you need 'keeptrials' = 'yes' (This could very well be the cause of your problem). Then I would call freqstatistics with either cfg.statistic = 'depsamplesT' (when you have paired observations) or cfg.statistic='indepsamplesT' (when the observations are unpaired). As a sidestep, when encountering errors in general, it might make sense to use matlab's debugging functionality. When you type on the commandline 'dbstop if error' before running your analysis script, matlab enters the debugging mode when an error is encountered. This means that you stick to the local workspace of the function in which the error occurred, and you can see what is going wrong. In your case apparently there is no variable called data present in the workspace for the function prepare_design. You can toggle up and down between the calling functions by using dbup and dbdown. This usually gives useful information and points to the core of the problem. This can be both handy for yourself (you might be able to solve the problem yourself) or for anybody trying to help from a distance. Anyway, something seems to go wrong in prepare_design. I'd rather fix this if I were you, but you could also see whether you can bypass this problem when specifying a design in your configuration for freqstatistics. This will bypass the function prepare_design altogether. There is some information on the fieldtrip wiki in the tutorial about cluster-based permutation tests. You could also type help prepare_design in the matlab commandline. I hope this helps, Jan-Mathijs On Jun 26, 2008, at 9:29 AM, Thomas Dijkman wrote: > Hi, > > I'm currently in the pilot phase, testing various stimuli on myself > and my supervisor. I want to do this analysis to get an indication > which stimulus has the best potential, so I can test that on a > sufficient large group. > > The data I'm testing the statistical analysis script on consists of > 50 trials, the subject was asked to perform motor imagery while > looking at the screen. Each trial consists of 3 seconds baseline > (empty background on screen) and 5 seconds stimulus ( hand > squeezing a ball on screen). > I don't need the TFR's of the individual trials, since the mean TFR > will (that's what I expect) show a more prominent in power in the > 8-13 Hz band when I compare baseline vs stimulus. > > The error message I get when I run the script now is: > > ??? Undefined variable "data" or class "data.biol". > > Error in ==> prepare_design at 92 > nrepl=size(data.biol,1); > > Error in ==> statistics_wrapper at 238 > [cfg] = prepare_design(cfg); > > Error in ==> freqstatistics at 132 > [stat] = statistics_wrapper(cfg, varargin{:}); > > Error in ==> fieldtripstatanalyse at 36 > [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); > > Thanks for your input, > > Thomas > > > -----Oorspronkelijk bericht----- > Van: FieldTrip discussion list namens Nathan Weisz > Verzonden: do 26-6-2008 8:45 > Aan: FIELDTRIP at NIC.SURFNET.NL > Onderwerp: Re: [FIELDTRIP] Significance test frequency power > decrease baseline vs stimulation > > hi, > > you want individual subject stats? i'm pretty sure then that you need > to add something like > cfg.keeptrials='yes'; > when doing your freqanalysis. > > btw, adding the actual error message is also a good idea when posting > questions. > > good luck, > n > > > On 26.06.2008, at 00:09, Thomas Dijkman wrote: > >> Hi, >> >> For my bachelor's assignment, I'm trying to find a visual stimulus >> of a hand >> movement that triggers the 'largest' modulation of the EEG. I.e. , >> when the >> subject looks at a right hand movement, literature suggest a >> decrease in >> power in the 8-13 Hz band, relative to a baseline period around >> electrode >> position C3. >> I'm trying to use Fieldtrip's freqstatistics.m function to test this >> decrease in power for significance. Following a tutorial in the >> Fieldtrip wiki, >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_p >> ermutation_tests_for_time- >> frequency_representationswithin_trial_experiments >> >> which I thought applied to my situation gave me a lot of error >> messages. >> >> I've already redefined my trials, so I have a separate set of >> trials, one >> containing 2 seconds of baseline, and one containing 2 seconds of >> stimulus. >> The baseline time axis is shifted so it overlaps the stimulus time >> axis >> >> I then use this code to calculate TFR's for those datasets: >> >> cfgfreq.method = 'mtmconvol'; >> cfgfreq.output = 'pow' ; >> cfgfreq.taper = ' hanning' ; >> cfgfreq.foi = 8:1:13; >> cfgfreq.t_ftimwin = 10./cfgfreq.foi; >> cfgfreq.toi = 5:1/100:7; >> cfgfreq.tapsmofrq = cfgfreq.foi*0.4; >> [baselineTFR] = freqanalysis(cfgfreq,baselinedata); >> [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); >> >> And then I have to do the significance test. >> >> cfg = []; >> sfg.method = 'analytic'; >> cfg.statistics = 'actvsblT'; >> cfg.alpha = 0.05; >> ? >> [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); >> >> I think I have to do something with the design matrix, but I can't >> find >> anything about that in the wiki (or the rest of the internet). >> >> Thanks, >> >> Thomas >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------- > Dr. Nathan Weisz > > INSERM - Unité 821 > Dynamique cérébrale et cognition > Centre Hospitalier Le Vinatier, Bâtiment 452 > 95 Boulevard Pinel > 69500 Bron, France > > Tel: ++33 - (0)4 - 7213 8915 > Email: nathan.weisz at inserm.fr > Chat-AV: nathanweisz at mac.com > Homepage: http://web.mac.com/nathanweisz > Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 > > Please avoid sending me Word or PowerPoint attachments. > See http://www.gnu.org/philosophy/no-word-attachments.html > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:48:57 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:48:57 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I took the liberty to change the subject of your posting into a more appropriate one. Did you have a look at the topography of the coherence on the scalp, using fieldtrip. This is a first check I would do, to get an indication that at least the other important ingredient to the beamformer (apart from the leadfields), i.e. the csd, has been computed more or less ok. Two additional points: you mention something about the coregistration with the MRI. It is of course extremely important that your volume conductor model is aligned with the MRI. Checking the topography of the scalp level CMC using CTF's software does not guarantee this. Second point: spatial filters are biased towards the depth and therefore people often use quantities like pseudo-T/F/Z, neural activity indices, constrast between conditions, or normalised leadfields in order to make sense out of the volumetric images. However, coherence is normalised for the power by definition, so I would not expect a problem per se in the visualisation. Yours, Jan-Mathijs On Jun 25, 2008, at 12:26 PM, Cristiano Micheli wrote: > Hi All > I checked the tutorials: > "Localizing oscillatory sources using beamformer techniques" and > "Analysis > of corticomuscular coherence" and it seems that cortico-muscular > coherence > calculations and dics have to do with sourceanalysis.m routine. > I managed to have it working after having calculated frequency > power spectra > and cross-spectral densities as inputs for this function. > After i select the other inputs (head model, gradiometer's positions, > lambda) i have to set a frequency upon which to let the dics run (i > selected, like in the examples, the peak of maximal coherence > spectra). > The result of the run is a 3D map of coherence or power activities > for every > point inside the head grid and i used a scatter3.m to visualize it, > not to > mess up with the co-registration of MRI images (the next step i > will speak > about). > I compared the result with a coherence topography calculated with CTF > software and i get an activation in the controlateral area with a > clear > dipolar shape. > Unfortunately i do not see an equivalent in the same position for > the DICS > output. > Reading the documentation i realised that it can be because of a > biasing of > the spatial filter toward the center of the sphere. I recalculated > the dics > with a baseline condition and after all i subtracted it from the task > activation, still the result is far away from being a localized source > activity, according to me. I also tried with different lambda but > the result > is not localized. > How can i fix it? > > Thanks in advance for the help > Sincerely, > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Jun 26 12:42:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 26 Jun 2008 12:42:18 +0200 Subject: CTF275 coherence Message-ID: Thank you for the feedback The coherence is ok. I attach the topography for coherence's peak. I took a head model not corresponding to the subject to test the algorithm quickly. This can be the matter. Anyway the single lead field should be influenced only by head model center, not by its radius, if i am not wrong. The radius defines only the grid i think. The particular case i consider has center (in head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position [0 0 5] influence so much the result? Are there documents about it? About errors depending on the conductor position? I'm trying now to simulate it with surrogate data with corresponding gradiometers-head model relative position. I really would like to keep the topic active Sincerely Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: field.png Type: image/png Size: 16240 bytes Desc: not available URL: From p.kitterick at PSYCH.YORK.AC.UK Thu Jun 26 12:48:13 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Thu, 26 Jun 2008 11:48:13 +0100 Subject: CTF275 coherence In-Reply-To: Message-ID: Yes, the radius of the sphere is not relevant to the calculations. The presumtion is always that the measurement device is outside the sphere. Padraig Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. I took a > head model not corresponding to the subject to test the algorithm quickly. > This can be the matter. Anyway the single lead field should be influenced > only by head model center, not by its radius, if i am not wrong. The radius > defines only the grid i think. The particular case i consider has center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position > [0 0 5] influence so much the result? Are there documents about it? About > errors depending on the conductor position? I'm trying now to simulate it > with surrogate data with corresponding gradiometers-head model relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From englerea at CC.JYU.FI Thu Jun 26 17:14:56 2008 From: englerea at CC.JYU.FI (Enrico Glerean) Date: Thu, 26 Jun 2008 18:14:56 +0300 Subject: options for cluster-based permutation tests Message-ID: Hello dear people, I have a very quick question that hopefully has not been answered before: we have to run cluster based permutation tests using clustering in time and frequency but not in space. Which means not considering neighbor channels. I think that the best option would be using the parameter cfg.neighbourdist = 0.0; which means that there are no neighbor electrodes. Is that correct or is there a better option? Should cfg.minnbchan be changed as well and set to 0? the whole lists of config parameters passed to freqstatistics() would be: cfg = []; cfg.channel = choi; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 5; cfg.correctm='cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 0; cfg.clustertail = 0; cfg.neighbourdist = 0.0; thanks in advance for your help best regards -- Enrico Glerean englerea at cc.jyu.fi Jyväskylä, Finland ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 12:50:22 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 12:50:22 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I don't expect that the exact specifications of your single sphere (in particular the slight shift of the origin) will cause the localization to fail totally. I would guess that the problems lie more in the quality of the estimated cross-spectral density matrix. In a previous reply I mentioned about the topography only giving an indication about the correctness of the computation of the csd's. Obviously, this only gives a hint about the EMG-MEG coherence. The beamformer needs the csd between all MEG-sensor pairs. It could be that this is badly estimated. On how many repetitions is it based (trials x tapers)? Did you remove artifacts from the data? The trial number and presence of artifacts might severely compromise the quality of the csd-matrix. Additionally, I am not sure which gradiometer specification you use. From your previous mails it seems that you generate it yourself. However, fieldtrip should do it for you. If you are using your own hack, is there any reason for it? Yours, JM On Jun 26, 2008, at 12:42 PM, Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. > I took a > head model not corresponding to the subject to test the algorithm > quickly. > This can be the matter. Anyway the single lead field should be > influenced > only by head model center, not by its radius, if i am not wrong. > The radius > defines only the grid i think. The particular case i consider has > center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal > position > [0 0 5] influence so much the result? Are there documents about it? > About > errors depending on the conductor position? I'm trying now to > simulate it > with surrogate data with corresponding gradiometers-head model > relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 13:01:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 13:01:49 +0200 Subject: options for cluster-based permutation tests In-Reply-To: <2521.82.58.220.82.1214493296.squirrel@webmail1.cc.jyu.fi> Message-ID: Dear Enrico, It seems that cfg.neighbourdist should do the trick: The generation of lists of neighbouring channels for each channel is done by the function neighbourselection. As far as I can see, the inclusion of neighbours is indeed based on the distance. Putting it to zeros should be OK. Another way of going about it, is to explicitly define the neighbourhood structure in the configuration: cfg.neighbours = []; for k = 1:length(choi) cfg.neighbours.label{k} = choi{k}; cfg.neighbours.neighblabel = {}; end This prevents statistics_wrapper.m to go into the computation of the neighbourhood altogether. Good luck, Jan-Mathijs On Jun 26, 2008, at 5:14 PM, Enrico Glerean wrote: > Hello dear people, > > I have a very quick question that hopefully has not been answered > before: > we have to run cluster based permutation tests using clustering in > time > and frequency but not in space. Which means not considering neighbor > channels. > > I think that the best option would be using the parameter > > cfg.neighbourdist = 0.0; > > which means that there are no neighbor electrodes. > > Is that correct or is there a better option? Should cfg.minnbchan be > changed as well and set to 0? > > > the whole lists of config parameters passed to freqstatistics() > would be: > > cfg = []; > cfg.channel = choi; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.tail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 5; > > cfg.correctm='cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 0; > cfg.clustertail = 0; > cfg.neighbourdist = 0.0; > > > thanks in advance for your help > > best regards > > -- > Enrico Glerean > englerea at cc.jyu.fi > Jyväskylä, Finland > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Jun 27 16:11:21 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 16:11:21 +0200 Subject: CTF275 coherence Message-ID: Dear Jan-Mathijs In the preprocessing i performed baseline correction for meg data and 10 Hz hi-pass filtering for emg (sampling at ~300 Hz). However since normally the correlated activities for isometric pinch take place in the beta band, and eye-blinks and other artifacts are in other bands or uncorrelated with the emg, i did not think about applying artifacts removal. For sure i will have a look at it but what for me constitutes the signal of a good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography, which i took as a good result. And i expect dics to be more sensible than emg-meg coherence in detecting sources, with the right settings. I specify the settings of frequency analysis like that: refch = 'EMG_lH'; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [max_f max_f]; % peak of coherence spectrum cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'MEG' refch}; cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; freqcond = freqanalysis(cfg,data); cfg = []; fd = freqdescriptives(cfg,freqcond); Maybe i should use another method for csd calculations or another smoothing factor. Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials of 10 seconds each and then i cut each trial in segments of 1 second each. The reason why i use my own gradiometers definitions is because i already have this information ready in my code from a CTF routine. Also i did not get how to look for it in the documentation. How can i do it easier? Then I run the dics with the following parameters: cfg = []; cfg.grad = grads; cfg.grid = grids_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = max_f; cfg.hdmfile = 'myhead.hdm'; sourcecond = sourceanalysis(cfg, freqcond); In the simulations i get the same problem whereas the spectra look reasonable and the dipole fit localizes the source in the right place from coherence peak. The simulations were done with one source (virtual emg) coherent in phase and amplitude with the source time course. Source is modelled by a dipole in position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m How do i perform a good frequency analysis in order to have a good localization? If it does not depend on fr. analysis which other factors can cause this problem? Thank you for the patience Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 16:35:14 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 16:35:14 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, Very quickly: the gradiometer description is present in the data- structure as data.grad (and will be passed on to freq.grad when calling freqanalysis). This at least should be there when you read in your data using preprocessing. You do not have to specify cfg.grad before your call to sourceanalysis, because it will take the gradiometer structure from the data. This will ensure that the csd and gradiometer description really match. As long as you use your own grad-structure you have to be absolutely sure that this one corresponds to the specifications of the dataset at hand. I cannot judge that this really is the case, so I would drop the cfg.grad from your configuration to sourceanalysis in the first place. I totally agree with you that a 'good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography', and I did not claim otherwise. Only: the sensor-level csd is much richer in structure than the part you plot on the topography and a good topography is no guarantee for a good source result (please take my word on it: I have looked at these things a couple of times myself, so I should know ;o) ). The number of trials is sufficient I guess. Yours, JM On Jun 27, 2008, at 4:11 PM, Cristiano Micheli wrote: > Dear Jan-Mathijs > In the preprocessing i performed baseline correction for meg data > and 10 Hz > hi-pass filtering for emg (sampling at ~300 Hz). > However since normally the correlated activities for isometric > pinch take > place in the beta band, and eye-blinks and other artifacts are in > other > bands or uncorrelated with the emg, i did not think about applying > artifacts > removal. > For sure i will have a look at it but what for me constitutes the > signal of > a good emg-meg correlation is not only the peak in the spectrum but > also two > controlateral dipolar 'spots' in the topography, which i took as a > good > result. And i expect dics to be more sensible than emg-meg > coherence in > detecting sources, with the right settings. > I specify the settings of frequency analysis like that: > refch = 'EMG_lH'; > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [max_f max_f]; % peak of coherence spectrum > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'MEG' refch}; > cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; > freqcond = freqanalysis(cfg,data); > cfg = []; > fd = freqdescriptives(cfg,freqcond); > > Maybe i should use another method for csd calculations or another > smoothing > factor. > Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials > of 10 > seconds each and then i cut each trial in segments of 1 second each. > The reason why i use my own gradiometers definitions is because i > already > have this information ready in my code from a CTF routine. Also i > did not > get how to look for it in the documentation. How can i do it easier? > Then I run the dics with the following parameters: > cfg = []; > cfg.grad = grads; > cfg.grid = grids_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = max_f; > cfg.hdmfile = 'myhead.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > In the simulations i get the same problem whereas the spectra look > reasonable and the dipole fit localizes the source in the right > place from > coherence peak. > The simulations were done with one source (virtual emg) coherent in > phase > and amplitude with the source time course. Source is modelled by a > dipole in > position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m > How do i perform a good frequency analysis in order to have a good > localization? > If it does not depend on fr. analysis which other factors can cause > this > problem? > Thank you for the patience > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri Jun 27 18:17:05 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 27 Jun 2008 18:17:05 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Dear Fieldtrippers, I am experiencing problems with the indexing of the MEG sensors in fieldtrip and the topographical representation of these sensors. For the layout file I am using the CTF274.lay file. I also use the regexp function and cfg.label to get the indexes of the sensors I want. In the figure that I have attached you can see where my problem comes from. Somehow the indexes corresponding to the sensors seem not to index the right sensors. Can anyone tell me what this could be related to? Thanks in advance for any helpful suggestions. Frederic _________________________________________________________________ Windows Live Messenger: Direkter Zugriff auf Ihre E-Mails! Ohne Neuanmeldung! http://get.live.com/de-de/messenger/overview ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: topo.gif Type: image/gif Size: 25115 bytes Desc: not available URL: From michelic72 at GMAIL.COM Fri Jun 27 18:34:45 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 18:34:45 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Hi Frederic In CTF274.lay you find all channels apart from sensor MRF43. Maybe in your case you have to exclude another sensor. This would be enough to shift the mapping of the channels on your topography. I would create my own CTF274_fred.lay and exclude the unnecessary sensor. Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Fri Jun 27 18:56:08 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Fri, 27 Jun 2008 09:56:08 -0700 Subject: research position in San Francisco, CA Message-ID: FieldTrip users, We are looking for new and experienced brain imagers wanting to work in our UCSF-affiliated research lab. Please apply at the following link if interested: http://www.ncire.org/positions.php?id=145 thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From enteka at HOTMAIL.COM Fri Jun 27 19:29:18 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 27 Jun 2008 17:29:18 +0000 Subject: wrong sensor indexes for topographical mapping In-Reply-To: Message-ID: Also, make sure that you are using the channel numbering used in the data structure, not the one in the .lay file. help topomap ... cfg.highlight = 'off' or the channel numbers you want to highlight (default = 'off'). These numbers should correspond with the channels in the data, not in the layout file. ... Nic ---------------------------------------- > Date: Fri, 27 Jun 2008 18:34:45 +0200 > From: michelic72 at GMAIL.COM > Subject: Re: [FIELDTRIP] wrong sensor indexes for topographical mapping > To: FIELDTRIP at NIC.SURFNET.NL > > Hi Frederic > In CTF274.lay you find all channels apart from sensor MRF43. > Maybe in your case you have to exclude another sensor. This would be enough > to shift the mapping of the channels on your topography. I would create my > own CTF274_fred.lay and exclude the unnecessary sensor. > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sun Jun 29 13:59:05 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 29 Jun 2008 13:59:05 +0200 Subject: CTF275 coherence Message-ID: Now works. I had some overloaded function somewhere for the routine cell2mat.m which masked the default one, and i could not read the grad structure from the dataset! Thanks! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From monikamellem at GMAIL.COM Mon Jun 30 13:21:33 2008 From: monikamellem at GMAIL.COM (Monika Mellem) Date: Mon, 30 Jun 2008 13:21:33 +0200 Subject: Reading in Neuroscan files Message-ID: Hello, I have noticed some things when reading in both Neuroscan .eeg and .cnt files. 1) When reading a Neuroscan .eeg file, read_event.m seems to put either "accept" or "reject" into the field event.value. According to how event.field is used later on, it should be putting the trigger values in this field which are in tmp.sweep.type. I modified the code as shown below. At line 885: event(end).value = tmp.sweep.type; rather than event(end).value = 'accept'; This line of code is within an if statement (if tmp.sweep.accept), and I'm not sure how the else statement should be modified if a trial/sweep should be rejected. 2) When reading in a Neuroscan .cnt file, read_header.m puts some bad channel labels into hdr.label using what it gets from the read_ns_cnt.m file (around line 564). Whatever is in orig.chan.names starts with the correct channels (about 10 of them) and then has blank values or odd characters for the rest of the channel labels. As a quick fix for just the channel labels, I just took the channel labels that read_ns_hdr.m finds and substituted them into hdr.label. See below. This doesn't fix the underlying problem in read_ns_cnt.m though which seems to be with the variables chandat and r.chan.names (lines 140-141). orig = read_ns_hdr(filename); hdr.label = orig.label; hdr.orig.chan.names = orig.label; Thanks! Monika Mellem ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 5 14:13:34 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 5 Jun 2008 14:13:34 +0200 Subject: Problems with frequency analysis... In-Reply-To: <483D7520.5000907@fil.ion.ucl.ac.uk> Message-ID: Hi. I have a problem regarding the function "freqanalysis", that I hope some of you can help me with. I have a Neuroscan .avg file called testdata.avg, and I would like to see a time-frequency plot of all the 64 channels. ___ In order to do this, I try the following: cfg1 = []; cfg1.datafile = 'testdata.avg' cfg1.headerfile = 'testdata.avg' dataFIC = preprocessing(cfg1); This gives me the data in dataFIC, and if I look at the data in dataFIC.trial{1} I get the correct data for all the 64 channels, so no problem here :o). ___ The next I try is: cfg2 = []; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.method = 'mtmconvol'; cfg2.taper = 'hanning'; cfg2.foi = 2:2:30; cfg2.t_ftimwin = ones(length(cfg2.foi),1).*0.5; cfg2.toi = 0.050:0.005:0.500; TFRhann = freqanalysis(cfg2, dataFIC); I would have expected to get the time-frequency coefficients in the TFRhann.powspctrm, but all I get is a lot of NaNs :o(. Am I doing something wrong, and should I set more parameters for the cfg2 ??? ___ When the problem with the freqanalysis is solved, I expect to be able to make the plots this way - does it look right (the testlay_64.lay file is one I have generated myself, and if I just run the code with the TFRhann with all the NaNs, at least the electrodes appear at the right location in the plot. cfg3.zparam = 'powspctrm'; cfg3.xlim = [0 0.5]; cfg3.ylim = [1 29]; cfg3.zlim = [-3e-27 3e-27]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) ___ I look forward to all suggestions regarding the problems with "freqanalysis". Best regards, Carina Graversen Ph.D student at Aalborg Hospital, Denmark ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 5 14:16:45 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 5 Jun 2008 14:16:45 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080605141334.mztnmdbf17eso448@webmail.kom.aau.dk> Message-ID: Hi Carina, What's the length and time axis of your original data segments? If the length of your data is shorter than the t_ftimwin specified in the configuration for freqanalysis, and/or the time points specified in toi do not overlap with the data's time-axis, NaNs will be the consequence :o(. Information about the time-axis can be found in data.time. Take care that the units correspond. Thus when data.time is in milliseconds, the specification in the configuration to freqanalysis should also be in milliseconds. Hope this helps. JM On Jun 5, 2008, at 2:13 PM, Carina Graversen wrote: > Hi. > > I have a problem regarding the function "freqanalysis", that I hope > some of you can help me with. > > I have a Neuroscan .avg file called testdata.avg, and I would like > to see a time-frequency plot of all the 64 channels. > ___ > > In order to do this, I try the following: > > cfg1 = []; > cfg1.datafile = 'testdata.avg' > cfg1.headerfile = 'testdata.avg' > dataFIC = preprocessing(cfg1); > > This gives me the data in dataFIC, and if I look at the data in > dataFIC.trial{1} I get the correct data for all the 64 channels, so > no problem here :o). > ___ > > The next I try is: > > cfg2 = []; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.method = 'mtmconvol'; > cfg2.taper = 'hanning'; > cfg2.foi = 2:2:30; > cfg2.t_ftimwin = ones(length(cfg2.foi), > 1).*0.5; > cfg2.toi = 0.050:0.005:0.500; > > TFRhann = freqanalysis(cfg2, dataFIC); > > I would have expected to get the time-frequency coefficients in the > TFRhann.powspctrm, but all I get is a lot of NaNs :o(. > > Am I doing something wrong, and should I set more parameters for > the cfg2 ??? > ___ > > When the problem with the freqanalysis is solved, I expect to be > able to make the plots this way - does it look right (the > testlay_64.lay file is one I have generated myself, and if I just > run the code with the TFRhann with all the NaNs, at least the > electrodes appear at the right location in the plot. > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0 0.5]; > cfg3.ylim = [1 29]; > cfg3.zlim = [-3e-27 3e-27]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > ___ > > I look forward to all suggestions regarding the problems with > "freqanalysis". > > Best regards, > Carina Graversen > Ph.D student at Aalborg Hospital, Denmark > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:00:35 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:00:35 +0200 Subject: Problems with frequency analysis... In-Reply-To: <3AD7A174-CE0B-41A2-B11E-557439220BB8@psy.gla.ac.uk> Message-ID: Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 12 14:13:06 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 12 Jun 2008 14:13:06 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612140035.n7s28eg6h0g0o8ks@webmail.kom.aau.dk> Message-ID: Hi Carina, I think this has nothing to do with the cfg settings of multiplot, but with the data that you are plotting. Did you first do time-frequency analysis? And what did you exactly plot? It looks like you plot the sinusoid itself isa the power of the sinusoid. Best Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 12, 2008 2:01 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Problems with frequency analysis... Hi Jan. Thanks for your reply - that helped quite a lot :o). However, now I have another problem, when I want to plot the time-frequency results. I use the code below, and as you will notice I just load an .avg file, and overwrite all the data in the file to be a single sinusoid with a frequency of 5 Hz. However, the results I get from multiplotTFR doesn't look as expected :o( The data I put in dataFIC.trial for all channels can be watched at: http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg And the result from multiplot TFR can be seen at: http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg - where I of course would have expected to have high power for all time instances at a frequency of 5 Hz. So I was wondering if anyone can tell which parameter to change in my configuration variables :o). Best regards, Carina function [] = diabetestest() close all clear all clc cfg1 = []; cfg1.datafile = 'diabetestest.avg' cfg1.headerfile = 'diabetestest.avg' dataFIC = preprocessing(cfg1); % ************************************************************************* % ------------------------------ DEBUG CODE ------------------------------ % ************************************************************************* test_frequency = 5; % Test frequency sample_frequency = 1000; % Sample frequency % Generating the dummy signal: for i = 1:301 dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); end for i = 1:1:68 dummy_matrix(i, :) = dummy_signal; end dataFIC.trial{1} = dummy_matrix; figure(101) plot(dummy_matrix(1, :), 'r') % ************************************************************************* % --------------------------- END OF DEBUG CODE --------------------------- % ************************************************************************* cfg2 = []; cfg2.method = 'wltconvol'; %= 'mtmconvol'; cfg2.output = 'pow'; cfg2.channel = 'all'; cfg2.foi = 0.1:0.05:20; cfg2.toi = 0.050:0.001:0.300 cfg2.width = 0.0005; TFRhann = freqanalysis(cfg2, dataFIC); % ------------------------------------------------------------------------- cfg3.zparam = 'powspctrm'; cfg3.xlim = [0.050 0.300]; cfg3.ylim = [1 10]; cfg3.layout = 'testlay_64.lay'; cfg3.showlabels = 'yes'; multiplotTFR(cfg3, TFRhann) % ------------------------------------------------------------------------- % cfg4 = []; % cfg4.channel = 'FP1'; % clf % % singleplotTFR(cfg4, TFRhann); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From cgra05 at HST.AUC.DK Thu Jun 12 14:17:07 2008 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 12 Jun 2008 14:17:07 +0200 Subject: Problems with frequency analysis... In-Reply-To: <003901c8cc85$abbac580$642dae83@fcdonders.nl> Message-ID: Hi Ingrid. First I extract the data by: dataFIC = preprocessing(cfg1); - And then overwrite the dataFIC.trial data with a sinusoid... Next I do a frequency analysis: TFRhann = freqanalysis(cfg2, dataFIC); And finally I try to plot the results of the frequency analysis: multiplotTFR(cfg3, TFRhann) I think this should plot the time-frequency results, right ??? Best regards, Carina Quoting Ingrid Nieuwenhuis : > Hi Carina, > > I think this has nothing to do with the cfg settings of multiplot, but with > the data that you are plotting. Did you first do time-frequency analysis? > And what did you exactly plot? It looks like you plot the sinusoid itself > isa the power of the sinusoid. > > Best Ingrid > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Carina Graversen > Sent: Thursday, June 12, 2008 2:01 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] Problems with frequency analysis... > > Hi Jan. > > Thanks for your reply - that helped quite a lot :o). > > However, now I have another problem, when I want to plot the > time-frequency results. I use the code below, and as you will notice I > just load an .avg file, and overwrite all the data in the file to be a > single sinusoid with a frequency of 5 Hz. > > However, the results I get from multiplotTFR doesn't look as expected :o( > > The data I put in dataFIC.trial for all channels can be watched at: > http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg > > And the result from multiplot TFR can be seen at: > http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg > > - where I of course would have expected to have high power for all time > instances at a frequency of 5 Hz. So I was wondering if anyone can tell > which parameter to change in my configuration variables :o). > > Best regards, Carina > > > > > > > > function [] = diabetestest() > > close all > clear all > clc > > cfg1 = []; > cfg1.datafile = 'diabetestest.avg' > cfg1.headerfile = 'diabetestest.avg' > > dataFIC = preprocessing(cfg1); > > % ************************************************************************* > % ------------------------------ DEBUG CODE ------------------------------ > % ************************************************************************* > > test_frequency = 5; % Test frequency > sample_frequency = 1000; % Sample frequency > > % Generating the dummy signal: > for i = 1:301 > dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); > end > > for i = 1:1:68 > dummy_matrix(i, :) = dummy_signal; end > > dataFIC.trial{1} = dummy_matrix; > > figure(101) > plot(dummy_matrix(1, :), 'r') > > % ************************************************************************* > % --------------------------- END OF DEBUG CODE --------------------------- > % ************************************************************************* > > cfg2 = []; > cfg2.method = 'wltconvol'; %= 'mtmconvol'; > cfg2.output = 'pow'; > cfg2.channel = 'all'; > cfg2.foi = 0.1:0.05:20; > cfg2.toi = 0.050:0.001:0.300 > cfg2.width = 0.0005; > > TFRhann = freqanalysis(cfg2, dataFIC); > > % ------------------------------------------------------------------------- > > cfg3.zparam = 'powspctrm'; > cfg3.xlim = [0.050 0.300]; > cfg3.ylim = [1 10]; > cfg3.layout = 'testlay_64.lay'; > cfg3.showlabels = 'yes'; > > multiplotTFR(cfg3, TFRhann) > > % ------------------------------------------------------------------------- > > % cfg4 = []; > % cfg4.channel = 'FP1'; > % clf > % % singleplotTFR(cfg4, TFRhann); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > - - - Carina Graversen M.Sc. Biomedical Engineering, Ph.D. student Aalborg hospital +45 26282093 cgra05 at hst.auc.dk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 12 14:23:10 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 12 Jun 2008 14:23:10 +0200 Subject: Problems with frequency analysis... In-Reply-To: <20080612141707.vd9suhwv9hzscs8w@webmail.kom.aau.dk> Message-ID: Hi Carina, I'm not a wavelet expert, but the cfg.width specification looks a bit odd to me. I would expect this to be an integer number, specifying the number of oscillation-cycles at each frequency. Irrespective of this, you might want to generate different surrogate data in the first place: the data segments are only 0.3 seconds long. This means that you can only optimally fit frequencies of multiples of 1/0.3, so 3.33333, 6.666667 etc. It only makes sense to try to estimate low frequency data, if the data segments are really long (and according to your specification this would be at least 20 seconds). Yours, Jan-Mathijs On Jun 12, 2008, at 2:17 PM, Carina Graversen wrote: > Hi Ingrid. > > First I extract the data by: > dataFIC = preprocessing(cfg1); > - And then overwrite the dataFIC.trial data with a sinusoid... > > Next I do a frequency analysis: > TFRhann = freqanalysis(cfg2, dataFIC); > > And finally I try to plot the results of the frequency analysis: > multiplotTFR(cfg3, TFRhann) > > > I think this should plot the time-frequency results, right ??? > > Best regards, Carina > > > > Quoting Ingrid Nieuwenhuis : > >> Hi Carina, >> >> I think this has nothing to do with the cfg settings of multiplot, >> but with >> the data that you are plotting. Did you first do time-frequency >> analysis? >> And what did you exactly plot? It looks like you plot the sinusoid >> itself >> isa the power of the sinusoid. >> >> Best Ingrid >> >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] >> On Behalf >> Of Carina Graversen >> Sent: Thursday, June 12, 2008 2:01 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] Problems with frequency analysis... >> >> Hi Jan. >> >> Thanks for your reply - that helped quite a lot :o). >> >> However, now I have another problem, when I want to plot the >> time-frequency results. I use the code below, and as you will >> notice I >> just load an .avg file, and overwrite all the data in the file to >> be a >> single sinusoid with a frequency of 5 Hz. >> >> However, the results I get from multiplotTFR doesn't look as >> expected :o( >> >> The data I put in dataFIC.trial for all channels can be watched at: >> http://www.hst.auc.dk/~cgra/fieldtrip_timeplot.jpg >> >> And the result from multiplot TFR can be seen at: >> http://www.hst.auc.dk/~cgra/fieldtrip_multiplotTFR.jpg >> >> - where I of course would have expected to have high power for all >> time >> instances at a frequency of 5 Hz. So I was wondering if anyone can >> tell >> which parameter to change in my configuration variables :o). >> >> Best regards, Carina >> >> >> >> >> >> >> >> function [] = diabetestest() >> >> close all >> clear all >> clc >> >> cfg1 = []; >> cfg1.datafile = 'diabetestest.avg' >> cfg1.headerfile = 'diabetestest.avg' >> >> dataFIC = preprocessing(cfg1); >> >> % >> ********************************************************************* >> **** >> % ------------------------------ DEBUG CODE >> ------------------------------ >> % >> ********************************************************************* >> **** >> >> test_frequency = 5; % Test frequency >> sample_frequency = 1000; % Sample frequency >> >> % Generating the dummy signal: >> for i = 1:301 >> dummy_signal(i)= 5*sin(2*pi*test_frequency*i/sample_frequency); >> end >> >> for i = 1:1:68 >> dummy_matrix(i, :) = dummy_signal; end >> >> dataFIC.trial{1} = dummy_matrix; >> >> figure(101) >> plot(dummy_matrix(1, :), 'r') >> >> % >> ********************************************************************* >> **** >> % --------------------------- END OF DEBUG CODE >> --------------------------- >> % >> ********************************************************************* >> **** >> >> cfg2 = []; >> cfg2.method = 'wltconvol'; %= >> 'mtmconvol'; >> cfg2.output = 'pow'; >> cfg2.channel = 'all'; >> cfg2.foi = 0.1:0.05:20; >> cfg2.toi = 0.050:0.001:0.300 >> cfg2.width = 0.0005; >> >> TFRhann = freqanalysis(cfg2, >> dataFIC); >> >> % >> --------------------------------------------------------------------- >> ---- >> >> cfg3.zparam = 'powspctrm'; >> cfg3.xlim = [0.050 0.300]; >> cfg3.ylim = [1 10]; >> cfg3.layout = 'testlay_64.lay'; >> cfg3.showlabels = 'yes'; >> >> multiplotTFR(cfg3, TFRhann) >> >> % >> --------------------------------------------------------------------- >> ---- >> >> % cfg4 = []; >> % cfg4.channel = 'FP1'; >> % clf >> % % singleplotTFR(cfg4, TFRhann); >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. >> > > > > - - - > Carina Graversen > M.Sc. Biomedical Engineering, Ph.D. student > Aalborg hospital > +45 26282093 > cgra05 at hst.auc.dk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Fri Jun 13 18:20:51 2008 From: findley at GMAIL.COM (Will Findley) Date: Fri, 13 Jun 2008 18:20:51 +0200 Subject: Using ICBM Probabilistic Atlases Message-ID: I would like to localize activity onto the ICBM probabilistic atlases from LONI. It is unclear to me how and where I should modify the DICS localization procedure to utilize them (particularly the tissue atlas). I also do not know how to obtain fiducial positions for them. Does anyone have experience localizing onto these atlases that would help? Thanks, Will ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:45:51 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:45:51 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Dear Will, I haven't use these particular atlases but I've recently worked on a similar problem. Basically you can interpolate your source data on any MRI. To do that you should set the source.transform field (where 'source' is beamformer output) to the transformation matrix from the coordinate system in which you did the beamformer to the coordinate system of the target MRI. Then you call sourceinterpolate() with that modified source struct and the target MRI as inputs. To get that transformation matrix you will need some fiducials and with that I can't help you. If that atlas has a corresponding structural image you can load that image with some software (I use SPM) and click on some landmarks to find their coordinates. You can then find the coordinates of the same landmarks in your beamformer coordinate system. Of course the precision of your coregistration will depend directly on how precisely you can define the fiducials in the two systems. Given at least 3 matching landmarks the transformation matrix can be computed. How it's done exactly depends on some details that I wouldn't like to get into here. If you don't get better help, write me and I can try to share what I know. Best, Vladimir On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: > I would like to localize activity onto the ICBM probabilistic atlases from > LONI. It is unclear to me how and where I should modify the DICS > localization procedure to utilize them (particularly the tissue atlas). I > also do not know how to obtain fiducial positions for them. Does anyone > have experience localizing onto these atlases that would help? > > Thanks, > Will > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Jun 13 19:54:39 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 13 Jun 2008 18:54:39 +0100 Subject: Using ICBM Probabilistic Atlases In-Reply-To: Message-ID: Just one slightly simpler idea. If you have a structural image of your subject that you use for beamforming and there is a structural that comes with the atlas you can coregister these two (that can be done in SPM) and then (given that you know how the space of the subject's structural relates to the beamformer space) you won't need any fiducials. Best, Vladimir On Fri, Jun 13, 2008 at 6:45 PM, Vladimir Litvak wrote: > Dear Will, > > I haven't use these particular atlases but I've recently worked on a > similar problem. Basically you can interpolate your source data on any > MRI. To do that you should set the source.transform field (where > 'source' is beamformer output) to the transformation matrix from the > coordinate system in which you did the beamformer to the coordinate > system of the target MRI. Then you call sourceinterpolate() with that > modified source struct and the target MRI as inputs. > > To get that transformation matrix you will need some fiducials and > with that I can't help you. If that atlas has a corresponding > structural image you can load that image with some software (I use > SPM) and click on some landmarks to find their coordinates. You can > then find the coordinates of the same landmarks in your beamformer > coordinate system. Of course the precision of your coregistration will > depend directly on how precisely you can define the fiducials in the > two systems. Given at least 3 matching landmarks the transformation > matrix can be computed. How it's done exactly depends on some details > that I wouldn't like to get into here. > > If you don't get better help, write me and I can try to share what I know. > > Best, > > Vladimir > > > > > On Fri, Jun 13, 2008 at 5:20 PM, Will Findley wrote: >> I would like to localize activity onto the ICBM probabilistic atlases from >> LONI. It is unclear to me how and where I should modify the DICS >> localization procedure to utilize them (particularly the tissue atlas). I >> also do not know how to obtain fiducial positions for them. Does anyone >> have experience localizing onto these atlases that would help? >> >> Thanks, >> Will >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Mon Jun 16 18:59:40 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Mon, 16 Jun 2008 11:59:40 -0500 Subject: CMCorig data, Coherence Tutorial Message-ID: Jan-Mathijs - Thank you for responding. I have waited to reply as I have steadily worked my way through the Coherence Tutorial, and most all of the beamforming tutorial - there a major question at this point: My segmented MRI is never aligned with the MRI image it is derived from. I am using the program MRIcro to convert *.dcm files to an *.img file before I read it into fieldtrip using the read_fcdc_mri.m function. Then I segment using spm2 through fieldtrip's volumesegment.m function, and flip dimensions as discussed in the tutorial. This works correctly for the sample data, file Subject01.mri, but for my *.img files, when I use sourceplot to see if the segmented brain fits and the MRI are aligned correctly, they are unfortunately not. I have tried different flipping methods to no avail. Any suggestions? Thank you in advance, Nathan Dees ----- Original Message ----- From: "jan-mathijs schoffelen" To: Sent: Friday, May 09, 2008 3:39 AM Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > Dear Nathan, > > Indeed the CMCorig mat-file is missing from the ftp-server, but in > principle it can be generated by executing the preceding steps in the > tutorial. We will change the tutorial accordingly. Historically, the > tutorials have been used at the FCDC toolkit-courses for data analysis, > and students had the mat-file available to save some time. > However, from your mail I conclude that you had some problems running the > tutorial itself, probably unrelated to the (un)availability of the > CMCorig file. If so, could you just retry running the tutorial and let us > know whether and where specified problems arise? > > Thanks, > > Jan-Mathijs > > On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > >> How can one gain access to the dataset 'CMCorig' discussed in the >> tutorials, specifically the tutorial on Coherence? This file is not >> included in the SubjectCMC data posted on the tutorial data section of >> the >> website. >> >> Has anyone else had trouble running the Coherence tutorial from start to >> finish - I thought having access to this data might help me get through >> certain sections? >> >> Thank you >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Erick.Ortiz at MED.UNI-TUEBINGEN.DE Mon Jun 16 19:40:53 2008 From: Erick.Ortiz at MED.UNI-TUEBINGEN.DE (Erick Britis Ortiz) Date: Mon, 16 Jun 2008 19:40:53 +0200 Subject: bwlabeln / bug reports Message-ID: Hello all, About cluster-based statistics: when I set cfg.correctm = ‘cluster’, the funcion "findcluster" tries to call "bwlabeln", that is part of the Image Processing Toolbox. But this toolbox is not available to me at the moment. How to deal with that? Any alternatives to enable the use of cluster-based statistics? I also would like to contribute some bug reports (even solutions!), so should I submit them to the list or is there some web interface or a person to whom to send them directly? Best, Erick ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Jun 17 08:24:14 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 17 Jun 2008 08:24:14 +0200 Subject: bwlabeln / bug reports In-Reply-To: <4856A5A5.2050205@med.uni-tuebingen.de> Message-ID: Hi, > About cluster-based statistics: when I set cfg.correctm = ‘cluster’, > the funcion "findcluster" tries to call "bwlabeln", that is part of > the Image Processing Toolbox. But this toolbox is not available to > me at the moment. you may try running your (cluster-stats) code in Octave: http://www.octave.org/ the code is usually very compatible and sometimes only needs a little tweaking. don't forget to also download octaveforge which should have image processing functions included. here is a reference of available functions: http://octave.sourceforge.net/doc/index.html good luck, nathan > > > How to deal with that? Any alternatives to enable the use of cluster- > based statistics? > > > I also would like to contribute some bug reports (even solutions!), > so should I submit them to the list or is there some web interface > or a person to whom to send them directly? > > > Best, > Erick > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Thu Jun 19 12:09:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 19 Jun 2008 12:09:43 +0200 Subject: MEG's Lead Field Message-ID: An HTML attachment was scrubbed... URL: From soren.r.christensen at GSK.COM Thu Jun 19 13:04:22 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Thu, 19 Jun 2008 12:04:22 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 18-Jun-2008 and will not return until 24-Jun-2008. I'll be back June 24th ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Jun 20 16:34:43 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 20 Jun 2008 16:34:43 +0200 Subject: Lead Field Message-ID: Hi everybody I tested the leadfield routine (compute_leadfield.m) for current dipole in MEG forward solution. How are the units expressed? I expect the current dipole to be expressed in nA.m according to CTF convention (i am using a 275 channels MEG CTF system), the gradiometers' positions in cm and the lead field in Tesla. Nevertheless i compared it with CTF software and there is quite a high mismatch in the scaling factor, and the field is not perfectly distributed as in CTF software forward solution. In the Fieldtrip documentation it is mentioned a leadfield computation method from Lütkenhöner, Habilschrift '92 which i could not find. How do i get to the article? I attach the code: dip_pos = [2 2 10]; % cm dip_mom = [10 0 0]; % 10 nA*m % grad: gradiometers structure % vol: conductive sphere model lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Fri Jun 20 19:10:51 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Fri, 20 Jun 2008 18:10:51 +0100 Subject: Lead Field In-Reply-To: Message-ID: Hi Cristiano, I'll attempt to help you with this but I'd also appreciate some input on this topic from others on the list to check my thinking is correct. I think your strange results are due to the mixing of several different units of measurement. If the positions of sensor and source are expressed in metres and the dipole moment in A-m (i.e. all in standard units), then the field strengths due to the source as calculated by compute_leadfield.m will be in Tesla. Of course, you can use cm or mm for your scale but that will just linearly scale the field values, i.e. converting the distances from metres to cm (increase of 10^2) will _decrease_ the field values (reduction of 10^2) if the same moment value is specified in both calculations. Similarly, expressing the moment in units of nA-m will also scale the field values linearly, but in that case it will increase the fields by 10^9 relative to the same moment expressed in A-m. For your example the use of cm will decrease the field values by 10^2 and specifiying the dipole moment in nA-m will increase it by 10^9 - all this is relative to standard units. Therefore, if interpreted as Teslas, your fields are probably too large by a factor of 10^7 for your desired source stregth of 10nA-m. You could standardise your units by multiplying the resultant fields by 1e-7 or by using the following when you compute them: dip_mom = [1e-8 0 0]; % 10 nA-m as A-m but presumably as your sensor positions and orientations are in cm so you could either convert them and the dipole position to metres beforehand, or otherwise if you use the above moment value you will still have to multiply the resulting fields by 10^2 to compensate for the cm scaling, which should give you reasonable field strengths in Tesla. Hope that helps and does not confuse, Padraig Cristiano Micheli wrote: > Hi everybody > I tested the leadfield routine (compute_leadfield.m) for current dipole in > MEG forward solution. > How are the units expressed? > I expect the current dipole to be expressed in nA.m according to CTF > convention (i am using a 275 channels MEG CTF system), the gradiometers' > positions in cm and the lead field in Tesla. > Nevertheless i compared it with CTF software and there is quite a high > mismatch in the scaling factor, and the field is not perfectly distributed > as in CTF software forward solution. > In the Fieldtrip documentation it is mentioned a leadfield computation > method from Lütkenhöner, Habilschrift '92 which i could not find. How do i > get to the article? > I attach the code: > > dip_pos = [2 2 10]; % cm > dip_mom = [10 0 0]; % 10 nA*m > % grad: gradiometers structure > % vol: conductive sphere model > lf = compute_leadfield(dip_pos, grad, vol, 'singlesphere','yes')*dip_mom'; > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Jun 20 21:01:12 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 20 Jun 2008 14:01:12 -0500 Subject: Lead Field In-Reply-To: <485BE49B.9060204@psych.york.ac.uk> Message-ID: Greetings Padgaig, thank you for that explanation. I am analysing some MEG/EEG data using EEGLAB (which incorporates several Fieldtrip routines!). When I exported the data to SPSS-PC and graphs show values in the 10,000 and 100,000 micro volt range. EEG data was gathered together with the MEG in a MEG chamber. Am I seeing the same issue there or is it something else. I appreciate any help. regards gopa Quoting Pádraig Kitterick : > Hi Cristiano, > > I'll attempt to help you with this but I'd also appreciate some input > on > this topic from others on the list to check my thinking is correct. > > I think your strange results are due to the mixing of several > different > units of measurement. If the positions of sensor and source are > expressed in metres and the dipole moment in A-m (i.e. all in > standard > units), then the field strengths due to the source as calculated by > compute_leadfield.m will be in Tesla. Of course, you can use cm or mm > > for your scale but that will just linearly scale the field values, > i.e. > converting the distances from metres to cm (increase of 10^2) will > _decrease_ the field values (reduction of 10^2) if the same moment > value > is specified in both calculations. Similarly, expressing the moment > in > units of nA-m will also scale the field values linearly, but in that > > case it will increase the fields by 10^9 relative to the same moment > > expressed in A-m. > > For your example the use of cm will decrease the field values by 10^2 > > and specifiying the dipole moment in nA-m will increase it by 10^9 - > all > this is relative to standard units. Therefore, if interpreted as > Teslas, > your fields are probably too large by a factor of 10^7 for your > desired > source stregth of 10nA-m. You could standardise your units by > multiplying the resultant fields by 1e-7 or by using the following > when > you compute them: > > dip_mom = [1e-8 0 0]; % 10 nA-m as A-m > > but presumably as your sensor positions and orientations are in cm so > > you could either convert them and the dipole position to metres > beforehand, or otherwise if you use the above moment value you will > still have to multiply the resulting fields by 10^2 to compensate for > > the cm scaling, which should give you reasonable field strengths in > Tesla. > > Hope that helps and does not confuse, > > Padraig > > Cristiano Micheli wrote: > > Hi everybody > > I tested the leadfield routine (compute_leadfield.m) for current > dipole in > > MEG forward solution. > > How are the units expressed? > > I expect the current dipole to be expressed in nA.m according to > CTF > > convention (i am using a 275 channels MEG CTF system), the > gradiometers' > > positions in cm and the lead field in Tesla. > > Nevertheless i compared it with CTF software and there is quite a > high > > mismatch in the scaling factor, and the field is not perfectly > distributed > > as in CTF software forward solution. > > In the Fieldtrip documentation it is mentioned a leadfield > computation > > method from Lütkenhöner, Habilschrift '92 which i could not find. > How do i > > get to the article? > > I attach the code: > > > > dip_pos = [2 2 10]; % cm > > dip_mom = [10 0 0]; % 10 nA*m > > % grad: gradiometers structure > > % vol: conductive sphere model > > lf = compute_leadfield(dip_pos, grad, vol, > 'singlesphere','yes')*dip_mom'; > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 13:09:43 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 12:09:43 +0100 Subject: Lead Field In-Reply-To: <1213988472.485bfe7830cfe@bamamail.ua.edu> Message-ID: I honestly couldn't say without knowing more about the way in which the data was processed (not too familiar with EEGLAB), but it seems as if you are referring to raw data and not leadfield calculations. Therefore, it's unlikely that the issues discussed previously would be affecting you. Padraig Gopakumar Venugopalan wrote: > Greetings Padgaig, thank you for that explanation. I am analysing some > MEG/EEG data using EEGLAB (which incorporates several Fieldtrip > routines!). When I exported the data to SPSS-PC and graphs show values > in the 10,000 and 100,000 micro volt range. EEG data was gathered > together with the MEG in a MEG chamber. Am I seeing the same issue > there or is it something else. I appreciate any help. > regards > gopa > > > Quoting Pádraig Kitterick : > >> Hi Cristiano, >> >> I'll attempt to help you with this but I'd also appreciate some input >> on >> this topic from others on the list to check my thinking is correct. >> >> I think your strange results are due to the mixing of several >> different >> units of measurement. If the positions of sensor and source are >> expressed in metres and the dipole moment in A-m (i.e. all in >> standard >> units), then the field strengths due to the source as calculated by >> compute_leadfield.m will be in Tesla. Of course, you can use cm or mm >> >> for your scale but that will just linearly scale the field values, >> i.e. >> converting the distances from metres to cm (increase of 10^2) will >> _decrease_ the field values (reduction of 10^2) if the same moment >> value >> is specified in both calculations. Similarly, expressing the moment >> in >> units of nA-m will also scale the field values linearly, but in that >> >> case it will increase the fields by 10^9 relative to the same moment >> >> expressed in A-m. >> >> For your example the use of cm will decrease the field values by 10^2 >> >> and specifiying the dipole moment in nA-m will increase it by 10^9 - >> all >> this is relative to standard units. Therefore, if interpreted as >> Teslas, >> your fields are probably too large by a factor of 10^7 for your >> desired >> source stregth of 10nA-m. You could standardise your units by >> multiplying the resultant fields by 1e-7 or by using the following >> when >> you compute them: >> >> dip_mom = [1e-8 0 0]; % 10 nA-m as A-m >> >> but presumably as your sensor positions and orientations are in cm so >> >> you could either convert them and the dipole position to metres >> beforehand, or otherwise if you use the above moment value you will >> still have to multiply the resulting fields by 10^2 to compensate for >> >> the cm scaling, which should give you reasonable field strengths in >> Tesla. >> >> Hope that helps and does not confuse, >> >> Padraig >> >> Cristiano Micheli wrote: >>> Hi everybody >>> I tested the leadfield routine (compute_leadfield.m) for current >> dipole in >>> MEG forward solution. >>> How are the units expressed? >>> I expect the current dipole to be expressed in nA.m according to >> CTF >>> convention (i am using a 275 channels MEG CTF system), the >> gradiometers' >>> positions in cm and the lead field in Tesla. >>> Nevertheless i compared it with CTF software and there is quite a >> high >>> mismatch in the scaling factor, and the field is not perfectly >> distributed >>> as in CTF software forward solution. >>> In the Fieldtrip documentation it is mentioned a leadfield >> computation >>> method from Lütkenhöner, Habilschrift '92 which i could not find. >> How do i >>> get to the article? >>> I attach the code: >>> >>> dip_pos = [2 2 10]; % cm >>> dip_mom = [10 0 0]; % 10 nA*m >>> % grad: gradiometers structure >>> % vol: conductive sphere model >>> lf = compute_leadfield(dip_pos, grad, vol, >> 'singlesphere','yes')*dip_mom'; >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> -- >> Pádraig Kitterick >> Graduate Student >> Department of Psychology >> University of York >> Heslington >> York YO10 5DD >> UK >> >> Tel: +44 (0) 1904 43 3170 >> Email: p.kitterick at psych.york.ac.uk >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 15:46:08 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 15:46:08 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: <007e01c8cfd2$5dd01960$2d01a8c0@DGDPBS81> Message-ID: Dear Nathan, Indeed, the flipping as applied in the tutorial should be applied for volumes, segmented from .mri files. This has an obscure reason, which I never managed to find. Importantly, the flipping has to be applied in order for the transformation-matrix, as stored in mri.transform (or segment.transform), to correctly transform from volume-based voxel indices into head-space. Did you check, whether the segmentation itself worked? In other words, do the gray/white/csf volumes look reasonable with respect to the anatomy from which it is derived? As far as I know, the spm segmentation routine which is used by fieldtrip, matches the input anatomy to some gray/white/csf template volumes, but assumes a quite good coregistration between the templates and the input volume, both in terms of coordinate-frame (which should be spm-based), and in the way the volumetric data are stored physically in the data-matrix. These issues are taken care of when volumesegment is instructed to interpret the coordinate-system as being 'ctf'-based, either by some user-interactions prompted when the function is executed, or by explicitly putting cfg.coordinates to 'ctf'. You mention you convert your dicoms to analyze format, but this step in itself does not tell fieldtrip how to interpret the volumetric data. Does the image have a transformation matrix attached when loaded in? If not, you should probably first need to use volumerealign to specify the fiducial locations. This will give you a transformation matrix attached to the mri according to ctf-conventions. Next volumesegment should be called with cfg.coordinates = 'ctf'. Hope this helps, Jan-Mathijs On Jun 16, 2008, at 6:59 PM, Nathan Dees wrote: > Jan-Mathijs - > > Thank you for responding. I have waited to reply as I have > steadily worked my way through the Coherence > Tutorial, and most all of the beamforming tutorial - there a major > question at this point: > > My segmented MRI is never aligned with the MRI image it is derived > from. I am using the program MRIcro to convert *.dcm files to an > *.img file before I read it into fieldtrip using the > read_fcdc_mri.m function. Then I segment using spm2 through > fieldtrip's volumesegment.m function, and flip dimensions as > discussed in the tutorial. This works correctly for the sample > data, file Subject01.mri, but for my *.img files, when I use > sourceplot to see if the segmented brain fits and the MRI are > aligned correctly, they are unfortunately not. I have tried > different flipping methods to no avail. > > Any suggestions? > > Thank you in advance, > Nathan Dees > > > > ----- Original Message ----- From: "jan-mathijs schoffelen" > > To: > Sent: Friday, May 09, 2008 3:39 AM > Subject: Re: [FIELDTRIP] CMCorig data, Coherence Tutorial > > >> Dear Nathan, >> >> Indeed the CMCorig mat-file is missing from the ftp-server, but in >> principle it can be generated by executing the preceding steps in the >> tutorial. We will change the tutorial accordingly. Historically, the >> tutorials have been used at the FCDC toolkit-courses for data >> analysis, >> and students had the mat-file available to save some time. >> However, from your mail I conclude that you had some problems >> running the >> tutorial itself, probably unrelated to the (un)availability of the >> CMCorig file. If so, could you just retry running the tutorial >> and let us >> know whether and where specified problems arise? >> >> Thanks, >> >> Jan-Mathijs >> >> On May 7, 2008, at 12:54 AM, Nathan Dees wrote: >> >>> How can one gain access to the dataset 'CMCorig' discussed in the >>> tutorials, specifically the tutorial on Coherence? This file is not >>> included in the SubjectCMC data posted on the tutorial data >>> section of >>> the >>> website. >>> >>> Has anyone else had trouble running the Coherence tutorial from >>> start to >>> finish - I thought having access to this data might help me get >>> through >>> certain sections? >>> >>> Thank you >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of >>> the FieldTrip toolbox, to share experiences and to discuss new >>> ideas >>> for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the >> FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Mon Jun 23 15:59:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Mon, 23 Jun 2008 15:59:20 +0200 Subject: Lead Field Message-ID: Hi Pádraig Thank you for the answer. It helped to fix the scaling factor. Now i get a magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick up coils (with Fieldtrip routine). Still i cannot get the same field as for the CTF software. In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. I think the two routines use different equations. CTF implements Sarvas' forward model for a spherical conductor in a homogeneus medium ("Basic mathematical and electromagnetic concepts of the biomagnetic inverse problem", Sarvas J, 1987). I cannot get to the source of Fieldtrip's method for the forward model, which is mentioned in meg_leadfield1.m routine head comment (adapted from Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. I found from Lütkenhöner : "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: LIT-Verlag, 1992 Unfortunately i do not have access neither to the book nor to formulas. How can i check it? If it does not depend on implementation details (which sounds also plausible since the error is quite high), what can be again the problem to make the two fields match? Thank you Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From p.kitterick at PSYCH.YORK.AC.UK Mon Jun 23 16:16:33 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Mon, 23 Jun 2008 15:16:33 +0100 Subject: Lead Field In-Reply-To: Message-ID: The method implemented in meg_leadfield1.m gives the same result as the equations of Sarvas. It's just a different formulation of the forward problem. I've produced identical leadfields calculated with several different packages, including fieldtrip, and also a direct implementation of the Sarvas equations. It is possible that the CTF software is accounting for the coil loop radii and other machine-specific inputs to the calculations, but these rarely change the fields by large amounts. Are you using the same sphere to approximate the head in both instances? The meg_leadfield1.m code assumes that the centre of the single sphere is at the origin, (0,0,0). If the centre of the sphere isn't at the origin, then you need to adjust the dipole and sensor locations by subtracting the centre of the sphere from their coordinates. The CTF system could well be doing this adjustment using a pre-programmed sphere centre based on either a general estimation or coregistration information it has available to it. Unless you can access all the information that it is using to do the calculations, it will be very hard to get identical answers. The best thing is to ensure that you have a good estimate of the centre of the single sphere for your sensor array based on an average head/brain or a particular subject you are trying to model. Then your fields will be as accurate, despite not being identical in absolute numerical values to those produced by the CTF software. Padraig Cristiano Micheli wrote: > Hi Pádraig > Thank you for the answer. It helped to fix the scaling factor. Now i get a > magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far from the pick > up coils (with Fieldtrip routine). > Still i cannot get the same field as for the CTF software. > In CTF leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 > channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. > I think the two routines use different equations. CTF implements Sarvas' > forward model for a spherical conductor in a homogeneus medium ("Basic > mathematical and electromagnetic concepts of the biomagnetic inverse > problem", Sarvas J, 1987). > I cannot get to the source of Fieldtrip's method for the forward model, > which is mentioned in meg_leadfield1.m routine head comment (adapted from > Luetkenhoener, Habilschrift '92). It sounds like an habilitation work. > I found from Lütkenhöner : > "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", Münster: > LIT-Verlag, 1992 > Unfortunately i do not have access neither to the book nor to formulas. > How can i check it? > If it does not depend on implementation details (which sounds also plausible > since the error is quite high), what can be again the problem to make the > two fields match? > Thank you > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Mon Jun 23 16:20:24 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 23 Jun 2008 16:20:24 +0200 Subject: Lead Field In-Reply-To: <485FB041.7050101@psych.york.ac.uk> Message-ID: Hi guys, May I quickly add to the discussion that I remember having seen that Cristiano uses myhead.hdm as an input to prepare_headmodel, and the resulting vol-structure for compute_leadfield. Is myhead.hdm a multisphere model? Just to be sure: The call to compute_leadfield with additional inputs 'singlesphere' 'yes' does not lead to a single-sphere-based leadfield, as far as I know. Single sphericity is only ensured when vol contains just one .o, and one .r. Yours, JM On Jun 23, 2008, at 4:16 PM, Pádraig Kitterick wrote: > The method implemented in meg_leadfield1.m gives the same result as > the equations of Sarvas. It's just a different formulation of the > forward problem. I've produced identical leadfields calculated with > several different packages, including fieldtrip, and also a direct > implementation of the Sarvas equations. > > It is possible that the CTF software is accounting for the coil > loop radii and other machine-specific inputs to the calculations, > but these rarely change the fields by large amounts. Are you using > the same sphere to approximate the head in both instances? The > meg_leadfield1.m code assumes that the centre of the single sphere > is at the origin, (0,0,0). If the centre of the sphere isn't at the > origin, then you need to adjust the dipole and sensor locations by > subtracting the centre of the sphere from their coordinates. The > CTF system could well be doing this adjustment using a pre- > programmed sphere centre based on either a general estimation or > coregistration information it has available to it. Unless you can > access all the information that it is using to do the calculations, > it will be very hard to get identical answers. > > The best thing is to ensure that you have a good estimate of the > centre of the single sphere for your sensor array based on an > average head/brain or a particular subject you are trying to model. > Then your fields will be as accurate, despite not being identical > in absolute numerical values to those produced by the CTF software. > > Padraig > > Cristiano Micheli wrote: >> Hi Pádraig >> Thank you for the answer. It helped to fix the scaling factor. Now >> i get a >> magnetic field of order of ~1 mT for a 10nA.m dipole ~3 cm far >> from the pick >> up coils (with Fieldtrip routine). >> Still i cannot get the same field as for the CTF software. In CTF >> leadfield i get [min max] values of: 1e-06 *[ -67.1 100.4] Tesla (275 >> channels), while in Fieldtrip i get: [-0.0011 0.0016] Tesla. >> I think the two routines use different equations. CTF implements >> Sarvas' >> forward model for a spherical conductor in a homogeneus medium >> ("Basic >> mathematical and electromagnetic concepts of the biomagnetic inverse >> problem", Sarvas J, 1987). >> I cannot get to the source of Fieldtrip's method for the forward >> model, >> which is mentioned in meg_leadfield1.m routine head comment >> (adapted from >> Luetkenhoener, Habilschrift '92). It sounds like an habilitation >> work. >> I found from Lütkenhöner : >> "Möglichkeiten und Grenzen der neuromagnetischen Quellenanalyse", >> Münster: >> LIT-Verlag, 1992 >> Unfortunately i do not have access neither to the book nor to >> formulas. >> How can i check it? If it does not depend on implementation >> details (which sounds also plausible >> since the error is quite high), what can be again the problem to >> make the >> two fields match? >> Thank you >> Cristiano >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> fcdonders/fieldtrip. > > -- > Pádraig Kitterick > Graduate Student > Department of Psychology > University of York > Heslington > York YO10 5DD > UK > > Tel: +44 (0) 1904 43 3170 > Email: p.kitterick at psych.york.ac.uk > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 14:51:50 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 14:51:50 +0200 Subject: Lead Field Message-ID: No it's a single sphere head model (only one radius). Actually i had in mind to generate an equivalent multisphere model to test the difference of the two solutions (one sphere-multisphere). I am running a dics with an external reference channel in a isometric pinch protocol and i want to verify what i find with coherence analysis (controlateral M1 activation). Moreover i wanted to find the ipsilateral M1 and cerebellum activations applying a 'stereo' dics. Do you know if this method is already implemented in Fieldtrip? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Tue Jun 24 15:10:31 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Tue, 24 Jun 2008 15:10:31 +0200 Subject: Lead Field Message-ID: ..and i fixed the problem with the lead field. I simply had to set the right grad.tra matrix Since i discovered that [eye(275) -eye(275)] does not give the right results i looked inside the orientations of the magnetometers and i discovered that they are randomly pointing upwards or inwards. I fixed it and now the results match with ctf software. Thank you for the advices. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From myles.reilly at HSC.UTAH.EDU Tue Jun 24 23:29:36 2008 From: myles.reilly at HSC.UTAH.EDU (Myles Reilly) Date: Tue, 24 Jun 2008 23:29:36 +0200 Subject: Neuromag coherence Message-ID: Hi, The tutorial Analysis of corticomuscular coherence shows the methods for computing coherence between MEG and a single EMG channel. I have tried to fit Neuromag / EMG data through the same routines without success. There are too many errors to bother listing at this point. Has anyone else been able to accomplish this? Thanks, Myles ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From findley at GMAIL.COM Wed Jun 25 00:12:10 2008 From: findley at GMAIL.COM (Will Findley) Date: Wed, 25 Jun 2008 00:12:10 +0200 Subject: Co-registration of fiducials for leadfields Message-ID: As best I can tell, before calculating the leadfields for the forward model, the sensor positions are adjusted by the center of the spherical head approximation as such: lines 201-205 in compute_leadfield.m if isfield(vol, 'o') % shift dipole and magnetometers to origin of sphere pos = pos - repmat(vol.o, Ndipoles, 1); pnt = pnt - repmat(vol.o, size(pnt,1), 1); end However, I can't find where the modification occurs to vol.o (the sphere's origin determined in read_ctf_hdm.m) to take into account aligning the fiducials for the spherical head model to the head coil positions during the scan. Does anyone know where this calculation is performed? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From c.hesse at FCDONDERS.RU.NL Wed Jun 25 08:33:42 2008 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 25 Jun 2008 08:33:42 +0200 Subject: Neuromag coherence In-Reply-To: Message-ID: Hi Myles, without a clearer description of the errors you get it is of course difficult to offer advice; however, people have often reported difficulty in reading the MEG data from Neuromag systems into Fieldtrip. You can check the discussion list archive for posts related to the issues regarding reading Neuromag data into FT. Once the data has been read in successfully, you should not encounter any problems, as all the computations are not data format specific, and work. Regards, Christian On 24 Jun 2008, at 23:29, Myles Reilly wrote: > Hi, > > The tutorial Analysis of corticomuscular coherence shows the > methods for > computing coherence between MEG and a single EMG channel. I have tried > to fit Neuromag / EMG data through the same routines without success. > There are too many errors to bother listing at this point. > > Has anyone else been able to accomplish this? > > Thanks, > > Myles > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Wed Jun 25 12:26:22 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Wed, 25 Jun 2008 12:26:22 +0200 Subject: Neuromag coherence Message-ID: Hi All I checked the tutorials: "Localizing oscillatory sources using beamformer techniques" and "Analysis of corticomuscular coherence" and it seems that cortico-muscular coherence calculations and dics have to do with sourceanalysis.m routine. I managed to have it working after having calculated frequency power spectra and cross-spectral densities as inputs for this function. After i select the other inputs (head model, gradiometer's positions, lambda) i have to set a frequency upon which to let the dics run (i selected, like in the examples, the peak of maximal coherence spectra). The result of the run is a 3D map of coherence or power activities for every point inside the head grid and i used a scatter3.m to visualize it, not to mess up with the co-registration of MRI images (the next step i will speak about). I compared the result with a coherence topography calculated with CTF software and i get an activation in the controlateral area with a clear dipolar shape. Unfortunately i do not see an equivalent in the same position for the DICS output. Reading the documentation i realised that it can be because of a biasing of the spatial filter toward the center of the sphere. I recalculated the dics with a baseline condition and after all i subtracted it from the task activation, still the result is far away from being a localized source activity, according to me. I also tried with different lambda but the result is not localized. How can i fix it? Thanks in advance for the help Sincerely, Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 00:09:33 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 00:09:33 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, For my bachelor's assignment, I'm trying to find a visual stimulus of a hand movement that triggers the 'largest' modulation of the EEG. I.e. , when the subject looks at a right hand movement, literature suggest a decrease in power in the 8-13 Hz band, relative to a baseline period around electrode position C3. I'm trying to use Fieldtrip's freqstatistics.m function to test this decrease in power for significance. Following a tutorial in the Fieldtrip wiki, http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments which I thought applied to my situation gave me a lot of error messages. I've already redefined my trials, so I have a separate set of trials, one containing 2 seconds of baseline, and one containing 2 seconds of stimulus. The baseline time axis is shifted so it overlaps the stimulus time axis I then use this code to calculate TFR's for those datasets: cfgfreq.method = 'mtmconvol'; cfgfreq.output = 'pow' ; cfgfreq.taper = ' hanning' ; cfgfreq.foi = 8:1:13; cfgfreq.t_ftimwin = 10./cfgfreq.foi; cfgfreq.toi = 5:1/100:7; cfgfreq.tapsmofrq = cfgfreq.foi*0.4; [baselineTFR] = freqanalysis(cfgfreq,baselinedata); [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); And then I have to do the significance test. cfg = []; sfg.method = 'analytic'; cfg.statistics = 'actvsblT'; cfg.alpha = 0.05; ? [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); I think I have to do something with the design matrix, but I can't find anything about that in the wiki (or the rest of the internet). Thanks, Thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Thu Jun 26 08:45:06 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 26 Jun 2008 08:45:06 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jun 26 09:29:16 2008 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 26 Jun 2008 09:29:16 +0200 Subject: Significance test frequency power decrease baseline vs stimulation Message-ID: Hi, I'm currently in the pilot phase, testing various stimuli on myself and my supervisor. I want to do this analysis to get an indication which stimulus has the best potential, so I can test that on a sufficient large group. The data I'm testing the statistical analysis script on consists of 50 trials, the subject was asked to perform motor imagery while looking at the screen. Each trial consists of 3 seconds baseline (empty background on screen) and 5 seconds stimulus ( hand squeezing a ball on screen). I don't need the TFR's of the individual trials, since the mean TFR will (that's what I expect) show a more prominent in power in the 8-13 Hz band when I compare baseline vs stimulus. The error message I get when I run the script now is: ??? Undefined variable "data" or class "data.biol". Error in ==> prepare_design at 92 nrepl=size(data.biol,1); Error in ==> statistics_wrapper at 238 [cfg] = prepare_design(cfg); Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); Error in ==> fieldtripstatanalyse at 36 [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); Thanks for your input, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Nathan Weisz Verzonden: do 26-6-2008 8:45 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: Re: [FIELDTRIP] Significance test frequency power decrease baseline vs stimulation hi, you want individual subject stats? i'm pretty sure then that you need to add something like cfg.keeptrials='yes'; when doing your freqanalysis. btw, adding the actual error message is also a good idea when posting questions. good luck, n On 26.06.2008, at 00:09, Thomas Dijkman wrote: > Hi, > > For my bachelor's assignment, I'm trying to find a visual stimulus > of a hand > movement that triggers the 'largest' modulation of the EEG. I.e. , > when the > subject looks at a right hand movement, literature suggest a > decrease in > power in the 8-13 Hz band, relative to a baseline period around > electrode > position C3. > I'm trying to use Fieldtrip's freqstatistics.m function to test this > decrease in power for significance. Following a tutorial in the > Fieldtrip wiki, > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_permutation_tests_for_time-frequency_representationswithin_trial_experiments > > which I thought applied to my situation gave me a lot of error > messages. > > I've already redefined my trials, so I have a separate set of > trials, one > containing 2 seconds of baseline, and one containing 2 seconds of > stimulus. > The baseline time axis is shifted so it overlaps the stimulus time > axis > > I then use this code to calculate TFR's for those datasets: > > cfgfreq.method = 'mtmconvol'; > cfgfreq.output = 'pow' ; > cfgfreq.taper = ' hanning' ; > cfgfreq.foi = 8:1:13; > cfgfreq.t_ftimwin = 10./cfgfreq.foi; > cfgfreq.toi = 5:1/100:7; > cfgfreq.tapsmofrq = cfgfreq.foi*0.4; > [baselineTFR] = freqanalysis(cfgfreq,baselinedata); > [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); > > And then I have to do the significance test. > > cfg = []; > sfg.method = 'analytic'; > cfg.statistics = 'actvsblT'; > cfg.alpha = 0.05; > ? > [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); > > I think I have to do something with the design matrix, but I can't > find > anything about that in the wiki (or the rest of the internet). > > Thanks, > > Thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:36:30 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:36:30 +0200 Subject: Significance test frequency power decrease baseline vs stimulation In-Reply-To: Message-ID: Dear Thomas, It's hard to say what's going wrong, but I would suggest a different approach in the first place. I could imagine that you are interested in the first place whether there's a difference in activation vs. baseline, and not so much in the moment in time that this occurs. Then the player of my choice would be freqanalysis_mtmfft. In that case you collapse over the time dimension, and increase your statistical power. Importantly, using either approach, I believe it is mandatory to use equal length trials in both 'conditions'. I don't believe this causes your error message but I see that you use different length trials and will lead to problems when the current problem is fixed and you proceed in the function. As I said I would try to run freqanalysis with cfg.method = 'mtmfft'. As Nathan pointed out, it is mandatory to do cfg.keeptrials = 'yes', otherwise you cannot do any statistics. (This is also the case when you would use mtmconvol). This is a very important notion. Otherwise it would just suffice to look at the difference of the averages. The fact that you want to compute a T-value implies that you want to take the variance across trials into account, and therefore you need 'keeptrials' = 'yes' (This could very well be the cause of your problem). Then I would call freqstatistics with either cfg.statistic = 'depsamplesT' (when you have paired observations) or cfg.statistic='indepsamplesT' (when the observations are unpaired). As a sidestep, when encountering errors in general, it might make sense to use matlab's debugging functionality. When you type on the commandline 'dbstop if error' before running your analysis script, matlab enters the debugging mode when an error is encountered. This means that you stick to the local workspace of the function in which the error occurred, and you can see what is going wrong. In your case apparently there is no variable called data present in the workspace for the function prepare_design. You can toggle up and down between the calling functions by using dbup and dbdown. This usually gives useful information and points to the core of the problem. This can be both handy for yourself (you might be able to solve the problem yourself) or for anybody trying to help from a distance. Anyway, something seems to go wrong in prepare_design. I'd rather fix this if I were you, but you could also see whether you can bypass this problem when specifying a design in your configuration for freqstatistics. This will bypass the function prepare_design altogether. There is some information on the fieldtrip wiki in the tutorial about cluster-based permutation tests. You could also type help prepare_design in the matlab commandline. I hope this helps, Jan-Mathijs On Jun 26, 2008, at 9:29 AM, Thomas Dijkman wrote: > Hi, > > I'm currently in the pilot phase, testing various stimuli on myself > and my supervisor. I want to do this analysis to get an indication > which stimulus has the best potential, so I can test that on a > sufficient large group. > > The data I'm testing the statistical analysis script on consists of > 50 trials, the subject was asked to perform motor imagery while > looking at the screen. Each trial consists of 3 seconds baseline > (empty background on screen) and 5 seconds stimulus ( hand > squeezing a ball on screen). > I don't need the TFR's of the individual trials, since the mean TFR > will (that's what I expect) show a more prominent in power in the > 8-13 Hz band when I compare baseline vs stimulus. > > The error message I get when I run the script now is: > > ??? Undefined variable "data" or class "data.biol". > > Error in ==> prepare_design at 92 > nrepl=size(data.biol,1); > > Error in ==> statistics_wrapper at 238 > [cfg] = prepare_design(cfg); > > Error in ==> freqstatistics at 132 > [stat] = statistics_wrapper(cfg, varargin{:}); > > Error in ==> fieldtripstatanalyse at 36 > [stat] = freqstatistics(cfg, stimulusTFR, baselineTFR); > > Thanks for your input, > > Thomas > > > -----Oorspronkelijk bericht----- > Van: FieldTrip discussion list namens Nathan Weisz > Verzonden: do 26-6-2008 8:45 > Aan: FIELDTRIP at NIC.SURFNET.NL > Onderwerp: Re: [FIELDTRIP] Significance test frequency power > decrease baseline vs stimulation > > hi, > > you want individual subject stats? i'm pretty sure then that you need > to add something like > cfg.keeptrials='yes'; > when doing your freqanalysis. > > btw, adding the actual error message is also a good idea when posting > questions. > > good luck, > n > > > On 26.06.2008, at 00:09, Thomas Dijkman wrote: > >> Hi, >> >> For my bachelor's assignment, I'm trying to find a visual stimulus >> of a hand >> movement that triggers the 'largest' modulation of the EEG. I.e. , >> when the >> subject looks at a right hand movement, literature suggest a >> decrease in >> power in the 8-13 Hz band, relative to a baseline period around >> electrode >> position C3. >> I'm trying to use Fieldtrip's freqstatistics.m function to test this >> decrease in power for significance. Following a tutorial in the >> Fieldtrip wiki, >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:tutorial:statistics&s=freqstatistics#3.2_p >> ermutation_tests_for_time- >> frequency_representationswithin_trial_experiments >> >> which I thought applied to my situation gave me a lot of error >> messages. >> >> I've already redefined my trials, so I have a separate set of >> trials, one >> containing 2 seconds of baseline, and one containing 2 seconds of >> stimulus. >> The baseline time axis is shifted so it overlaps the stimulus time >> axis >> >> I then use this code to calculate TFR's for those datasets: >> >> cfgfreq.method = 'mtmconvol'; >> cfgfreq.output = 'pow' ; >> cfgfreq.taper = ' hanning' ; >> cfgfreq.foi = 8:1:13; >> cfgfreq.t_ftimwin = 10./cfgfreq.foi; >> cfgfreq.toi = 5:1/100:7; >> cfgfreq.tapsmofrq = cfgfreq.foi*0.4; >> [baselineTFR] = freqanalysis(cfgfreq,baselinedata); >> [stimulusTFR] = freqanalysis(cfgfreq,stimulusdata); >> >> And then I have to do the significance test. >> >> cfg = []; >> sfg.method = 'analytic'; >> cfg.statistics = 'actvsblT'; >> cfg.alpha = 0.05; >> ? >> [stat] = freqstatistics(cfg,stimulusTFR,baselineTFR); >> >> I think I have to do something with the design matrix, but I can't >> find >> anything about that in the wiki (or the rest of the internet). >> >> Thanks, >> >> Thomas >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------- > Dr. Nathan Weisz > > INSERM - Unité 821 > Dynamique cérébrale et cognition > Centre Hospitalier Le Vinatier, Bâtiment 452 > 95 Boulevard Pinel > 69500 Bron, France > > Tel: ++33 - (0)4 - 7213 8915 > Email: nathan.weisz at inserm.fr > Chat-AV: nathanweisz at mac.com > Homepage: http://web.mac.com/nathanweisz > Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 > > Please avoid sending me Word or PowerPoint attachments. > See http://www.gnu.org/philosophy/no-word-attachments.html > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jun 26 10:48:57 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 26 Jun 2008 10:48:57 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I took the liberty to change the subject of your posting into a more appropriate one. Did you have a look at the topography of the coherence on the scalp, using fieldtrip. This is a first check I would do, to get an indication that at least the other important ingredient to the beamformer (apart from the leadfields), i.e. the csd, has been computed more or less ok. Two additional points: you mention something about the coregistration with the MRI. It is of course extremely important that your volume conductor model is aligned with the MRI. Checking the topography of the scalp level CMC using CTF's software does not guarantee this. Second point: spatial filters are biased towards the depth and therefore people often use quantities like pseudo-T/F/Z, neural activity indices, constrast between conditions, or normalised leadfields in order to make sense out of the volumetric images. However, coherence is normalised for the power by definition, so I would not expect a problem per se in the visualisation. Yours, Jan-Mathijs On Jun 25, 2008, at 12:26 PM, Cristiano Micheli wrote: > Hi All > I checked the tutorials: > "Localizing oscillatory sources using beamformer techniques" and > "Analysis > of corticomuscular coherence" and it seems that cortico-muscular > coherence > calculations and dics have to do with sourceanalysis.m routine. > I managed to have it working after having calculated frequency > power spectra > and cross-spectral densities as inputs for this function. > After i select the other inputs (head model, gradiometer's positions, > lambda) i have to set a frequency upon which to let the dics run (i > selected, like in the examples, the peak of maximal coherence > spectra). > The result of the run is a 3D map of coherence or power activities > for every > point inside the head grid and i used a scatter3.m to visualize it, > not to > mess up with the co-registration of MRI images (the next step i > will speak > about). > I compared the result with a coherence topography calculated with CTF > software and i get an activation in the controlateral area with a > clear > dipolar shape. > Unfortunately i do not see an equivalent in the same position for > the DICS > output. > Reading the documentation i realised that it can be because of a > biasing of > the spatial filter toward the center of the sphere. I recalculated > the dics > with a baseline condition and after all i subtracted it from the task > activation, still the result is far away from being a localized source > activity, according to me. I also tried with different lambda but > the result > is not localized. > How can i fix it? > > Thanks in advance for the help > Sincerely, > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Jun 26 12:42:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 26 Jun 2008 12:42:18 +0200 Subject: CTF275 coherence Message-ID: Thank you for the feedback The coherence is ok. I attach the topography for coherence's peak. I took a head model not corresponding to the subject to test the algorithm quickly. This can be the matter. Anyway the single lead field should be influenced only by head model center, not by its radius, if i am not wrong. The radius defines only the grid i think. The particular case i consider has center (in head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position [0 0 5] influence so much the result? Are there documents about it? About errors depending on the conductor position? I'm trying now to simulate it with surrogate data with corresponding gradiometers-head model relative position. I really would like to keep the topic active Sincerely Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: field.png Type: image/png Size: 16240 bytes Desc: not available URL: From p.kitterick at PSYCH.YORK.AC.UK Thu Jun 26 12:48:13 2008 From: p.kitterick at PSYCH.YORK.AC.UK (=?ISO-8859-1?Q?P=E1draig_Kitterick?=) Date: Thu, 26 Jun 2008 11:48:13 +0100 Subject: CTF275 coherence In-Reply-To: Message-ID: Yes, the radius of the sphere is not relevant to the calculations. The presumtion is always that the measurement device is outside the sphere. Padraig Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. I took a > head model not corresponding to the subject to test the algorithm quickly. > This can be the matter. Anyway the single lead field should be influenced > only by head model center, not by its radius, if i am not wrong. The radius > defines only the grid i think. The particular case i consider has center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal position > [0 0 5] influence so much the result? Are there documents about it? About > errors depending on the conductor position? I'm trying now to simulate it > with surrogate data with corresponding gradiometers-head model relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ------------------------------------------------------------------------ > -- Pádraig Kitterick Graduate Student Department of Psychology University of York Heslington York YO10 5DD UK Tel: +44 (0) 1904 43 3170 Email: p.kitterick at psych.york.ac.uk ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From englerea at CC.JYU.FI Thu Jun 26 17:14:56 2008 From: englerea at CC.JYU.FI (Enrico Glerean) Date: Thu, 26 Jun 2008 18:14:56 +0300 Subject: options for cluster-based permutation tests Message-ID: Hello dear people, I have a very quick question that hopefully has not been answered before: we have to run cluster based permutation tests using clustering in time and frequency but not in space. Which means not considering neighbor channels. I think that the best option would be using the parameter cfg.neighbourdist = 0.0; which means that there are no neighbor electrodes. Is that correct or is there a better option? Should cfg.minnbchan be changed as well and set to 0? the whole lists of config parameters passed to freqstatistics() would be: cfg = []; cfg.channel = choi; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 5; cfg.correctm='cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 0; cfg.clustertail = 0; cfg.neighbourdist = 0.0; thanks in advance for your help best regards -- Enrico Glerean englerea at cc.jyu.fi Jyväskylä, Finland ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 12:50:22 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 12:50:22 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, I don't expect that the exact specifications of your single sphere (in particular the slight shift of the origin) will cause the localization to fail totally. I would guess that the problems lie more in the quality of the estimated cross-spectral density matrix. In a previous reply I mentioned about the topography only giving an indication about the correctness of the computation of the csd's. Obviously, this only gives a hint about the EMG-MEG coherence. The beamformer needs the csd between all MEG-sensor pairs. It could be that this is badly estimated. On how many repetitions is it based (trials x tapers)? Did you remove artifacts from the data? The trial number and presence of artifacts might severely compromise the quality of the csd-matrix. Additionally, I am not sure which gradiometer specification you use. From your previous mails it seems that you generate it yourself. However, fieldtrip should do it for you. If you are using your own hack, is there any reason for it? Yours, JM On Jun 26, 2008, at 12:42 PM, Cristiano Micheli wrote: > Thank you for the feedback > The coherence is ok. I attach the topography for coherence's peak. > I took a > head model not corresponding to the subject to test the algorithm > quickly. > This can be the matter. Anyway the single lead field should be > influenced > only by head model center, not by its radius, if i am not wrong. > The radius > defines only the grid i think. The particular case i consider has > center (in > head coordinates) [0.9 0 4.3] cm. Can these shifts from the nominal > position > [0 0 5] influence so much the result? Are there documents about it? > About > errors depending on the conductor position? I'm trying now to > simulate it > with surrogate data with corresponding gradiometers-head model > relative > position. > I really would like to keep the topic active > > Sincerely > Cristiano > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 13:01:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 13:01:49 +0200 Subject: options for cluster-based permutation tests In-Reply-To: <2521.82.58.220.82.1214493296.squirrel@webmail1.cc.jyu.fi> Message-ID: Dear Enrico, It seems that cfg.neighbourdist should do the trick: The generation of lists of neighbouring channels for each channel is done by the function neighbourselection. As far as I can see, the inclusion of neighbours is indeed based on the distance. Putting it to zeros should be OK. Another way of going about it, is to explicitly define the neighbourhood structure in the configuration: cfg.neighbours = []; for k = 1:length(choi) cfg.neighbours.label{k} = choi{k}; cfg.neighbours.neighblabel = {}; end This prevents statistics_wrapper.m to go into the computation of the neighbourhood altogether. Good luck, Jan-Mathijs On Jun 26, 2008, at 5:14 PM, Enrico Glerean wrote: > Hello dear people, > > I have a very quick question that hopefully has not been answered > before: > we have to run cluster based permutation tests using clustering in > time > and frequency but not in space. Which means not considering neighbor > channels. > > I think that the best option would be using the parameter > > cfg.neighbourdist = 0.0; > > which means that there are no neighbor electrodes. > > Is that correct or is there a better option? Should cfg.minnbchan be > changed as well and set to 0? > > > the whole lists of config parameters passed to freqstatistics() > would be: > > cfg = []; > cfg.channel = choi; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.tail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 5; > > cfg.correctm='cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 0; > cfg.clustertail = 0; > cfg.neighbourdist = 0.0; > > > thanks in advance for your help > > best regards > > -- > Enrico Glerean > englerea at cc.jyu.fi > Jyväskylä, Finland > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Jun 27 16:11:21 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 16:11:21 +0200 Subject: CTF275 coherence Message-ID: Dear Jan-Mathijs In the preprocessing i performed baseline correction for meg data and 10 Hz hi-pass filtering for emg (sampling at ~300 Hz). However since normally the correlated activities for isometric pinch take place in the beta band, and eye-blinks and other artifacts are in other bands or uncorrelated with the emg, i did not think about applying artifacts removal. For sure i will have a look at it but what for me constitutes the signal of a good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography, which i took as a good result. And i expect dics to be more sensible than emg-meg coherence in detecting sources, with the right settings. I specify the settings of frequency analysis like that: refch = 'EMG_lH'; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [max_f max_f]; % peak of coherence spectrum cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'MEG' refch}; cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; freqcond = freqanalysis(cfg,data); cfg = []; fd = freqdescriptives(cfg,freqcond); Maybe i should use another method for csd calculations or another smoothing factor. Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials of 10 seconds each and then i cut each trial in segments of 1 second each. The reason why i use my own gradiometers definitions is because i already have this information ready in my code from a CTF routine. Also i did not get how to look for it in the documentation. How can i do it easier? Then I run the dics with the following parameters: cfg = []; cfg.grad = grads; cfg.grid = grids_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = max_f; cfg.hdmfile = 'myhead.hdm'; sourcecond = sourceanalysis(cfg, freqcond); In the simulations i get the same problem whereas the spectra look reasonable and the dipole fit localizes the source in the right place from coherence peak. The simulations were done with one source (virtual emg) coherent in phase and amplitude with the source time course. Source is modelled by a dipole in position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m How do i perform a good frequency analysis in order to have a good localization? If it does not depend on fr. analysis which other factors can cause this problem? Thank you for the patience Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jun 27 16:35:14 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 27 Jun 2008 16:35:14 +0200 Subject: CTF275 coherence In-Reply-To: Message-ID: Dear Cristiano, Very quickly: the gradiometer description is present in the data- structure as data.grad (and will be passed on to freq.grad when calling freqanalysis). This at least should be there when you read in your data using preprocessing. You do not have to specify cfg.grad before your call to sourceanalysis, because it will take the gradiometer structure from the data. This will ensure that the csd and gradiometer description really match. As long as you use your own grad-structure you have to be absolutely sure that this one corresponds to the specifications of the dataset at hand. I cannot judge that this really is the case, so I would drop the cfg.grad from your configuration to sourceanalysis in the first place. I totally agree with you that a 'good emg-meg correlation is not only the peak in the spectrum but also two controlateral dipolar 'spots' in the topography', and I did not claim otherwise. Only: the sensor-level csd is much richer in structure than the part you plot on the topography and a good topography is no guarantee for a good source result (please take my word on it: I have looked at these things a couple of times myself, so I should know ;o) ). The number of trials is sufficient I guess. Yours, JM On Jun 27, 2008, at 4:11 PM, Cristiano Micheli wrote: > Dear Jan-Mathijs > In the preprocessing i performed baseline correction for meg data > and 10 Hz > hi-pass filtering for emg (sampling at ~300 Hz). > However since normally the correlated activities for isometric > pinch take > place in the beta band, and eye-blinks and other artifacts are in > other > bands or uncorrelated with the emg, i did not think about applying > artifacts > removal. > For sure i will have a look at it but what for me constitutes the > signal of > a good emg-meg correlation is not only the peak in the spectrum but > also two > controlateral dipolar 'spots' in the topography, which i took as a > good > result. And i expect dics to be more sensible than emg-meg > coherence in > detecting sources, with the right settings. > I specify the settings of frequency analysis like that: > refch = 'EMG_lH'; > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [max_f max_f]; % peak of coherence spectrum > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'MEG' refch}; > cfg.channelcmb = {'MEG' 'MEG';'MEG' refch}; > freqcond = freqanalysis(cfg,data); > cfg = []; > fd = freqdescriptives(cfg,freqcond); > > Maybe i should use another method for csd calculations or another > smoothing > factor. > Alltogether i have 250 subtrials and 9 tapers. I collect 25 trials > of 10 > seconds each and then i cut each trial in segments of 1 second each. > The reason why i use my own gradiometers definitions is because i > already > have this information ready in my code from a CTF routine. Also i > did not > get how to look for it in the documentation. How can i do it easier? > Then I run the dics with the following parameters: > cfg = []; > cfg.grad = grads; > cfg.grid = grids_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = max_f; > cfg.hdmfile = 'myhead.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > In the simulations i get the same problem whereas the spectra look > reasonable and the dipole fit localizes the source in the right > place from > coherence peak. > The simulations were done with one source (virtual emg) coherent in > phase > and amplitude with the source time course. Source is modelled by a > dipole in > position [0 5 10] cm (head coordinates) and moment [10 0 0] nA.m > How do i perform a good frequency analysis in order to have a good > localization? > If it does not depend on fr. analysis which other factors can cause > this > problem? > Thank you for the patience > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri Jun 27 18:17:05 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 27 Jun 2008 18:17:05 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Dear Fieldtrippers, I am experiencing problems with the indexing of the MEG sensors in fieldtrip and the topographical representation of these sensors. For the layout file I am using the CTF274.lay file. I also use the regexp function and cfg.label to get the indexes of the sensors I want. In the figure that I have attached you can see where my problem comes from. Somehow the indexes corresponding to the sensors seem not to index the right sensors. Can anyone tell me what this could be related to? Thanks in advance for any helpful suggestions. Frederic _________________________________________________________________ Windows Live Messenger: Direkter Zugriff auf Ihre E-Mails! Ohne Neuanmeldung! http://get.live.com/de-de/messenger/overview ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: topo.gif Type: image/gif Size: 25115 bytes Desc: not available URL: From michelic72 at GMAIL.COM Fri Jun 27 18:34:45 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 27 Jun 2008 18:34:45 +0200 Subject: wrong sensor indexes for topographical mapping Message-ID: Hi Frederic In CTF274.lay you find all channels apart from sensor MRF43. Maybe in your case you have to exclude another sensor. This would be enough to shift the mapping of the channels on your topography. I would create my own CTF274_fred.lay and exclude the unnecessary sensor. Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Fri Jun 27 18:56:08 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Fri, 27 Jun 2008 09:56:08 -0700 Subject: research position in San Francisco, CA Message-ID: FieldTrip users, We are looking for new and experienced brain imagers wanting to work in our UCSF-affiliated research lab. Please apply at the following link if interested: http://www.ncire.org/positions.php?id=145 thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From enteka at HOTMAIL.COM Fri Jun 27 19:29:18 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 27 Jun 2008 17:29:18 +0000 Subject: wrong sensor indexes for topographical mapping In-Reply-To: Message-ID: Also, make sure that you are using the channel numbering used in the data structure, not the one in the .lay file. help topomap ... cfg.highlight = 'off' or the channel numbers you want to highlight (default = 'off'). These numbers should correspond with the channels in the data, not in the layout file. ... Nic ---------------------------------------- > Date: Fri, 27 Jun 2008 18:34:45 +0200 > From: michelic72 at GMAIL.COM > Subject: Re: [FIELDTRIP] wrong sensor indexes for topographical mapping > To: FIELDTRIP at NIC.SURFNET.NL > > Hi Frederic > In CTF274.lay you find all channels apart from sensor MRF43. > Maybe in your case you have to exclude another sensor. This would be enough > to shift the mapping of the channels on your topography. I would create my > own CTF274_fred.lay and exclude the unnecessary sensor. > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sun Jun 29 13:59:05 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 29 Jun 2008 13:59:05 +0200 Subject: CTF275 coherence Message-ID: Now works. I had some overloaded function somewhere for the routine cell2mat.m which masked the default one, and i could not read the grad structure from the dataset! Thanks! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From monikamellem at GMAIL.COM Mon Jun 30 13:21:33 2008 From: monikamellem at GMAIL.COM (Monika Mellem) Date: Mon, 30 Jun 2008 13:21:33 +0200 Subject: Reading in Neuroscan files Message-ID: Hello, I have noticed some things when reading in both Neuroscan .eeg and .cnt files. 1) When reading a Neuroscan .eeg file, read_event.m seems to put either "accept" or "reject" into the field event.value. According to how event.field is used later on, it should be putting the trigger values in this field which are in tmp.sweep.type. I modified the code as shown below. At line 885: event(end).value = tmp.sweep.type; rather than event(end).value = 'accept'; This line of code is within an if statement (if tmp.sweep.accept), and I'm not sure how the else statement should be modified if a trial/sweep should be rejected. 2) When reading in a Neuroscan .cnt file, read_header.m puts some bad channel labels into hdr.label using what it gets from the read_ns_cnt.m file (around line 564). Whatever is in orig.chan.names starts with the correct channels (about 10 of them) and then has blank values or odd characters for the rest of the channel labels. As a quick fix for just the channel labels, I just took the channel labels that read_ns_hdr.m finds and substituted them into hdr.label. See below. This doesn't fix the underlying problem in read_ns_cnt.m though which seems to be with the variables chandat and r.chan.names (lines 140-141). orig = read_ns_hdr(filename); hdr.label = orig.label; hdr.orig.chan.names = orig.label; Thanks! Monika Mellem ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.