From rbg26471 at YAHOO.COM Sun Jul 17 20:41:49 2005 From: rbg26471 at YAHOO.COM (rathinaswamy bavanandan govindan) Date: Sun, 17 Jul 2005 11:41:49 -0700 Subject: Request for clarrification Message-ID: Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From D.Talsma at PSY.VU.NL Wed Jul 20 11:54:53 2005 From: D.Talsma at PSY.VU.NL (Talsma D) Date: Wed, 20 Jul 2005 11:54:53 +0200 Subject: Request for clarrification Message-ID: Hi, First of all, let me say that I'm by no means an expert in TF analysis yet, but since the list is quite these days (due to vacation time), let me try and have a stab at answering your question. The error message you are getting suggests that you only have a 0.2 s signal, which is likely too small, specifically, because you request the TF analysis to be conducted between -1 to 1.5 s, which would be an interval too wide to fit into the 200 ms signal. I therefore suspect that there might be an error earlier on in reading in the data, where you may have accidentally read in a much smaller portion of the data than what you intended to. This is but a guess... HTH, Durk -----Oorspronkelijk bericht----- Van: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] Namens rathinaswamy bavanandan govindan Verzonden: Sunday, July 17, 2005 8:42 PM Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] Request for clarrification Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Florian.Fischmeister at UNIVIE.AC.AT Thu Jul 28 20:21:27 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Thu, 28 Jul 2005 20:21:27 +0200 Subject: simulation of a dataset with multiple dipoles Message-ID: Dear Experts, I am trying to simulate an EEG dataset containing multiple dipoles. I do understand, that I can have a single dipole with a different moment and time course per trial using cell-arrays. But how can I obtain multiple dipoles? Is it correct to simulate one dataset per dipol and than sum the different datasets? Currently I am using a 4 spherical shell model with cfg.vol.r = [71 72 79 85]; cfg.vol.c = [0.3300 1 0.0042 0.3300]; cfg.vol.o = [0 0 0]; taken from EEGLAB. What are the correct steps to obtain a BEM forward head-model based on an MRI for an individual electrode setting for dipolesimulation. Finaly, I want to check the simulation using the dipolefitting routine included in fieldtrip. Could you please provide some information on how the appropriate cfg should look like. Thanks in advance, Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Thu Jul 28 22:43:04 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Thu, 28 Jul 2005 23:43:04 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi, You may find the free dipole simulator written by Patrick Berg helpful. It can be downloaded from: ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe You can simulate there ERPs and also raw data with any dipole configuration you like and then convert it to format that Fieldtrip can look at. Best, Vladimir On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > Dear Experts, > > I am trying to simulate an EEG dataset containing multiple dipoles. I do > understand, that I can have a single dipole with a different moment and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? > > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based on an MRI > for an individual electrode setting for dipolesimulation. > > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on how > the appropriate cfg should look like. > > > Thanks in advance, > > Florian > > -- > Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at > Brain Research Laboratory University of Vienna > Faculty of Psychology Liebiggasse 5 > Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria > Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 > From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 10:02:52 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 10:02:52 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Thu, 28 Jul 2005 23:43:04 +0300") Message-ID: Litvak Vladimir writes: > Hi, > > You may find the free dipole simulator written by Patrick Berg > helpful. It can be downloaded from: > > ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe > > You can simulate there ERPs and also raw data with any dipole > configuration you like and then convert it to format that Fieldtrip > can look at. Thanks Vladimir, I already tried the Besa simulator. Using the dipolesimulator I can only generate data with 150 timepoint. My problem is, that I want to simulate slow cortical potentials having trials of 10 sec length and more. best, Florian > > On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > >> Dear Experts, >> >> I am trying to simulate an EEG dataset containing multiple dipoles. I do >> understand, that I can have a single dipole with a different moment and >> time course per trial using cell-arrays. But how can I obtain multiple >> dipoles? Is it correct to simulate one dataset per dipol and than sum >> the different datasets? >> >> Currently I am using a 4 spherical shell model with >> cfg.vol.r = [71 72 79 85]; >> cfg.vol.c = [0.3300 1 0.0042 0.3300]; >> cfg.vol.o = [0 0 0]; >> taken from EEGLAB. >> >> What are the correct steps to obtain a BEM forward head-model based on an MRI >> for an individual electrode setting for dipolesimulation. >> >> Finaly, I want to check the simulation using the dipolefitting routine >> included in fieldtrip. Could you please provide some information on how >> the appropriate cfg should look like. >> >> >> Thanks in advance, >> >> Florian >> >> -- >> Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at >> Brain Research Laboratory University of Vienna >> Faculty of Psychology Liebiggasse 5 >> Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria >> Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 >> > -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 10:09:57 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 11:09:57 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: > I already tried the Besa simulator. Using the dipolesimulator I can only > generate data with 150 timepoint. My problem is, that I want to > simulate slow cortical potentials having trials of 10 sec length and > more. But why don't you change the time axis? The important thing is the location of the dipoles and their relative timecourse. Then you can rescale the time axis and call that 'slow potentials'. The only problem with that is that if you want to add noise in the simulator the spectrum of the noise will be wrong. So you can add noise in Matlab later. Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 15:33:17 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 15:33:17 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Fri, 29 Jul 2005 11:09:57 +0300") Message-ID: Litvak Vladimir writes: >> I already tried the Besa simulator. Using the dipolesimulator I can only >> generate data with 150 timepoint. My problem is, that I want to >> simulate slow cortical potentials having trials of 10 sec length and >> more. > > > But why don't you change the time axis? The important thing is the > location of the dipoles and their relative timecourse. Then you can > rescale the time axis and call that 'slow potentials'. The only > problem with that is that if you want to add noise in the simulator > the spectrum of the noise will be wrong. So you can add noise in > Matlab later. > > Vladimir > Thanks Vladimir, Using our approach works fine with static dipoles with fixed moments. But simulating many datasets with different setting is quite timeconsuming since I do want to run several simulations. Thus the question is still how to simulate a multidipole dataset with fieldtrip, maybe using a BEM headmodel. Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From r.oostenveld at FCDONDERS.RU.NL Fri Jul 29 16:45:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 29 Jul 2005 16:45:01 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi Florian, On 28-jul-2005, at 20:21, Florian Ph.S Fischmeister wrote: > I am trying to simulate an EEG dataset containing multiple dipoles. > I do > understand, that I can have a single dipole with a different moment > and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? Here is some sample Matlab code that hopefully explains step by step how to construct a forward simulated potential distribution. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a set of electrodes, randomly placed on the sphere elec = []; elec.pnt = randn(128,3); dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere for i=1:128 elec.label{i} = sprintf('%03d', i); end I suggest that you do not use these electrodes, but instead that you get more meaningfull electrode locations (see for example http:// oase.uci.ru.nl/~roberto/index.php/electrode/). % create a concentric 3-sphere volume conductor, the radius is the same as for the electrodes vol = []; vol.r = [0.88 0.92 1.00]; % radii of spheres vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wave cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 250; % Hz raw1 = dipolesimulation(cfg); avg1 = timelockanalysis([], raw1); plot(avg1.time, avg1.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.fsample = 250; % Hz time = (1:250)/250; % manually create a time axis signal = sin(10*time*2*pi); % manually create a signal cfg.dip.signal = {signal, signal, signal}; % three trials raw2 = dipolesimulation(cfg); avg2 = timelockanalysis([], raw2); plot(avg2.time, avg2.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with two dipoles and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [ 0 0.5 0.3 % dipole 1 0 -0.5 0.3 % dipole 2 ]; cfg.dip.mom = [ % each row represents [qx1 qy1 qz1 qx2 qy2 qz2] 1 0 0 0 0 0 % this is how signal1 contributes to the 6 dipole components 0 0 0 1 0 0 % this is how signal2 contributes to the 6 dipole components ]'; % note, it should be transposed time = (1:250)/250; signal1 = sin(10*time*2*pi); signal2 = cos(15*time*2*pi); cfg.dip.signal = {[signal1; signal2]}; % one trial only cfg.fsample = 250; % Hz raw3 = dipolesimulation(cfg); avg3 = timelockanalysis([], raw3); > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based > on an MRI > for an individual electrode setting for dipolesimulation. Fieldtrip does not contain code for segmenting an anatomical MRI in such a way that one could make a BEM model out of it. Furthermore, Fieldtrip also does not (yet) contain code for triangulating such a segmentation and computing the BEM forward model. You can however use an externally computed BEM model, but the only external software that is supported is ASA (see http://www.ant-neuro.com/). Perhaps you can download a demo version of that commercial software there, including a BEM model that you can use inside Fieldtrip. EEG BEM models is going to be supported more extensively in Fieldtrip, and also in the upcoming eeglab- dipfit version 2.0 plugin, but for the moment we cannot not support more than this yet. > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on > how > the appropriate cfg should look like. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % do a dipole fit of the first simulated dataset cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0 0]; % initial search position cfg.gridsearch = 'no'; dip1 = dipolefitting(cfg, avg1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % or start with an exhaustive search on a coarse grid cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.gridsearch = 'yes'; cfg.xgrid = linspace(-1,1,5); cfg.ygrid = linspace(-1,1,5); cfg.zgrid = linspace(-1,1,5); dip2 = dipolefitting(cfg, avg1); You should be aware that an exhaustive search only works for a single dipole, for two dipoles you always have to specify a starting location for the nonlinear search. best regards, Robert ================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 17:08:06 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 18:08:06 +0300 Subject: Matlab 7 crashes with Fieldtrip graphics Message-ID: Dear Fieldtrip developers, I started using Matlab 7 and it crashes when using topoplotTFR almost every time (especially if it was already running for a while prior to that). I know it's not your bug but have you encountered this (on Win XP)? This really gets on my nerves. If anyone else has this problem maybe it's a good idea to ask Mathworks about it. Thanks, Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 18:19:50 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 18:19:50 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Robert Oostenveld's message of "Fri, 29 Jul 2005 16:45:01 +0200") Message-ID: Robert Oostenveld writes: > > Here is some sample Matlab code that hopefully explains step by step > how to construct a forward simulated potential distribution. > Thanks very much, the Matlab code really helped alot. -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From rbg26471 at YAHOO.COM Sun Jul 17 20:41:49 2005 From: rbg26471 at YAHOO.COM (rathinaswamy bavanandan govindan) Date: Sun, 17 Jul 2005 11:41:49 -0700 Subject: Request for clarrification Message-ID: Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From D.Talsma at PSY.VU.NL Wed Jul 20 11:54:53 2005 From: D.Talsma at PSY.VU.NL (Talsma D) Date: Wed, 20 Jul 2005 11:54:53 +0200 Subject: Request for clarrification Message-ID: Hi, First of all, let me say that I'm by no means an expert in TF analysis yet, but since the list is quite these days (due to vacation time), let me try and have a stab at answering your question. The error message you are getting suggests that you only have a 0.2 s signal, which is likely too small, specifically, because you request the TF analysis to be conducted between -1 to 1.5 s, which would be an interval too wide to fit into the 200 ms signal. I therefore suspect that there might be an error earlier on in reading in the data, where you may have accidentally read in a much smaller portion of the data than what you intended to. This is but a guess... HTH, Durk -----Oorspronkelijk bericht----- Van: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] Namens rathinaswamy bavanandan govindan Verzonden: Sunday, July 17, 2005 8:42 PM Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] Request for clarrification Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Florian.Fischmeister at UNIVIE.AC.AT Thu Jul 28 20:21:27 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Thu, 28 Jul 2005 20:21:27 +0200 Subject: simulation of a dataset with multiple dipoles Message-ID: Dear Experts, I am trying to simulate an EEG dataset containing multiple dipoles. I do understand, that I can have a single dipole with a different moment and time course per trial using cell-arrays. But how can I obtain multiple dipoles? Is it correct to simulate one dataset per dipol and than sum the different datasets? Currently I am using a 4 spherical shell model with cfg.vol.r = [71 72 79 85]; cfg.vol.c = [0.3300 1 0.0042 0.3300]; cfg.vol.o = [0 0 0]; taken from EEGLAB. What are the correct steps to obtain a BEM forward head-model based on an MRI for an individual electrode setting for dipolesimulation. Finaly, I want to check the simulation using the dipolefitting routine included in fieldtrip. Could you please provide some information on how the appropriate cfg should look like. Thanks in advance, Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Thu Jul 28 22:43:04 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Thu, 28 Jul 2005 23:43:04 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi, You may find the free dipole simulator written by Patrick Berg helpful. It can be downloaded from: ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe You can simulate there ERPs and also raw data with any dipole configuration you like and then convert it to format that Fieldtrip can look at. Best, Vladimir On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > Dear Experts, > > I am trying to simulate an EEG dataset containing multiple dipoles. I do > understand, that I can have a single dipole with a different moment and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? > > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based on an MRI > for an individual electrode setting for dipolesimulation. > > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on how > the appropriate cfg should look like. > > > Thanks in advance, > > Florian > > -- > Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at > Brain Research Laboratory University of Vienna > Faculty of Psychology Liebiggasse 5 > Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria > Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 > From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 10:02:52 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 10:02:52 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Thu, 28 Jul 2005 23:43:04 +0300") Message-ID: Litvak Vladimir writes: > Hi, > > You may find the free dipole simulator written by Patrick Berg > helpful. It can be downloaded from: > > ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe > > You can simulate there ERPs and also raw data with any dipole > configuration you like and then convert it to format that Fieldtrip > can look at. Thanks Vladimir, I already tried the Besa simulator. Using the dipolesimulator I can only generate data with 150 timepoint. My problem is, that I want to simulate slow cortical potentials having trials of 10 sec length and more. best, Florian > > On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > >> Dear Experts, >> >> I am trying to simulate an EEG dataset containing multiple dipoles. I do >> understand, that I can have a single dipole with a different moment and >> time course per trial using cell-arrays. But how can I obtain multiple >> dipoles? Is it correct to simulate one dataset per dipol and than sum >> the different datasets? >> >> Currently I am using a 4 spherical shell model with >> cfg.vol.r = [71 72 79 85]; >> cfg.vol.c = [0.3300 1 0.0042 0.3300]; >> cfg.vol.o = [0 0 0]; >> taken from EEGLAB. >> >> What are the correct steps to obtain a BEM forward head-model based on an MRI >> for an individual electrode setting for dipolesimulation. >> >> Finaly, I want to check the simulation using the dipolefitting routine >> included in fieldtrip. Could you please provide some information on how >> the appropriate cfg should look like. >> >> >> Thanks in advance, >> >> Florian >> >> -- >> Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at >> Brain Research Laboratory University of Vienna >> Faculty of Psychology Liebiggasse 5 >> Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria >> Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 >> > -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 10:09:57 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 11:09:57 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: > I already tried the Besa simulator. Using the dipolesimulator I can only > generate data with 150 timepoint. My problem is, that I want to > simulate slow cortical potentials having trials of 10 sec length and > more. But why don't you change the time axis? The important thing is the location of the dipoles and their relative timecourse. Then you can rescale the time axis and call that 'slow potentials'. The only problem with that is that if you want to add noise in the simulator the spectrum of the noise will be wrong. So you can add noise in Matlab later. Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 15:33:17 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 15:33:17 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Fri, 29 Jul 2005 11:09:57 +0300") Message-ID: Litvak Vladimir writes: >> I already tried the Besa simulator. Using the dipolesimulator I can only >> generate data with 150 timepoint. My problem is, that I want to >> simulate slow cortical potentials having trials of 10 sec length and >> more. > > > But why don't you change the time axis? The important thing is the > location of the dipoles and their relative timecourse. Then you can > rescale the time axis and call that 'slow potentials'. The only > problem with that is that if you want to add noise in the simulator > the spectrum of the noise will be wrong. So you can add noise in > Matlab later. > > Vladimir > Thanks Vladimir, Using our approach works fine with static dipoles with fixed moments. But simulating many datasets with different setting is quite timeconsuming since I do want to run several simulations. Thus the question is still how to simulate a multidipole dataset with fieldtrip, maybe using a BEM headmodel. Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From r.oostenveld at FCDONDERS.RU.NL Fri Jul 29 16:45:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 29 Jul 2005 16:45:01 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi Florian, On 28-jul-2005, at 20:21, Florian Ph.S Fischmeister wrote: > I am trying to simulate an EEG dataset containing multiple dipoles. > I do > understand, that I can have a single dipole with a different moment > and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? Here is some sample Matlab code that hopefully explains step by step how to construct a forward simulated potential distribution. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a set of electrodes, randomly placed on the sphere elec = []; elec.pnt = randn(128,3); dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere for i=1:128 elec.label{i} = sprintf('%03d', i); end I suggest that you do not use these electrodes, but instead that you get more meaningfull electrode locations (see for example http:// oase.uci.ru.nl/~roberto/index.php/electrode/). % create a concentric 3-sphere volume conductor, the radius is the same as for the electrodes vol = []; vol.r = [0.88 0.92 1.00]; % radii of spheres vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wave cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 250; % Hz raw1 = dipolesimulation(cfg); avg1 = timelockanalysis([], raw1); plot(avg1.time, avg1.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.fsample = 250; % Hz time = (1:250)/250; % manually create a time axis signal = sin(10*time*2*pi); % manually create a signal cfg.dip.signal = {signal, signal, signal}; % three trials raw2 = dipolesimulation(cfg); avg2 = timelockanalysis([], raw2); plot(avg2.time, avg2.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with two dipoles and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [ 0 0.5 0.3 % dipole 1 0 -0.5 0.3 % dipole 2 ]; cfg.dip.mom = [ % each row represents [qx1 qy1 qz1 qx2 qy2 qz2] 1 0 0 0 0 0 % this is how signal1 contributes to the 6 dipole components 0 0 0 1 0 0 % this is how signal2 contributes to the 6 dipole components ]'; % note, it should be transposed time = (1:250)/250; signal1 = sin(10*time*2*pi); signal2 = cos(15*time*2*pi); cfg.dip.signal = {[signal1; signal2]}; % one trial only cfg.fsample = 250; % Hz raw3 = dipolesimulation(cfg); avg3 = timelockanalysis([], raw3); > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based > on an MRI > for an individual electrode setting for dipolesimulation. Fieldtrip does not contain code for segmenting an anatomical MRI in such a way that one could make a BEM model out of it. Furthermore, Fieldtrip also does not (yet) contain code for triangulating such a segmentation and computing the BEM forward model. You can however use an externally computed BEM model, but the only external software that is supported is ASA (see http://www.ant-neuro.com/). Perhaps you can download a demo version of that commercial software there, including a BEM model that you can use inside Fieldtrip. EEG BEM models is going to be supported more extensively in Fieldtrip, and also in the upcoming eeglab- dipfit version 2.0 plugin, but for the moment we cannot not support more than this yet. > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on > how > the appropriate cfg should look like. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % do a dipole fit of the first simulated dataset cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0 0]; % initial search position cfg.gridsearch = 'no'; dip1 = dipolefitting(cfg, avg1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % or start with an exhaustive search on a coarse grid cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.gridsearch = 'yes'; cfg.xgrid = linspace(-1,1,5); cfg.ygrid = linspace(-1,1,5); cfg.zgrid = linspace(-1,1,5); dip2 = dipolefitting(cfg, avg1); You should be aware that an exhaustive search only works for a single dipole, for two dipoles you always have to specify a starting location for the nonlinear search. best regards, Robert ================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 17:08:06 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 18:08:06 +0300 Subject: Matlab 7 crashes with Fieldtrip graphics Message-ID: Dear Fieldtrip developers, I started using Matlab 7 and it crashes when using topoplotTFR almost every time (especially if it was already running for a while prior to that). I know it's not your bug but have you encountered this (on Win XP)? This really gets on my nerves. If anyone else has this problem maybe it's a good idea to ask Mathworks about it. Thanks, Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 18:19:50 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 18:19:50 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Robert Oostenveld's message of "Fri, 29 Jul 2005 16:45:01 +0200") Message-ID: Robert Oostenveld writes: > > Here is some sample Matlab code that hopefully explains step by step > how to construct a forward simulated potential distribution. > Thanks very much, the Matlab code really helped alot. -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From rbg26471 at YAHOO.COM Sun Jul 17 20:41:49 2005 From: rbg26471 at YAHOO.COM (rathinaswamy bavanandan govindan) Date: Sun, 17 Jul 2005 11:41:49 -0700 Subject: Request for clarrification Message-ID: Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From D.Talsma at PSY.VU.NL Wed Jul 20 11:54:53 2005 From: D.Talsma at PSY.VU.NL (Talsma D) Date: Wed, 20 Jul 2005 11:54:53 +0200 Subject: Request for clarrification Message-ID: Hi, First of all, let me say that I'm by no means an expert in TF analysis yet, but since the list is quite these days (due to vacation time), let me try and have a stab at answering your question. The error message you are getting suggests that you only have a 0.2 s signal, which is likely too small, specifically, because you request the TF analysis to be conducted between -1 to 1.5 s, which would be an interval too wide to fit into the 200 ms signal. I therefore suspect that there might be an error earlier on in reading in the data, where you may have accidentally read in a much smaller portion of the data than what you intended to. This is but a guess... HTH, Durk -----Oorspronkelijk bericht----- Van: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] Namens rathinaswamy bavanandan govindan Verzonden: Sunday, July 17, 2005 8:42 PM Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] Request for clarrification Hi, Greetings! I am novice to fieldtrip! I am interested in time frequency analysis of MEG data. Before applying the software to my data I started with the Tutorial. I am using version fieldtrip-0.9.6. I just followed the commands 'Reading the data' in tutorial. I used Subject01.ds as test case. I could able to preprocess the data and save the data in dataFIC. Then I followed calculating the time-frequency representation (TFR) using multitapers! cfg.output='pow'; cfg.sgn='all'; cfg.method='convol'; cfg.foi=15:30; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.t_ftimwin=round(dataFIC.fsample.*3./cfg.foi)./dataFIC.fsample; cfg.tapsmofrq=round(cfg.foi./5); cfg.toi=-1:0.01:1.5; cfg.pad=3; cfg.keeptrials='no'; cfg.keeptapers='no'; TFRmult=freqanalysis(cfg,dataFIC); I got the following error message! ??? Error using ==> freqanalysis_mtmconvol 15.000 Hz : datalength to short for specified smoothing datalength: 0.200 s, smoothing: 3.000 Hz, minimum smoothing: 5.000 Hz Error in ==> freqanalysis at 176 eval(sprintf('freq = freqanalysis_%s(cfg,data);',lower(cfg.method))); Error in ==> check at 12 TFRmult=freqanalysis(cfg,dataFIC); It would be nice if someone could give input on this! Thanks for attention! Best regards Govindan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Florian.Fischmeister at UNIVIE.AC.AT Thu Jul 28 20:21:27 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Thu, 28 Jul 2005 20:21:27 +0200 Subject: simulation of a dataset with multiple dipoles Message-ID: Dear Experts, I am trying to simulate an EEG dataset containing multiple dipoles. I do understand, that I can have a single dipole with a different moment and time course per trial using cell-arrays. But how can I obtain multiple dipoles? Is it correct to simulate one dataset per dipol and than sum the different datasets? Currently I am using a 4 spherical shell model with cfg.vol.r = [71 72 79 85]; cfg.vol.c = [0.3300 1 0.0042 0.3300]; cfg.vol.o = [0 0 0]; taken from EEGLAB. What are the correct steps to obtain a BEM forward head-model based on an MRI for an individual electrode setting for dipolesimulation. Finaly, I want to check the simulation using the dipolefitting routine included in fieldtrip. Could you please provide some information on how the appropriate cfg should look like. Thanks in advance, Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Thu Jul 28 22:43:04 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Thu, 28 Jul 2005 23:43:04 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi, You may find the free dipole simulator written by Patrick Berg helpful. It can be downloaded from: ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe You can simulate there ERPs and also raw data with any dipole configuration you like and then convert it to format that Fieldtrip can look at. Best, Vladimir On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > Dear Experts, > > I am trying to simulate an EEG dataset containing multiple dipoles. I do > understand, that I can have a single dipole with a different moment and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? > > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based on an MRI > for an individual electrode setting for dipolesimulation. > > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on how > the appropriate cfg should look like. > > > Thanks in advance, > > Florian > > -- > Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at > Brain Research Laboratory University of Vienna > Faculty of Psychology Liebiggasse 5 > Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria > Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 > From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 10:02:52 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 10:02:52 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Thu, 28 Jul 2005 23:43:04 +0300") Message-ID: Litvak Vladimir writes: > Hi, > > You may find the free dipole simulator written by Patrick Berg > helpful. It can be downloaded from: > > ftp://ftp.besa.de/free_tools/DipoleSimulator-2004-11-19-Install.exe > > You can simulate there ERPs and also raw data with any dipole > configuration you like and then convert it to format that Fieldtrip > can look at. Thanks Vladimir, I already tried the Besa simulator. Using the dipolesimulator I can only generate data with 150 timepoint. My problem is, that I want to simulate slow cortical potentials having trials of 10 sec length and more. best, Florian > > On Thu, 28 Jul 2005, Florian Ph.S Fischmeister wrote: > >> Dear Experts, >> >> I am trying to simulate an EEG dataset containing multiple dipoles. I do >> understand, that I can have a single dipole with a different moment and >> time course per trial using cell-arrays. But how can I obtain multiple >> dipoles? Is it correct to simulate one dataset per dipol and than sum >> the different datasets? >> >> Currently I am using a 4 spherical shell model with >> cfg.vol.r = [71 72 79 85]; >> cfg.vol.c = [0.3300 1 0.0042 0.3300]; >> cfg.vol.o = [0 0 0]; >> taken from EEGLAB. >> >> What are the correct steps to obtain a BEM forward head-model based on an MRI >> for an individual electrode setting for dipolesimulation. >> >> Finaly, I want to check the simulation using the dipolefitting routine >> included in fieldtrip. Could you please provide some information on how >> the appropriate cfg should look like. >> >> >> Thanks in advance, >> >> Florian >> >> -- >> Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at >> Brain Research Laboratory University of Vienna >> Faculty of Psychology Liebiggasse 5 >> Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria >> Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 >> > -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 10:09:57 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 11:09:57 +0300 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: > I already tried the Besa simulator. Using the dipolesimulator I can only > generate data with 150 timepoint. My problem is, that I want to > simulate slow cortical potentials having trials of 10 sec length and > more. But why don't you change the time axis? The important thing is the location of the dipoles and their relative timecourse. Then you can rescale the time axis and call that 'slow potentials'. The only problem with that is that if you want to add noise in the simulator the spectrum of the noise will be wrong. So you can add noise in Matlab later. Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 15:33:17 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 15:33:17 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Litvak Vladimir's message of "Fri, 29 Jul 2005 11:09:57 +0300") Message-ID: Litvak Vladimir writes: >> I already tried the Besa simulator. Using the dipolesimulator I can only >> generate data with 150 timepoint. My problem is, that I want to >> simulate slow cortical potentials having trials of 10 sec length and >> more. > > > But why don't you change the time axis? The important thing is the > location of the dipoles and their relative timecourse. Then you can > rescale the time axis and call that 'slow potentials'. The only > problem with that is that if you want to add noise in the simulator > the spectrum of the noise will be wrong. So you can add noise in > Matlab later. > > Vladimir > Thanks Vladimir, Using our approach works fine with static dipoles with fixed moments. But simulating many datasets with different setting is quite timeconsuming since I do want to run several simulations. Thus the question is still how to simulate a multidipole dataset with fieldtrip, maybe using a BEM headmodel. Florian -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837 From r.oostenveld at FCDONDERS.RU.NL Fri Jul 29 16:45:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 29 Jul 2005 16:45:01 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: Message-ID: Hi Florian, On 28-jul-2005, at 20:21, Florian Ph.S Fischmeister wrote: > I am trying to simulate an EEG dataset containing multiple dipoles. > I do > understand, that I can have a single dipole with a different moment > and > time course per trial using cell-arrays. But how can I obtain multiple > dipoles? Is it correct to simulate one dataset per dipol and than sum > the different datasets? Here is some sample Matlab code that hopefully explains step by step how to construct a forward simulated potential distribution. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a set of electrodes, randomly placed on the sphere elec = []; elec.pnt = randn(128,3); dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere for i=1:128 elec.label{i} = sprintf('%03d', i); end I suggest that you do not use these electrodes, but instead that you get more meaningfull electrode locations (see for example http:// oase.uci.ru.nl/~roberto/index.php/electrode/). % create a concentric 3-sphere volume conductor, the radius is the same as for the electrodes vol = []; vol.r = [0.88 0.92 1.00]; % radii of spheres vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wave cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 250; % Hz raw1 = dipolesimulation(cfg); avg1 = timelockanalysis([], raw1); plot(avg1.time, avg1.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with one dipole and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0.5 0.3]; cfg.dip.mom = [1 0 0]'; % note, it should be transposed cfg.fsample = 250; % Hz time = (1:250)/250; % manually create a time axis signal = sin(10*time*2*pi); % manually create a signal cfg.dip.signal = {signal, signal, signal}; % three trials raw2 = dipolesimulation(cfg); avg2 = timelockanalysis([], raw2); plot(avg2.time, avg2.avg); % plot the timecourse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create a dipole simulation with two dipoles and a custom timecourse cfg = []; cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [ 0 0.5 0.3 % dipole 1 0 -0.5 0.3 % dipole 2 ]; cfg.dip.mom = [ % each row represents [qx1 qy1 qz1 qx2 qy2 qz2] 1 0 0 0 0 0 % this is how signal1 contributes to the 6 dipole components 0 0 0 1 0 0 % this is how signal2 contributes to the 6 dipole components ]'; % note, it should be transposed time = (1:250)/250; signal1 = sin(10*time*2*pi); signal2 = cos(15*time*2*pi); cfg.dip.signal = {[signal1; signal2]}; % one trial only cfg.fsample = 250; % Hz raw3 = dipolesimulation(cfg); avg3 = timelockanalysis([], raw3); > Currently I am using a 4 spherical shell model with > cfg.vol.r = [71 72 79 85]; > cfg.vol.c = [0.3300 1 0.0042 0.3300]; > cfg.vol.o = [0 0 0]; > taken from EEGLAB. > > What are the correct steps to obtain a BEM forward head-model based > on an MRI > for an individual electrode setting for dipolesimulation. Fieldtrip does not contain code for segmenting an anatomical MRI in such a way that one could make a BEM model out of it. Furthermore, Fieldtrip also does not (yet) contain code for triangulating such a segmentation and computing the BEM forward model. You can however use an externally computed BEM model, but the only external software that is supported is ASA (see http://www.ant-neuro.com/). Perhaps you can download a demo version of that commercial software there, including a BEM model that you can use inside Fieldtrip. EEG BEM models is going to be supported more extensively in Fieldtrip, and also in the upcoming eeglab- dipfit version 2.0 plugin, but for the moment we cannot not support more than this yet. > Finaly, I want to check the simulation using the dipolefitting routine > included in fieldtrip. Could you please provide some information on > how > the appropriate cfg should look like. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % do a dipole fit of the first simulated dataset cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.dip.pos = [0 0 0]; % initial search position cfg.gridsearch = 'no'; dip1 = dipolefitting(cfg, avg1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % or start with an exhaustive search on a coarse grid cfg = [] cfg.vol = vol; % see above cfg.elec = elec; % see above cfg.gridsearch = 'yes'; cfg.xgrid = linspace(-1,1,5); cfg.ygrid = linspace(-1,1,5); cfg.zgrid = linspace(-1,1,5); dip2 = dipolefitting(cfg, avg1); You should be aware that an exhaustive search only works for a single dipole, for two dipoles you always have to specify a starting location for the nonlinear search. best regards, Robert ================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From litvak at TECHUNIX.TECHNION.AC.IL Fri Jul 29 17:08:06 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Fri, 29 Jul 2005 18:08:06 +0300 Subject: Matlab 7 crashes with Fieldtrip graphics Message-ID: Dear Fieldtrip developers, I started using Matlab 7 and it crashes when using topoplotTFR almost every time (especially if it was already running for a while prior to that). I know it's not your bug but have you encountered this (on Win XP)? This really gets on my nerves. If anyone else has this problem maybe it's a good idea to ask Mathworks about it. Thanks, Vladimir From Florian.Fischmeister at UNIVIE.AC.AT Fri Jul 29 18:19:50 2005 From: Florian.Fischmeister at UNIVIE.AC.AT (Florian Ph.S Fischmeister) Date: Fri, 29 Jul 2005 18:19:50 +0200 Subject: simulation of a dataset with multiple dipoles In-Reply-To: (Robert Oostenveld's message of "Fri, 29 Jul 2005 16:45:01 +0200") Message-ID: Robert Oostenveld writes: > > Here is some sample Matlab code that hopefully explains step by step > how to construct a forward simulated potential distribution. > Thanks very much, the Matlab code really helped alot. -- Florian Ph.S Fischmeister eMail: Florian.Fischmeister at univie.ac.at Brain Research Laboratory University of Vienna Faculty of Psychology Liebiggasse 5 Tel: +43-(0)1-4277-478-37 A-1010 Vienna, Austria Fax: +43-(0)1-4277-479-39 AT43:+43-(0)59966-4-47837